comparison contrib/phabricator.py @ 35722:f18ba40d792f

phabricator: add a template item for linking to a differential review Differential Revision: https://phab.mercurial-scm.org/D1802
author Tom Prince <mozilla@hocat.ca>
date Tue, 02 Jan 2018 10:09:08 -0700
parents a0d33f4ddff9
children 7b74afec6772
comparison
equal deleted inserted replaced
35721:f50067fbeead 35722:f18ba40d792f
863 actions.append({'type': 'comment', 'value': opts['comment']}) 863 actions.append({'type': 'comment', 'value': opts['comment']})
864 if actions: 864 if actions:
865 params = {'objectIdentifier': drev[r'phid'], 865 params = {'objectIdentifier': drev[r'phid'],
866 'transactions': actions} 866 'transactions': actions}
867 callconduit(repo, 'differential.revision.edit', params) 867 callconduit(repo, 'differential.revision.edit', params)
868
869 templatekeyword = registrar.templatekeyword()
870
871 @templatekeyword('phabreview')
872 def template_review(repo, ctx, revcache, **args):
873 """:phabreview: Object describing the review for this changeset.
874 Has attributes `url` and `id`.
875 """
876 m = _differentialrevisiondescre.search(ctx.description())
877 if m:
878 return {
879 'url': m.group('url'),
880 'id': "D{}".format(m.group('id')),
881 }