--- a/mercurial/context.py Mon Oct 12 00:45:24 2015 -0700
+++ b/mercurial/context.py Fri Oct 09 01:19:37 2015 +0200
@@ -5,6 +5,8 @@
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
+import re
+
from node import nullid, nullrev, wdirid, short, hex, bin
from i18n import _
import mdiff, error, util, scmutil, subrepo, patch, encoding, phases
@@ -22,6 +24,8 @@
# dirty in the working copy.
_newnode = '!' * 21
+nonascii = re.compile(r'[^\x21-\x7f]').search
+
class basectx(object):
"""A basectx object represents the common logic for its children:
changectx: read-only context that is already present in the repo,
@@ -466,7 +470,7 @@
msg = _("working directory has unknown parent '%s'!")
raise error.Abort(msg % short(changeid))
try:
- if len(changeid) == 20:
+ if len(changeid) == 20 and nonascii(changeid):
changeid = hex(changeid)
except TypeError:
pass