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')), - } + }) 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 ..