From patchwork Wed Oct 18 22:30:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D1183: cmdutil: fix status tersing on Python 3 From: phabricator X-Patchwork-Id: 25221 Message-Id: To: mercurial-devel@mercurial-scm.org Date: Wed, 18 Oct 2017 22:30:52 +0000 durin42 created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D1183 AFFECTED FILES mercurial/cmdutil.py CHANGE DETAILS To: durin42, #hg-reviewers Cc: mercurial-devel diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py --- a/mercurial/cmdutil.py +++ b/mercurial/cmdutil.py @@ -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():