mq: use stringutil.pprint instead of pycompat.byterepr
authorAugie Fackler <augie@google.com>
Fri, 10 Aug 2018 02:06:46 -0400
changeset 39086 b53ec524420b
parent 39085 d722020bbd9d
child 39087 0a2ce5b43574
mq: use stringutil.pprint instead of pycompat.byterepr Resolves a few output changes on Python 3 in test-mq.t, and gets us two new passing tests. Differential Revision: https://phab.mercurial-scm.org/D4248
contrib/python3-whitelist
hgext/mq.py
--- a/contrib/python3-whitelist	Thu Aug 09 13:27:05 2018 -0400
+++ b/contrib/python3-whitelist	Fri Aug 10 02:06:46 2018 -0400
@@ -301,6 +301,7 @@
 test-minifileset.py
 test-minirst.py
 test-mq-git.t
+test-mq-guards.t
 test-mq-header-date.t
 test-mq-header-from.t
 test-mq-merge.t
@@ -313,6 +314,7 @@
 test-mq-qimport-fail-cleanup.t
 test-mq-qnew.t
 test-mq-qpush-exact.t
+test-mq-qpush-fail.t
 test-mq-qqueue.t
 test-mq-qrefresh-interactive.t
 test-mq-qrefresh-replace-log-message.t
--- a/hgext/mq.py	Thu Aug 09 13:27:05 2018 -0400
+++ b/hgext/mq.py	Fri Aug 10 02:06:46 2018 -0400
@@ -662,13 +662,13 @@
         exactneg = [g for g in patchguards
                     if g.startswith('-') and g[1:] in guards]
         if exactneg:
-            return False, pycompat.byterepr(exactneg[0])
+            return False, stringutil.pprint(exactneg[0])
         pos = [g for g in patchguards if g.startswith('+')]
         exactpos = [g for g in pos if g[1:] in guards]
         if pos:
             if exactpos:
-                return True, pycompat.byterepr(exactpos[0])
-            return False, ' '.join([pycompat.byterepr(p) for p in pos])
+                return True, stringutil.pprint(exactpos[0])
+            return False, ' '.join([stringutil.pprint(p) for p in pos])
         return True, ''
 
     def explainpushable(self, idx, all_patches=False):