mercurial/pathutil.py
changeset 36649 d3b893ec5f08
parent 36647 052351e3e1cd
child 38592 21be76e07148
--- a/mercurial/pathutil.py	Sat Mar 03 12:36:05 2018 -0500
+++ b/mercurial/pathutil.py	Sat Mar 03 12:23:03 2018 -0500
@@ -81,7 +81,7 @@
                     pos = lparts.index(p)
                     base = os.path.join(*parts[:pos])
                     raise error.Abort(_("path '%s' is inside nested repo %r")
-                                     % (path, base))
+                                      % (path, pycompat.bytestr(base)))
 
         normparts = util.splitpath(normpath)
         assert len(parts) == len(normparts)
@@ -119,13 +119,14 @@
                 raise
         else:
             if stat.S_ISLNK(st.st_mode):
-                msg = _('path %r traverses symbolic link %r') % (path, prefix)
+                msg = (_('path %r traverses symbolic link %r')
+                       % (pycompat.bytestr(path), pycompat.bytestr(prefix)))
                 raise error.Abort(msg)
             elif (stat.S_ISDIR(st.st_mode) and
                   os.path.isdir(os.path.join(curpath, '.hg'))):
                 if not self.callback or not self.callback(curpath):
                     msg = _("path '%s' is inside nested repo %r")
-                    raise error.Abort(msg % (path, prefix))
+                    raise error.Abort(msg % (path, pycompat.bytestr(prefix)))
 
     def check(self, path):
         try: