Commit Graph

2 Commits

Author SHA1 Message Date
Adam Simpkins
63b7bb19c5 templates: fix help messages for template keywords
Summary:
Many of the template keywords in our extensions were being registered
incorrectly, causing their help output to be rendered incorrectly in the
"hg help templates" output.  The ones in smartlog.py were particularly bad, as
most of them showed only their description, without displaying the name of the
template.  In smartlog.py only singlepublicsuccessor was being displayed
correctly, because it's docstring explicitly included it's own name at the
start.

This fixes all of our extensions to consistently use the
registrar.templatekeyword() decorator to register the keywords.  This decorator
automatically prefixes the help message with the keyword name.  The
mercurial/extensions.py code will explicitly check to see if an extension
contains an "templatekeyword" attribute, and if so it will register any
keywords contained in this registry after calling extsetup().

Test Plan:
Added new unit tests to check the output of "hg help templates" for the
affected keywords.

Reviewers: #sourcecontrol, kulshrax, ikostia, rmcelroy

Reviewed By: rmcelroy

Subscribers: rmcelroy, net-systems-diffs@, yogeshwer, mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D4427729

Signature: t1:4427729:1484831476:17b478a5e867dfc3f85402588c381bf8b1831107
2017-01-19 12:52:54 -08:00
Alexander Mols
8391d808d0 myparent: commit template keywords based on your previous commit
Summary:
An extension to pre-fill your commit template based on your own
previous commit. Useful for stacked diffs where the commits are mostly related
and will have mostly the same reviewers, tasks, etc.

Test Plan: dogfooding + tests

Reviewers: #sourcecontrol, mjpieters, quark

Reviewed By: quark

Subscribers: quark, mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D4265616

Tasks: 12218809

Signature: t1:4265616:1480946835:ed18fadbd9068f2d2ec4799fa1ac176132b41e4b
2016-12-05 06:27:29 -08:00