D4604: phabricator: fix templating bug by using hybriddict

durin42 (Augie Fackler) phabricator at mercurial-scm.org
Sat Sep 15 05:24:19 UTC 2018


durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D4604

AFFECTED FILES
  hgext/phabricator.py
  tests/test-phabricator.t

CHANGE DETAILS

diff --git a/tests/test-phabricator.t b/tests/test-phabricator.t
--- a/tests/test-phabricator.t
+++ b/tests/test-phabricator.t
@@ -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 ..
diff --git a/hgext/phabricator.py b/hgext/phabricator.py
--- a/hgext/phabricator.py
+++ b/hgext/phabricator.py
@@ -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')),
-        }
+        })



To: durin42, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list