py3: use pycompat.bytestr() in dirstate.py
authorPulkit Goyal <7895pulkit@gmail.com>
Mon, 19 Mar 2018 00:06:10 +0530
changeset 36995 d5d42c170f4d
parent 36994 0baf0e3ee569
child 36996 1bf555cb680e
py3: use pycompat.bytestr() in dirstate.py This prevents extra b'' prefixes in output. Differential Revision: https://phab.mercurial-scm.org/D2894
mercurial/dirstate.py
--- a/mercurial/dirstate.py	Mon Mar 19 00:02:59 2018 +0530
+++ b/mercurial/dirstate.py	Mon Mar 19 00:06:10 2018 +0530
@@ -371,7 +371,8 @@
         if state == 'a' or oldstate == 'r':
             scmutil.checkfilename(f)
             if self._map.hastrackeddir(f):
-                raise error.Abort(_('directory %r already in dirstate') % f)
+                raise error.Abort(_('directory %r already in dirstate') %
+                                  pycompat.bytestr(f))
             # shadows
             for d in util.finddirs(f):
                 if self._map.hastrackeddir(d):
@@ -379,7 +380,8 @@
                 entry = self._map.get(d)
                 if entry is not None and entry[0] != 'r':
                     raise error.Abort(
-                        _('file %r in dirstate clashes with %r') % (d, f))
+                        _('file %r in dirstate clashes with %r') %
+                        (pycompat.bytestr(d), pycompat.bytestr(f)))
         self._dirty = True
         self._updatedfiles.add(f)
         self._map.addfile(f, oldstate, state, mode, size, mtime)