Patchwork D10703: Fix hgext/convert/p4.py for Python 3

login
register
mail settings
Submitter phabricator
Date May 9, 2021, 10:03 p.m.
Message ID <differential-rev-PHID-DREV-x7csb65xszihtv2x5gmx-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/49022/
State Superseded
Headers show

Comments

phabricator - May 9, 2021, 10:03 p.m.
nate created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  b/hgext/convert/p4.py

CHANGE DETAILS




To: nate, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/a/hgext/convert/p4.py b/b/hgext/convert/p4.py
--- a/a/hgext/convert/p4.py
+++ b/b/hgext/convert/p4.py
@@ -151,12 +151,10 @@ 
                     views[sview] = cview
 
         # list of changes that affect our source files
-        p4changes = p4changes.keys()
-        p4changes.sort(key=int)
+        p4changes = sorted(p4changes.keys(), key=int)
 
         # list with depot pathnames, longest first
-        vieworder = views.keys()
-        vieworder.sort(key=len, reverse=True)
+        vieworder = sorted(views.keys(), key=len, reverse=True)
 
         # handle revision limiting
         startrev = self.ui.config(b'convert', b'p4.startrev')
@@ -188,7 +186,7 @@ 
             else:
                 shortdesc = b'**empty changelist description**'
 
-            t = b'%s %s' % (c.rev, repr(shortdesc)[1:-1])
+            t = b'%s %s' % (c.rev, repr(shortdesc).encode("utf8")[1:-1])
             ui.status(stringutil.ellipsis(t, 80) + b'\n')
 
             files = []