[PATCH 7 of 8] py3: use bytestr() to coerce position carried by ParseError to string

Yuya Nishihara yuya at tcha.org
Thu Mar 1 09:17:14 EST 2018


# HG changeset patch
# User Yuya Nishihara <yuya at tcha.org>
# Date 1519911934 18000
#      Thu Mar 01 08:45:34 2018 -0500
# Node ID ebde1b7aba4b59b417369b550989dfd7c7e449c2
# Parent  5644cfd9717dd1417505a3ee0e0ae492f0da799f
py3: use bytestr() to coerce position carried by ParseError to string

The position value is either int or byte string.

diff --git a/mercurial/dispatch.py b/mercurial/dispatch.py
--- a/mercurial/dispatch.py
+++ b/mercurial/dispatch.py
@@ -132,7 +132,7 @@ def _formatparse(write, inst):
         similar = _getsimilar(inst.symbols, inst.function)
     if len(inst.args) > 1:
         write(_("hg: parse error at %s: %s\n") %
-                         (inst.args[1], inst.args[0]))
+              (pycompat.bytestr(inst.args[1]), inst.args[0]))
         if (inst.args[0][0] == ' '):
             write(_("unexpected leading whitespace\n"))
     else:


More information about the Mercurial-devel mailing list