Skip to content
Snippets Groups Projects
Commit ca4e165ad8f0 authored by muxator's avatar muxator
Browse files

hggit: raise AmbiguousPrefixLookupError like mercurial

Mercurial passed from raising LookupError to a more specific
AmbiguousPrefixLookupError in df0873ab5c14 (2018-04-13), which was released in
v4.8 (2018-10-28).

This will, in time, allow to simplify a special handling code in TortoiseHg (see
ba2dc2a07224 there).
parent 73452e25a1ec
No related branches found
No related tags found
1 merge request!71hggit: raise AmbiguousPrefixLookupError like mercurial
Pipeline #15222 passed with warnings
......@@ -33,7 +33,6 @@
from bisect import insort
from .git_handler import GitHandler
from mercurial.node import bin, hex
from mercurial.error import LookupError
from mercurial.i18n import _
from mercurial import (
bundlerepo,
......@@ -41,6 +40,7 @@
demandimport,
dirstate,
discovery,
error,
exchange,
extensions,
help,
......@@ -449,7 +449,11 @@
result = revset.baseset(r for r in subset if matches(r))
if 0 <= len(result) < 2:
return result
raise LookupError(rev, git.map_file, _(b'ambiguous identifier'))
# added in 4.8
exctype = getattr(error, 'AmbiguousPrefixLookupError', error.LookupError)
raise exctype(rev, git.map_file, _(b'ambiguous identifier'))
def _gitnodekw(node, repo):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment