This is an archive of the discontinued Mercurial Phabricator instance.

releasenotes: add check flag for use of admonitions and its validity
ClosedPublic

Authored by rishabhmadan96 on Aug 13 2017, 10:29 AM.

Details

Summary

While using releasenotes extension, we will be using admonitions in commit messages.
The check (-c) flag will look for an admonition within the message. If it exists, it will
verify if it is stated under default or custom admonition. The check fails if the
admonition is not present in any of them. It also suggests similar admonitions
in case the admonition is invalid.

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

durin42 requested changes to this revision.Aug 15 2017, 1:09 PM
durin42 added a subscriber: durin42.

A style nit, generally +1 and if you get the style nits handled we should be good to go.

hgext/releasenotes.py
266

nit: in a "-quoted string, you can omit \ on '

not a nit: use

("foo"
 "bar")

instead of \ to wrap a multi-line string literal (the concatenation is implicit at module load time).

This revision now requires changes to proceed.Aug 15 2017, 1:09 PM
rishabhmadan96 retitled this revision from releasenotes: add check flag for use of admonitions and its validity to Differential Revision: https://phab.mercurial-scm.org/D368 releasenotes: add check flag for use of admonitions and its validity.
rishabhmadan96 updated this revision to Diff 973.
quark added a subscriber: quark.Aug 16 2017, 1:45 AM

Did you add "Differential Revision: https://phab.mercurial-scm.org/D368" to the first line of your commit message? Could you try moving it to the last line?

rishabhmadan96 retitled this revision from Differential Revision: https://phab.mercurial-scm.org/D368 releasenotes: add check flag for use of admonitions and its validity to releasenotes: add check flag for use of admonitions and its validity.Aug 16 2017, 1:46 AM

Sorry I just edited the revision string. Will that work? Or should I update it again with "Differential Revision: https://phab.mercurial-scm.org/D368" at the end.

quark added a comment.Aug 16 2017, 6:04 PM

Sorry I just edited the revision string. Will that work? Or should I update it again with "Differential Revision: https://phab.mercurial-scm.org/D368" at the end.

No worries. The title is good now. "Edit Revision" from the web page works. The title can also be updated by "phabsend", which updates the title to be consistent with the commit message.

krbullock accepted this revision.Aug 23 2017, 11:24 AM
krbullock added a subscriber: krbullock.

Looks good, queued!

This revision was automatically updated to reflect the committed changes.
pulkit added a subscriber: pulkit.EditedAug 23 2017, 6:08 PM

@rishabhmadan96 Sorry for jumping late, can you followup with a patch adding some docs for the flag. Also document the behavior of hg releasenotes -c and it will be great if you can add a test for this.