Mercurial > hg
comparison hgext/mq.py @ 39049:b53ec524420b
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
author | Augie Fackler <augie@google.com> |
---|---|
date | Fri, 10 Aug 2018 02:06:46 -0400 |
parents | e7aa113b14f7 |
children | 24e493ec2229 |
comparison
equal
deleted
inserted
replaced
39048:d722020bbd9d | 39049:b53ec524420b |
---|---|
660 return True, None | 660 return True, None |
661 guards = self.active() | 661 guards = self.active() |
662 exactneg = [g for g in patchguards | 662 exactneg = [g for g in patchguards |
663 if g.startswith('-') and g[1:] in guards] | 663 if g.startswith('-') and g[1:] in guards] |
664 if exactneg: | 664 if exactneg: |
665 return False, pycompat.byterepr(exactneg[0]) | 665 return False, stringutil.pprint(exactneg[0]) |
666 pos = [g for g in patchguards if g.startswith('+')] | 666 pos = [g for g in patchguards if g.startswith('+')] |
667 exactpos = [g for g in pos if g[1:] in guards] | 667 exactpos = [g for g in pos if g[1:] in guards] |
668 if pos: | 668 if pos: |
669 if exactpos: | 669 if exactpos: |
670 return True, pycompat.byterepr(exactpos[0]) | 670 return True, stringutil.pprint(exactpos[0]) |
671 return False, ' '.join([pycompat.byterepr(p) for p in pos]) | 671 return False, ' '.join([stringutil.pprint(p) for p in pos]) |
672 return True, '' | 672 return True, '' |
673 | 673 |
674 def explainpushable(self, idx, all_patches=False): | 674 def explainpushable(self, idx, all_patches=False): |
675 if all_patches: | 675 if all_patches: |
676 write = self.ui.write | 676 write = self.ui.write |