Show More
@@ -297,9 +297,12 b' class UnknownIdentifier(ParseError):' | |||
|
297 | 297 | def __init__(self, function, symbols): |
|
298 | 298 | from .i18n import _ |
|
299 | 299 | |
|
300 | ParseError.__init__(self, _(b"unknown identifier: %s") % function) | |
|
301 | self.function = function | |
|
302 | self.symbols = symbols | |
|
300 | similar = getsimilar(symbols, function) | |
|
301 | hint = similarity_hint(similar) | |
|
302 | ||
|
303 | ParseError.__init__( | |
|
304 | self, _(b"unknown identifier: %s") % function, hint=hint | |
|
305 | ) | |
|
303 | 306 | |
|
304 | 307 | |
|
305 | 308 | class RepoError(Hint, Exception): |
@@ -150,13 +150,7 b' def formatparse(write, inst):' | |||
|
150 | 150 | ) |
|
151 | 151 | else: |
|
152 | 152 | write(_(b"hg: parse error: %s\n") % inst.message) |
|
153 | if isinstance(inst, error.UnknownIdentifier): | |
|
154 | # make sure to check fileset first, as revset can invoke fileset | |
|
155 | similar = error.getsimilar(inst.symbols, inst.function) | |
|
156 | hint = error.similarity_hint(similar) | |
|
157 | if hint: | |
|
158 | write(b"(%s)\n" % hint) | |
|
159 | elif inst.hint: | |
|
153 | if inst.hint: | |
|
160 | 154 | write(_(b"(%s)\n") % inst.hint) |
|
161 | 155 | |
|
162 | 156 |
General Comments 0
You need to be logged in to leave comments.
Login now