D1802: phabricator: add a template item for linking to a differential review
tom.prince (Tom Prince)
phabricator at mercurial-scm.org
Mon Jan 15 16:58:36 EST 2018
tom.prince updated this revision to Diff 4834.
tom.prince retitled this revision from "Add a template item for linking to a differential review." to "phabricator: add a template item for linking to a differential review".
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST UPDATE
https://phab.mercurial-scm.org/D1802?vs=4681&id=4834
REVISION DETAIL
https://phab.mercurial-scm.org/D1802
AFFECTED FILES
contrib/phabricator.py
CHANGE DETAILS
diff --git a/contrib/phabricator.py b/contrib/phabricator.py
--- a/contrib/phabricator.py
+++ b/contrib/phabricator.py
@@ -865,3 +865,17 @@
params = {'objectIdentifier': drev[r'phid'],
'transactions': actions}
callconduit(repo, 'differential.revision.edit', params)
+
+templatekeyword = registrar.templatekeyword()
+
+ at templatekeyword('phabreview')
+def template_review(repo, ctx, revcache, **args):
+ """:phabreview: Object describing the review for this changeset.
+ Has attributes `url` and `id`.
+ """
+ m = _differentialrevisiondescre.search(ctx.description())
+ if m:
+ return {
+ 'url': m.group('url'),
+ 'id': "D{}".format(m.group('id')),
+ }
To: tom.prince, #hg-reviewers, indygreg
Cc: indygreg, pulkit, mercurial-devel
More information about the Mercurial-devel
mailing list