This is an archive of the discontinued Mercurial Phabricator instance.

releasenotes: view admonition titles using -l flag
ClosedPublic

Authored by rishabhmadan96 on Aug 20 2017, 12:33 PM.

Details

Summary

Since this extension is fairly new for almost all the contributors, remembering
the admonition (with titles) is difficult. The list (-l) flag provides
a list of all the active admonitions along with titles.

For usage, hg releasenotes -l returns the list.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

pulkit requested changes to this revision.Aug 21 2017, 7:55 AM
pulkit added a subscriber: pulkit.

The patch in general looks good to me. I have some inline comments.

hgext/releasenotes.py
278

Generally we add a '_' before an internal function. Since you need to resend because you need to rebase, can you change the function name to _getadmonitionlist. Also it will be extremely great if you send a patch documenting the functions in the releasenotes.py file.

475

I am not sure whether -a is the best choice of flag. Maybe we can have -l and --list.

Also the help can be improved to "list the available admonitions with their title".

tests/test-releasenotes-formatting.t
409–422

The above lines were added in D368 which is not yet pushed. So can you rebase this patch and resend so that it can be pushed independently.

This revision now requires changes to proceed.Aug 21 2017, 7:55 AM
rishabhmadan96 added inline comments.Aug 21 2017, 9:04 AM
hgext/releasenotes.py
475

--list sounds good to me. I'll make the changes.

rishabhmadan96 edited the summary of this revision. (Show Details)
rishabhmadan96 retitled this revision from releasenotes: view admonition titles using -a flag to releasenotes: view admonition titles using -l flag.
rishabhmadan96 updated this revision to Diff 1123.
rishabhmadan96 edited the summary of this revision. (Show Details)Aug 21 2017, 9:15 AM
yuja requested changes to this revision.Aug 27 2017, 6:03 AM
yuja added a subscriber: yuja.
yuja added inline comments.
hgext/releasenotes.py
247

Perhaps this can be just for section in sections since
releasenotessections implements __iter__.

248

Delete _(), which is the marker for strings to be translated.

"%s: %s\n" % ... should be better for python 3 compatibility.

558

merge error?

This revision now requires changes to proceed.Aug 27 2017, 6:03 AM
pulkit requested changes to this revision.Aug 27 2017, 5:15 PM

@rishabhmadan96 Also make sure a user cannot pass any other flag with the --list flag.

In D454#8571, @pulkit wrote:

@rishabhmadan96 Also make sure a user cannot pass any other flag with the --list flag.

I'm using return while calling the function. Wouldn't that be enough for this?

rishabhmadan96 edited the summary of this revision. (Show Details)
rishabhmadan96 updated this revision to Diff 1331.
This revision was automatically updated to reflect the committed changes.