changeset 41907:59bae59b7498

py3: fix a few "dict keys as str instead of bytes" issues in phabricator.py Differential Revision: https://phab.mercurial-scm.org/D6108
author Ian Moody <moz-ian@perix.co.uk>
date Sat, 09 Mar 2019 01:30:44 +0000
parents a98dabdb5a7b
children 8fd19a7b4ed6
files hgext/phabricator.py
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/phabricator.py	Sat Mar 09 01:00:25 2019 +0000
+++ b/hgext/phabricator.py	Sat Mar 09 01:30:44 2019 +0000
@@ -762,7 +762,7 @@
     """
     def fetch(params):
         """params -> single drev or None"""
-        key = (params.get(r'ids') or params.get(r'phids') or [None])[0]
+        key = (params.get(b'ids') or params.get(b'phids') or [None])[0]
         if key in prefetched:
             return prefetched[key]
         drevs = callconduit(repo, b'differential.query', params)
@@ -779,7 +779,7 @@
         """given a top, get a stack from the bottom, [id] -> [id]"""
         visited = set()
         result = []
-        queue = [{r'ids': [i]} for i in topdrevids]
+        queue = [{b'ids': [i]} for i in topdrevids]
         while queue:
             params = queue.pop()
             drev = fetch(params)
@@ -923,7 +923,7 @@
         # Try to preserve metadata from hg:meta property. Write hg patch
         # headers that can be read by the "import" command. See patchheadermap
         # and extract in mercurial/patch.py for supported headers.
-        meta = getdiffmeta(diffs[str(diffid)])
+        meta = getdiffmeta(diffs[b'%d' % diffid])
         for k in _metanamemap.keys():
             if k in meta:
                 header += b'# %s %s\n' % (_metanamemap[k], meta[k])