Mercurial > public > mercurial-scm > hg-stable
diff mercurial/pathutil.py @ 36678:d3b893ec5f08
py3: fix formatting of path-auditing errors
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sat, 03 Mar 2018 12:23:03 -0500 |
parents | 052351e3e1cd |
children | 21be76e07148 |
line wrap: on
line diff
--- 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: