phabricator: fix templating bug by using hybriddict
Differential Revision: https://phab.mercurial-scm.org/D4604
--- a/hgext/phabricator.py Sat Sep 15 01:13:37 2018 -0400
+++ b/hgext/phabricator.py Sat Sep 15 01:16:31 2018 -0400
@@ -62,6 +62,7 @@
scmutil,
smartset,
tags,
+ templateutil,
url as urlmod,
util,
)
@@ -1006,7 +1007,7 @@
ctx = context.resource(mapping, b'ctx')
m = _differentialrevisiondescre.search(ctx.description())
if m:
- return {
+ return templateutil.hybriddict({
b'url': m.group(b'url'),
b'id': b"D{}".format(m.group(b'id')),
- }
+ })
--- a/tests/test-phabricator.t Sat Sep 15 01:13:37 2018 -0400
+++ b/tests/test-phabricator.t Sat Sep 15 01:16:31 2018 -0400
@@ -70,10 +70,8 @@
1 {"id": "D4597", "url": "https://phab.mercurial-scm.org/D4597"}
0 {"id": "D4596", "url": "https://phab.mercurial-scm.org/D4596"}
-BUG: this should work, but doesn't.
- $ hg log -T'{rev} {phabreview.url}\n'
- hg: parse error: {* 'D4597'*} is not a dictionary (glob)
- (keyword 'phabreview' does not support member operation)
- [255]
+ $ hg log -T'{rev} {phabreview.url} {phabreview.id}\n'
+ 1 https://phab.mercurial-scm.org/D4597 D4597
+ 0 https://phab.mercurial-scm.org/D4596 D4596
$ cd ..