diff mercurial/cmdutil.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 1a31111e6239
children b82c6dd15f5d
line wrap: on
line diff
--- a/mercurial/cmdutil.py	Sat Jan 27 17:31:25 2018 +0900
+++ b/mercurial/cmdutil.py	Sat Jan 27 17:46:37 2018 +0900
@@ -1563,11 +1563,6 @@
         if fo is not None:
             fo.close()
 
-def _maybebytestr(v):
-    if isinstance(v, bytes):
-        return pycompat.bytestr(v)
-    return v
-
 def showmarker(fm, marker, index=None):
     """utility function to display obsolescence marker in a readable way
 
@@ -1586,7 +1581,7 @@
     fm.write('date', '(%s) ', fm.formatdate(marker.date()))
     meta = marker.metadata().copy()
     meta.pop('date', None)
-    smeta = util.rapply(_maybebytestr, meta)
+    smeta = util.rapply(pycompat.maybebytestr, meta)
     fm.write('metadata', '{%s}', fm.formatdict(smeta, fmt='%r: %r', sep=', '))
     fm.plain('\n')