Patchwork D3508: scmutil: fix __repr__ of status tuple

login
register
mail settings
Submitter phabricator
Date May 8, 2018, 7:27 p.m.
Message ID <differential-rev-PHID-DREV-fcbayceujxfudjr57bg2-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/31408/
State Superseded
Headers show

Comments

phabricator - May 8, 2018, 7:27 p.m.
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  We should probably start giving some thought to migrating the status
  tuple to attrs, but not now.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/scmutil.py

CHANGE DETAILS




To: durin42, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
--- a/mercurial/scmutil.py
+++ b/mercurial/scmutil.py
@@ -104,8 +104,10 @@ 
         return self[6]
 
     def __repr__(self, *args, **kwargs):
-        return (('<status modified=%r, added=%r, removed=%r, deleted=%r, '
-                 'unknown=%r, ignored=%r, clean=%r>') % self)
+        return ((r'<status modified=%s, added=%s, removed=%s, deleted=%s, '
+                 r'unknown=%s, ignored=%s, clean=%s>') %
+                tuple(pycompat.sysstr(stringutil.pprint(
+                    v, bprefix=False)) for v in self))
 
 def itersubrepos(ctx1, ctx2):
     """find subrepos in ctx1 or ctx2"""