Show More
@@ -997,3 +997,17 b' def template_review(context, mapping):' | |||||
997 | b'url': m.group(b'url'), |
|
997 | b'url': m.group(b'url'), | |
998 | b'id': b"D{}".format(m.group(b'id')), |
|
998 | b'id': b"D{}".format(m.group(b'id')), | |
999 | }) |
|
999 | }) | |
|
1000 | else: | |||
|
1001 | tags = ctx.repo().nodetags(ctx.node()) | |||
|
1002 | for t in tags: | |||
|
1003 | if _differentialrevisiontagre.match(t): | |||
|
1004 | url = ctx.repo().ui.config(b'phabricator', b'url') | |||
|
1005 | if not url.endswith(b'/'): | |||
|
1006 | url += b'/' | |||
|
1007 | url += t | |||
|
1008 | ||||
|
1009 | return templateutil.hybriddict({ | |||
|
1010 | b'url': url, | |||
|
1011 | b'id': t, | |||
|
1012 | }) | |||
|
1013 | return None |
@@ -106,13 +106,13 b' behind to identify it.' | |||||
106 | Template keywords |
|
106 | Template keywords | |
107 | $ hg log -T'{rev} {phabreview|json}\n' |
|
107 | $ hg log -T'{rev} {phabreview|json}\n' | |
108 | 3 {"id": "D5545", "url": "https://phab.mercurial-scm.org/D5545"} |
|
108 | 3 {"id": "D5545", "url": "https://phab.mercurial-scm.org/D5545"} | |
109 | 2 null |
|
109 | 2 {"id": "D5544", "url": "https://phab.mercurial-scm.org/D5544"} | |
110 | 1 {"id": "D4597", "url": "https://phab.mercurial-scm.org/D4597"} |
|
110 | 1 {"id": "D4597", "url": "https://phab.mercurial-scm.org/D4597"} | |
111 | 0 {"id": "D4596", "url": "https://phab.mercurial-scm.org/D4596"} |
|
111 | 0 {"id": "D4596", "url": "https://phab.mercurial-scm.org/D4596"} | |
112 |
|
112 | |||
113 | $ hg log -T'{rev} {if(phabreview, "{phabreview.url} {phabreview.id}")}\n' |
|
113 | $ hg log -T'{rev} {if(phabreview, "{phabreview.url} {phabreview.id}")}\n' | |
114 | 3 https://phab.mercurial-scm.org/D5545 D5545 |
|
114 | 3 https://phab.mercurial-scm.org/D5545 D5545 | |
115 | 2 |
|
115 | 2 https://phab.mercurial-scm.org/D5544 D5544 | |
116 | 1 https://phab.mercurial-scm.org/D4597 D4597 |
|
116 | 1 https://phab.mercurial-scm.org/D4597 D4597 | |
117 | 0 https://phab.mercurial-scm.org/D4596 D4596 |
|
117 | 0 https://phab.mercurial-scm.org/D4596 D4596 | |
118 |
|
118 |
General Comments 0
You need to be logged in to leave comments.
Login now