diff mercurial/revset.py @ 35944:fc44c2657dc5

py3: drop b'' from repr() of smartset cmdutil._maybebytestr() is moved to pycompat.
author Yuya Nishihara <yuya@tcha.org>
date Sat, 27 Jan 2018 17:46:37 +0900
parents 00a56c83ab64
children 7a991241f586
line wrap: on
line diff
--- a/mercurial/revset.py	Sat Jan 27 17:31:25 2018 +0900
+++ b/mercurial/revset.py	Sat Jan 27 17:46:37 2018 +0900
@@ -105,6 +105,9 @@
                 pass
     return None
 
+def _sortedb(xs):
+    return sorted(util.rapply(pycompat.maybebytestr, xs))
+
 # operator methods
 
 def stringset(repo, subset, x, order):
@@ -507,7 +510,7 @@
         b.add(getbranch(r))
     c = s.__contains__
     return subset.filter(lambda r: c(r) or getbranch(r) in b,
-                         condrepr=lambda: '<branch %r>' % sorted(b))
+                         condrepr=lambda: '<branch %r>' % _sortedb(b))
 
 @predicate('phasedivergent()', safe=True)
 def phasedivergent(repo, subset, x):
@@ -760,7 +763,7 @@
             src = _getrevsource(repo, r)
 
     return subset.filter(dests.__contains__,
-                         condrepr=lambda: '<destination %r>' % sorted(dests))
+                         condrepr=lambda: '<destination %r>' % _sortedb(dests))
 
 @predicate('contentdivergent()', safe=True)
 def contentdivergent(repo, subset, x):