comparison hgext/mq.py @ 37522:58230f4fcc0b

py3: use pycompat.byterepr() instead of repr() Differential Revision: https://phab.mercurial-scm.org/D3216
author Pulkit Goyal <7895pulkit@gmail.com>
date Wed, 11 Apr 2018 14:35:28 +0530
parents 2d00058ac2f8
children a7de62adcf03
comparison
equal deleted inserted replaced
37521:2d00058ac2f8 37522:58230f4fcc0b
659 return True, None 659 return True, None
660 guards = self.active() 660 guards = self.active()
661 exactneg = [g for g in patchguards 661 exactneg = [g for g in patchguards
662 if g.startswith('-') and g[1:] in guards] 662 if g.startswith('-') and g[1:] in guards]
663 if exactneg: 663 if exactneg:
664 return False, repr(exactneg[0]) 664 return False, pycompat.byterepr(exactneg[0])
665 pos = [g for g in patchguards if g.startswith('+')] 665 pos = [g for g in patchguards if g.startswith('+')]
666 exactpos = [g for g in pos if g[1:] in guards] 666 exactpos = [g for g in pos if g[1:] in guards]
667 if pos: 667 if pos:
668 if exactpos: 668 if exactpos:
669 return True, repr(exactpos[0]) 669 return True, pycompat.byterepr(exactpos[0])
670 return False, ' '.join(map(repr, pos)) 670 return False, ' '.join([pycompat.byterepr(p) for p in pos])
671 return True, '' 671 return True, ''
672 672
673 def explainpushable(self, idx, all_patches=False): 673 def explainpushable(self, idx, all_patches=False):
674 if all_patches: 674 if all_patches:
675 write = self.ui.write 675 write = self.ui.write