2016-04-27 19:50:13 +03:00
|
|
|
$ PYTHONPATH=$TESTDIR/..:$PYTHONPATH
|
2014-10-17 04:43:58 +04:00
|
|
|
$ echo "[extensions]" >> $HGRCPATH
|
2017-01-13 17:15:41 +03:00
|
|
|
$ echo "phabdiff=" >> $HGRCPATH
|
2014-10-17 04:43:58 +04:00
|
|
|
|
|
|
|
Setup repo
|
|
|
|
|
|
|
|
$ hg init repo
|
|
|
|
$ cd repo
|
|
|
|
|
|
|
|
Test phabdiff template mapping
|
|
|
|
|
|
|
|
$ echo a > a
|
2015-12-14 22:20:43 +03:00
|
|
|
$ hg commit -Aqm "Differential Revision: https://phabricator.fb.com/D1234
|
2015-12-17 02:53:53 +03:00
|
|
|
> Task ID: 2312"
|
2014-10-17 04:43:58 +04:00
|
|
|
$ hg log --template "{phabdiff}\n"
|
|
|
|
D1234
|
|
|
|
|
phabdiff: make phabdiff more URL-agnostic
Summary: We want out phabricator diff parsers to recognize both https://phabricator.intern.facebook.com/ and https://phabricator.fb.com/ URLs (and a bigger class as well).
Test Plan:
- updated some tests (for `phabdiff` and `pullcreatemarkers` other files don't even seem to be used)
- ran tests
- tested phabdiff manually as well:
{F60696023}
Reviewers: #sourcecontrol, andersonmat, mitrandir, simpkins, lcharignon, quark, ttung, ikostia, rmcelroy
Reviewed By: ikostia, rmcelroy
Subscribers: wez, rmcelroy, net-systems-diffs@, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D3229776
Tasks: 11013909, 11017978
Signature: t1:3229776:1461839346:08b9b3414e43ff9966bc05591ca5662ef9691aac
2016-04-28 20:55:06 +03:00
|
|
|
$ echo c > c
|
|
|
|
$ hg commit -Aqm "Differential Revision: http://phabricator.intern.facebook.com/D1245
|
|
|
|
> Task ID: 2312"
|
|
|
|
$ hg log -r . --template "{phabdiff}\n"
|
|
|
|
D1245
|
|
|
|
|
2014-10-17 04:43:58 +04:00
|
|
|
$ echo b > b
|
2015-12-14 22:20:43 +03:00
|
|
|
$ hg commit -Aqm "Differential Revision: https://phabricator.fb.com/D5678
|
2017-01-13 17:15:41 +03:00
|
|
|
> Tasks:32, 44 55"
|
phabdiff: make phabdiff more URL-agnostic
Summary: We want out phabricator diff parsers to recognize both https://phabricator.intern.facebook.com/ and https://phabricator.fb.com/ URLs (and a bigger class as well).
Test Plan:
- updated some tests (for `phabdiff` and `pullcreatemarkers` other files don't even seem to be used)
- ran tests
- tested phabdiff manually as well:
{F60696023}
Reviewers: #sourcecontrol, andersonmat, mitrandir, simpkins, lcharignon, quark, ttung, ikostia, rmcelroy
Reviewed By: ikostia, rmcelroy
Subscribers: wez, rmcelroy, net-systems-diffs@, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D3229776
Tasks: 11013909, 11017978
Signature: t1:3229776:1461839346:08b9b3414e43ff9966bc05591ca5662ef9691aac
2016-04-28 20:55:06 +03:00
|
|
|
$ hg log -r . --template "{phabdiff}: {tasks}\n"
|
2017-01-13 17:15:41 +03:00
|
|
|
D5678: 32 44 55
|
|
|
|
|
|
|
|
$ echo d > d
|
|
|
|
$ hg commit -Aqm "Differential Revision: http://phabricator.intern.facebook.com/D1245
|
|
|
|
> Task: t123456,456"
|
|
|
|
$ hg log -r . --template "{phabdiff}: {tasks}\n"
|
|
|
|
D1245: 123456 456
|
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 23:52:54 +03:00
|
|
|
|
2017-03-29 06:53:07 +03:00
|
|
|
Only match the Differential Revision label at the start of a line
|
|
|
|
|
|
|
|
$ echo e > e
|
|
|
|
$ hg commit -Aqm "Test Commit
|
|
|
|
> Test Plan: tested on Differential Revision: http://phabricator.intern.facebook.com/D1000
|
|
|
|
> Differential Revision: http://phabricator.intern.facebook.com/D6789
|
|
|
|
> "
|
|
|
|
$ hg log -r . --template "{phabdiff}\n"
|
|
|
|
D6789
|
|
|
|
|
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 23:52:54 +03:00
|
|
|
Make sure the template keywords are documented correctly
|
|
|
|
|
|
|
|
$ hg help templates | egrep 'phabdiff|tasks'
|
|
|
|
phabdiff String. Return the phabricator diff id for a given hg rev.
|
|
|
|
tasks String. Return the tasks associated with given hg rev.
|