##// END OF EJS Templates
context: convert to hex for error message only for 20-byte changeid...
Martin von Zweigbergk -
r38111:9231148e default
parent child Browse files
Show More
@@ -10,7 +10,6 b' from __future__ import absolute_import'
10 10 import errno
11 11 import filecmp
12 12 import os
13 import re
14 13 import stat
15 14
16 15 from .i18n import _
@@ -51,8 +50,6 b' from .utils import ('
51 50
52 51 propertycache = util.propertycache
53 52
54 nonascii = re.compile(br'[^\x21-\x7f]').search
55
56 53 class basectx(object):
57 54 """A basectx object represents the common logic for its children:
58 55 changectx: read-only context that is already present in the repo,
@@ -420,6 +417,7 b' class changectx(basectx):'
420 417 and changeid in repo.unfiltered().dirstate.parents()):
421 418 msg = _("working directory has unknown parent '%s'!")
422 419 raise error.Abort(msg % short(changeid))
420 changeid = hex(changeid) # for the error message
423 421
424 422 elif len(changeid) == 40:
425 423 try:
@@ -432,11 +430,6 b' class changectx(basectx):'
432 430 pass
433 431
434 432 # lookup failed
435 try:
436 if len(changeid) == 20 and nonascii(changeid):
437 changeid = hex(changeid)
438 except TypeError:
439 pass
440 433 except (error.FilteredIndexError, error.FilteredLookupError):
441 434 raise error.FilteredRepoLookupError(_("filtered revision '%s'")
442 435 % changeid)
General Comments 0
You need to be logged in to leave comments. Login now