# HG changeset patch # User Augie Fackler # Date 2017-10-18 22:30:02 # Node ID 068e0e5315848418fd4be8a5a7ae4f4197e9dda1 # Parent e1458bce84dbf74db98eccd87b41efe13180f057 cmdutil: fix status tersing on Python 3 Differential Revision: https://phab.mercurial-scm.org/D1183 diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py --- a/mercurial/cmdutil.py +++ b/mercurial/cmdutil.py @@ -526,7 +526,7 @@ def tersedir(statuslist, terseargs): 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 @@ def tersedir(statuslist, terseargs): 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():