D6300: phabricator: read more metadata from local:commits

Kwan (Ian Moody) phabricator at mercurial-scm.org
Mon Apr 22 11:53:04 EDT 2019


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

REVISION SUMMARY
  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

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  hgext/phabricator.py

CHANGE DETAILS

diff --git a/hgext/phabricator.py b/hgext/phabricator.py
--- a/hgext/phabricator.py
+++ b/hgext/phabricator.py
@@ -913,8 +913,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 {}



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


More information about the Mercurial-devel mailing list