changeset 34893:068e0e531584

cmdutil: fix status tersing on Python 3 Differential Revision: https://phab.mercurial-scm.org/D1183
author Augie Fackler <augie@google.com>
date Wed, 18 Oct 2017 18:30:02 -0400
parents e1458bce84db
children b63a7d839c33
files mercurial/cmdutil.py
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/cmdutil.py	Wed Oct 18 18:29:17 2017 -0400
+++ b/mercurial/cmdutil.py	Wed Oct 18 18:30:02 2017 -0400
@@ -526,7 +526,7 @@
     allst = ('m', 'a', 'r', 'd', 'u', 'i', 'c')
 
     # checking the argument validity
-    for s in terseargs:
+    for s in pycompat.bytestr(terseargs):
         if s not in allst:
             raise error.Abort(_("'%s' not recognized") % s)
 
@@ -537,9 +537,10 @@
 
     tersedict = {}
     for attrname in pstatus:
+        statuschar = attrname[0:1]
         for f in getattr(statuslist, attrname):
-            rootobj.addfile(f, attrname[0])
-        tersedict[attrname[0]] = []
+            rootobj.addfile(f, statuschar)
+        tersedict[statuschar] = []
 
     # we won't be tersing the root dir, so add files in it
     for st, fpath in rootobj.iterfilepaths():