D3216: py3: use pycompat.bytestr() where repr in involved

2018-04-10 Thread yuja (Yuya Nishihara)
yuja requested changes to this revision.
yuja added inline comments.
This revision now requires changes to proceed.

INLINE COMMENTS

> mq.py:670
> +return True, pycompat.bytestr(repr(exactpos[0]))
> +return False, ' '.join([pycompat.bytestr(repr(p)) for p in pos])
>  return True, ''

Maybe these three should be `byterepr()`.

REPOSITORY
  rHG Mercurial

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

To: pulkit, #hg-reviewers, yuja
Cc: yuja, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D3216: py3: use pycompat.bytestr() where repr in involved

2018-04-10 Thread pulkit (Pulkit Goyal)
pulkit 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/D3216

AFFECTED FILES
  hgext/mq.py

CHANGE DETAILS

diff --git a/hgext/mq.py b/hgext/mq.py
--- a/hgext/mq.py
+++ b/hgext/mq.py
@@ -661,13 +661,13 @@
 exactneg = [g for g in patchguards
 if g.startswith('-') and g[1:] in guards]
 if exactneg:
-return False, repr(exactneg[0])
+return False, pycompat.bytestr(repr(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, repr(exactpos[0])
-return False, ' '.join(map(repr, pos))
+return True, pycompat.bytestr(repr(exactpos[0]))
+return False, ' '.join([pycompat.bytestr(repr(p)) for p in pos])
 return True, ''
 
 def explainpushable(self, idx, all_patches=False):
@@ -1156,7 +1156,7 @@
 for c in ('#', ':', '\r', '\n'):
 if c in name:
 raise error.Abort(_('%r cannot be used in the name of a patch')
- % c)
+ % pycompat.bytestr(c))
 
 def checkpatchname(self, name, force=False):
 self.checkreservedname(name)



To: pulkit, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel