changeset 36609:04e50037d957

revset: use {force,}bytestr to fix some %r formatting issues Differential Revision: https://phab.mercurial-scm.org/D2556
author Augie Fackler <augie@google.com>
date Fri, 02 Mar 2018 11:37:21 -0500
parents be27c4e310bd
children b755eab7e677
files mercurial/revset.py
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/revset.py	Fri Mar 02 01:17:42 2018 -0500
+++ b/mercurial/revset.py	Fri Mar 02 11:37:21 2018 -0500
@@ -1011,7 +1011,8 @@
         # i18n: "grep" is a keyword
         gr = re.compile(getstring(x, _("grep requires a string")))
     except re.error as e:
-        raise error.ParseError(_('invalid match pattern: %s') % e)
+        raise error.ParseError(
+            _('invalid match pattern: %s') % util.forcebytestr(e))
 
     def matches(x):
         c = repo[x]
@@ -1845,7 +1846,8 @@
         if reverse:
             k = k[1:]
         if k not in _sortkeyfuncs and k != 'topo':
-            raise error.ParseError(_("unknown sort key %r") % fk)
+            raise error.ParseError(
+                _("unknown sort key %r") % pycompat.bytestr(fk))
         keyflags.append((k, reverse))
 
     if len(keyflags) > 1 and any(k == 'topo' for k, reverse in keyflags):