Skip to content
Snippets Groups Projects
Commit 1bddbd70be21 authored by Dan Villiom Podlaski Christiansen's avatar Dan Villiom Podlaski Christiansen
Browse files

merge topic raise-ambiguouslookuperror

No related branches found
No related tags found
No related merge requests found
......@@ -31,7 +31,7 @@
from bisect import insort
from .git_handler import GitHandler
from mercurial.node import bin, hex
from mercurial.error import LookupError
from mercurial.error import AmbiguousPrefixLookupError
from mercurial.i18n import _
from mercurial import (
bundlerepo,
......@@ -476,7 +476,7 @@
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'))
raise AmbiguousPrefixLookupError(rev, git.map_file, _(b'ambiguous identifier'))
def _gitnodekw(node, repo):
......
Load commonly used test logic
$ . "$TESTDIR/testutil"
$ git init gitrepo
Initialized empty Git repository in $TESTTMP/gitrepo/.git/
$ cd gitrepo
$ echo alpha > alpha
$ git add alpha
$ fn_git_commit -m 'add alpha'
$ echo beta > beta
$ git add beta
$ fn_git_commit -m 'add beta'
This commit is called gamma10 so that its hash will have the same initial digit
as commit alpha. This lets us test ambiguous abbreviated identifiers.
$ echo gamma10 > gamma10
$ git add gamma10
$ fn_git_commit -m 'add gamma10'
$ cd ..
$ hg clone gitrepo hgrepo | grep -v '^updating'
importing git objects into hg
3 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ cd hgrepo
$ hg log -r 'gitnode(7e)'
abort: git-mapfile@7e: ambiguous identifier!
[255]
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