Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
hg-git
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mercurial
hg-git
Commits
1bddbd70be21
Commit
1bddbd70be21
authored
4 years ago
by
Dan Villiom Podlaski Christiansen
Browse files
Options
Downloads
Plain Diff
merge topic raise-ambiguouslookuperror
parents
7f2b1bd5529e
c332ae8f3bbf
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
hggit/__init__.py
+2
-2
2 additions, 2 deletions
hggit/__init__.py
tests/test-ambiguousprefix.t
+31
-0
31 additions, 0 deletions
tests/test-ambiguousprefix.t
with
33 additions
and
2 deletions
hggit/__init__.py
+
2
−
2
View file @
1bddbd70
...
...
@@ -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
AmbiguousPrefix
LookupError
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
AmbiguousPrefix
LookupError
(
rev
,
git
.
map_file
,
_
(
b
'
ambiguous identifier
'
))
def
_gitnodekw
(
node
,
repo
):
...
...
This diff is collapsed.
Click to expand it.
tests/test-ambiguousprefix.t
0 → 100644
+
31
−
0
View file @
1bddbd70
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
@
7
e:
ambiguous
identifier
!
[
255
]
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment