phabricator: read more metadata from local:commits
authorIan Moody <moz-ian@perix.co.uk>
Sat, 20 Apr 2019 17:27:24 +0100
changeset 42235 c4d96f4761d3
parent 42234 6dd454e5b123
child 42236 258821f2d465
phabricator: read more metadata from local:commits local:commits metadata can contain branch info, and 'rev' has been superseded by 'commit', see: https://github.com/phacility/arcanist/blob/83661809e532c3fe444a8bf7c7d6936e6377691b/src/repository/api/ArcanistMercurialAPI.php#L281 Differential Revision: https://phab.mercurial-scm.org/D6300
hgext/phabricator.py
--- a/hgext/phabricator.py	Sat Apr 20 17:22:35 2019 +0100
+++ b/hgext/phabricator.py	Sat Apr 20 17:27:24 2019 +0100
@@ -911,8 +911,11 @@
                                           commit[b'authorEmail'])
         if b'time' in commit:
             meta[b'date'] = b'%d 0' % commit[b'time']
-        if b'rev' in commit:
-            meta[b'node'] = commit[b'rev']
+        if b'branch' in commit:
+            meta[b'branch'] = commit[b'branch']
+        node = commit.get(b'commit', commit.get(b'rev'))
+        if node:
+            meta[b'node'] = node
         if len(commit.get(b'parents', ())) >= 1:
             meta[b'parent'] = commit[b'parents'][0]
     return meta or {}