From patchwork Fri Mar 2 17:11:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D2556: revset: use {force,}bytestr to fix some %r formatting issues From: phabricator X-Patchwork-Id: 28702 Message-Id: To: mercurial-devel@mercurial-scm.org Date: Fri, 2 Mar 2018 17:11:03 +0000 durin42 created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D2556 AFFECTED FILES mercurial/revset.py CHANGE DETAILS To: durin42, #hg-reviewers Cc: mercurial-devel 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):