Patchwork D2556: revset: use {force,}bytestr to fix some %r formatting issues

login
register
mail settings
Submitter phabricator
Date March 2, 2018, 7:51 p.m.
Message ID <384f0c0ba7aa12ddecd92637e6db08cd@localhost.localdomain>
Download mbox | patch
Permalink /patch/28710/
State Not Applicable
Headers show

Comments

phabricator - March 2, 2018, 7:51 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG04e50037d957: revset: use {force,}bytestr to fix some %r formatting issues (authored by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2556?vs=6366&id=6373

REVISION DETAIL
  https://phab.mercurial-scm.org/D2556

AFFECTED FILES
  mercurial/revset.py

CHANGE DETAILS




To: durin42, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/mercurial/revset.py b/mercurial/revset.py
--- a/mercurial/revset.py
+++ b/mercurial/revset.py
@@ -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):