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
Admin message
This instance will be upgraded to Heptapod 17.9.2 on 2025-04-24 between 17:00 and 18:00 UTC+2
Show more breadcrumbs
mercurial
hg-git
Commits
61927d60
Commit
61927d60
authored
12 years ago
by
David M. Carr
Browse files
Options
Downloads
Patches
Plain Diff
tests: unify test-incoming
parent
98eb1c31
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tests/test-incoming.out
+0
-81
0 additions, 81 deletions
tests/test-incoming.out
tests/test-incoming.t
+163
-84
163 additions, 84 deletions
tests/test-incoming.t
with
163 additions
and
165 deletions
tests/test-incoming.out
deleted
100644 → 0
+
0
−
81
View file @
98eb1c31
Initialized empty Git repository in gitrepo/.git/
importing git objects into hg
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
comparing with git://localhost/gitrepo
comparing with git://localhost/gitrepo
changeset: 1:9497a4ee62e1
user: test <test@example.org>
date: Mon Jan 01 00:00:11 2007 +0000
summary: add beta
Switched to a new branch 'b1'
comparing with git://localhost/gitrepo
changeset: 1:9497a4ee62e1
user: test <test@example.org>
date: Mon Jan 01 00:00:11 2007 +0000
summary: add beta
diff -r 3442585be8a6 -r 9497a4ee62e1 beta
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/beta Mon Jan 01 00:00:11 2007 +0000
@@ -0,0 +1,1 @@
+beta
changeset: 2:9865e289be73
tag: t1
parent: 0:3442585be8a6
user: test <test@example.org>
date: Mon Jan 01 00:00:12 2007 +0000
summary: add d/gamma
diff -r 3442585be8a6 -r 9865e289be73 d/gamma
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/d/gamma Mon Jan 01 00:00:12 2007 +0000
@@ -0,0 +1,1 @@
+gamma
changeset: 3:5202f48c20c9
user: test <test@example.org>
date: Mon Jan 01 00:00:13 2007 +0000
summary: add d/gamma line 2
diff -r 9865e289be73 -r 5202f48c20c9 d/gamma
--- a/d/gamma Mon Jan 01 00:00:12 2007 +0000
+++ b/d/gamma Mon Jan 01 00:00:13 2007 +0000
@@ -1,1 +1,2 @@
gamma
+gamma 2
% incoming -r
comparing with git://localhost/gitrepo
changeset: 1:9497a4ee62e1
user: test <test@example.org>
date: Mon Jan 01 00:00:11 2007 +0000
summary: add beta
comparing with git://localhost/gitrepo
changeset: 1:9865e289be73
tag: t1
user: test <test@example.org>
date: Mon Jan 01 00:00:12 2007 +0000
summary: add d/gamma
changeset: 2:5202f48c20c9
user: test <test@example.org>
date: Mon Jan 01 00:00:13 2007 +0000
summary: add d/gamma line 2
comparing with git://localhost/gitrepo
changeset: 1:9865e289be73
tag: t1
user: test <test@example.org>
date: Mon Jan 01 00:00:12 2007 +0000
summary: add d/gamma
% nothing incoming after pull
pulling from git://localhost/gitrepo
importing git objects into hg
(run 'hg heads' to see heads, 'hg merge' to merge)
comparing with git://localhost/gitrepo
done
This diff is collapsed.
Click to expand it.
tests/test-incoming
→
tests/test-incoming
.t
+
163
−
84
View file @
61927d60
#!/bin/sh
# Fails for some reason, need to investigate
# $ "$TESTDIR/hghave" git || exit 80
bail
if
the
user
does
not
have
dulwich
$
python
-
c
'
import dulwich, dulwich.repo
'
||
exit
80
...
...
@@ -2,4 +6,5 @@
# Fails for some reason, need to investigate
# "$TESTDIR/hghave" git || exit 80
This
test
only
works
on
hg
1.7
and
later
$
python
-
c
'
from mercurial import util ; assert \
> util.version() != "unknown" and util.version() > "1.7"
'
||
exit
80
...
...
@@ -5,4 +10,9 @@
# bail if the user does not have dulwich
python
-c
'import dulwich, dulwich.repo'
||
exit
80
bail
early
if
the
user
is
already
running
git
-
daemon
$
!
(
echo
hi
|
nc
localhost
9418
2
>
/dev/null
)
||
exit
80
$
echo
"
[extensions]
"
>>
$HGRCPATH
$
echo
"
hggit=$(echo $(dirname
$TESTDIR
))/hggit
"
>>
$HGRCPATH
$
echo
'
hgext.graphlog =
'
>>
$HGRCPATH
$
echo
'
hgext.bookmarks =
'
>>
$HGRCPATH
...
...
@@ -8,5 +18,8 @@
# This test only works on hg 1.7 and later
python
-c
'from mercurial import util ; assert \
util.version() != "unknown" and util.version() > "1.7"'
||
exit
80
$
GIT_AUTHOR_NAME
=
'
test
';
export
GIT_AUTHOR_NAME
$
GIT_AUTHOR_EMAIL
=
'
test@example.org
';
export
GIT_AUTHOR_EMAIL
$
GIT_AUTHOR_DATE
=
"
2007-01-01 00:00:00 +0000
";
export
GIT_AUTHOR_DATE
$
GIT_COMMITTER_NAME
=
"
$GIT_AUTHOR_NAME
";
export
GIT_COMMITTER_NAME
$
GIT_COMMITTER_EMAIL
=
"
$GIT_AUTHOR_EMAIL
";
export
GIT_COMMITTER_EMAIL
$
GIT_COMMITTER_DATE
=
"
$GIT_AUTHOR_DATE
";
export
GIT_COMMITTER_DATE
...
...
@@ -12,9 +25,16 @@
# bail early if the user is already running git-daemon
echo
hi | nc localhost 9418 2>/dev/null
&&
exit
80
echo
"[extensions]"
>>
$HGRCPATH
echo
"hggit=
$(
echo
$(
dirname
$(
dirname
$0
)))
/hggit"
>>
$HGRCPATH
echo
'hgext.graphlog ='
>>
$HGRCPATH
echo
'hgext.bookmarks ='
>>
$HGRCPATH
$
count
=
10
$
commit
()
>
{
>
GIT_AUTHOR_DATE
=
"
2007-01-01 00:00:
$count
+0000
"
>
GIT_COMMITTER_DATE
=
"
$GIT_AUTHOR_DATE
"
>
git
commit
"
$@
"
>
/dev/null
2
>
/dev/null
||
echo
"
git commit error
"
>
count
=
`
expr
$count
+ 1
`
>
}
$
hgcommit
()
>
{
>
HGDATE
=
"
2007-01-01 00:00:
$count
+0000
"
>
hg
commit
-
d
"
$HGDATE
"
"
$@
"
>
/dev/null
2
>
/dev/null
||
echo
"
hg commit error
"
>
count
=
`
expr
$count
+ 1
`
>
}
...
...
@@ -20,8 +40,20 @@
GIT_AUTHOR_NAME
=
'test'
;
export
GIT_AUTHOR_NAME
GIT_AUTHOR_EMAIL
=
'test@example.org'
;
export
GIT_AUTHOR_EMAIL
GIT_AUTHOR_DATE
=
"2007-01-01 00:00:00 +0000"
;
export
GIT_AUTHOR_DATE
GIT_COMMITTER_NAME
=
"
$GIT_AUTHOR_NAME
"
;
export
GIT_COMMITTER_NAME
GIT_COMMITTER_EMAIL
=
"
$GIT_AUTHOR_EMAIL
"
;
export
GIT_COMMITTER_EMAIL
GIT_COMMITTER_DATE
=
"
$GIT_AUTHOR_DATE
"
;
export
GIT_COMMITTER_DATE
$
mkdir
gitrepo
$
cd
gitrepo
$
git
init
|
python
-
c
"
import sys; print sys.stdin.read().replace('$(dirname $(pwd))/', '')
"
Initialized
empty
Git
repository
in
gitrepo
/.git/
$
echo
alpha
>
alpha
$
git
add
alpha
$
commit
-
m "add alpha"
dulwich
does
not
presently
support
local
git
repos
,
workaround
$
cd
..
$
git
daemon
--
base
-
path
=
"
$(pwd)
"
\
>
--
listen
=
localhost
\
>
--
export
-
all
\
>
--
pid
-
file
=
"
$DAEMON_PIDS
"
\
>
--
detach
--
reuseaddr
\
>
--
enable
=
receive
-
pack
...
...
@@ -27,16 +59,9 @@
count
=
10
commit
()
{
GIT_AUTHOR_DATE
=
"2007-01-01 00:00:
$count
+0000"
GIT_COMMITTER_DATE
=
"
$GIT_AUTHOR_DATE
"
git commit
"
$@
"
>
/dev/null 2>/dev/null
||
echo
"git commit error"
count
=
`
expr
$count
+ 1
`
}
hgcommit
()
{
HGDATE
=
"2007-01-01 00:00:
$count
+0000"
hg commit
-d
"
$HGDATE
"
"
$@
"
>
/dev/null 2>/dev/null
||
echo
"hg commit error"
count
=
`
expr
$count
+ 1
`
}
$
hg
clone
git:
//local
host
/
gitrepo
hgrepo
|
grep
-
v
'
^updating
'
importing
git
objects
into
hg
1
files
updated
,
0
files
merged
,
0
files
removed
,
0
files
unresolved
$
cd
hgrepo
$
hg
incoming
|
grep
-
v
'
no changes found
'
|
grep
-
v
'
bookmark:
'
comparing
with
git:
//local
host
/
gitrepo
...
...
@@ -42,5 +67,15 @@
mkdir
gitrepo
cd
gitrepo
git init | python
-c
"import sys; print sys.stdin.read().replace('
$(
dirname
$(
pwd
))
/', '')"
$
cd
../
gitrepo
$
echo
beta
>
beta
$
git
add
beta
$
commit
-
m 'add beta'
$
cd
../
hgrepo
$
hg
incoming
|
grep
-
v
'
no changes found
'
|
grep
-
v
'
bookmark:
'
comparing
with
git:
//local
host
/
gitrepo
changeset:
1
:
9497
a4ee62e1
user:
test
<
test@example
.
org
>
date:
Mon
Jan
01
00
:
00
:
11
2007
+
0000
summary:
add
beta
...
...
@@ -46,14 +81,10 @@
echo
alpha
>
alpha
git add alpha
commit
-m
"add alpha"
# dulwich does not presently support local git repos, workaround
cd
..
git daemon
--base-path
=
"
$(
pwd
)
"
\
--listen
=
localhost
\
--export-all
\
--pid-file
=
"
$DAEMON_PIDS
"
\
--detach
--reuseaddr
\
--enable
=
receive-pack
$
cd
../
gitrepo
$
git
checkout
-
b
b1
HEAD
^
Switched
to
a
new
branch
'
b1
'
$
mkdir
d
$
echo
gamma
>
d
/
gamma
$
git
add
d
/
gamma
$
commit
-
m'add d/gamma'
$
git
tag
t1
...
...
@@ -59,14 +90,5 @@
hg clone git://localhost/gitrepo hgrepo |
grep
-v
'^updating'
cd
hgrepo
hg incoming |
grep
-v
'no changes found'
|
grep
-v
'bookmark:'
cd
../gitrepo
echo
beta
>
beta
git add beta
commit
-m
'add beta'
cd
../hgrepo
hg incoming |
grep
-v
'no changes found'
|
grep
-v
'bookmark:'
$
echo
gamma
2
>>
d
/
gamma
$
git
add
d
/
gamma
$
commit
-
m'add d/gamma line 2'
...
...
@@ -72,13 +94,41 @@
cd
../gitrepo
git checkout
-b
b1 HEAD^
mkdir
d
echo
gamma
>
d/gamma
git add d/gamma
commit
-m
'add d/gamma'
git tag t1
echo
gamma 2
>>
d/gamma
git add d/gamma
commit
-m
'add d/gamma line 2'
$
cd
../
hgrepo
$
hg
incoming
-
p
|
grep
-
v
'
no changes found
'
|
grep
-
v
'
bookmark:
'
comparing
with
git:
//local
host
/
gitrepo
changeset:
1
:
9497
a4ee62e1
user:
test
<
test@example
.
org
>
date:
Mon
Jan
01
00
:
00
:
11
2007
+
0000
summary:
add
beta
diff
-
r
3442585
be8a6
-
r
9497
a4ee62e1
beta
---
/dev/null
Thu
Jan
01
00
:
00
:
00
1970
+
0000
+++
b
/
beta
Mon
Jan
01
00
:
00
:
11
2007
+
0000
@@
-
0
,
0
+
1
,
1
@@
+
beta
changeset:
2
:
9865e289
be73
tag:
t1
parent:
0
:
3442585
be8a6
user:
test
<
test@example
.
org
>
date:
Mon
Jan
01
00
:
00
:
12
2007
+
0000
summary:
add
d
/
gamma
diff
-
r
3442585
be8a6
-
r
9865e289
be73
d
/
gamma
---
/dev/null
Thu
Jan
01
00
:
00
:
00
1970
+
0000
+++
b
/d/gamma
Mon
Jan
01
00
:
00
:
12
2007
+
0000
@@
-
0
,
0
+
1
,
1
@@
+
gamma
changeset:
3
:
5202
f48c20c9
user:
test
<
test@example
.
org
>
date:
Mon
Jan
01
00
:
00
:
13
2007
+
0000
summary:
add
d
/
gamma
line
2
diff
-
r
9865e289
be73
-
r
5202
f48c20c9
d
/
gamma
---
a
/d/gamma
Mon
Jan
01
00
:
00
:
12
2007
+
0000
+++
b
/d/gamma
Mon
Jan
01
00
:
00
:
13
2007
+
0000
@@
-
1
,
1
+
1
,
2
@@
gamma
+
gamma
2
...
...
@@ -84,4 +134,32 @@
cd
../hgrepo
hg incoming
-p
|
grep
-v
'no changes found'
|
grep
-v
'bookmark:'
$
echo
%
incoming
-
r
%
incoming
-
r
$
hg
incoming
-
r
master
|
grep
-
v
'
no changes found
'
|
grep
-
v
'
bookmark:
'
comparing
with
git:
//local
host
/
gitrepo
changeset:
1
:
9497
a4ee62e1
user:
test
<
test@example
.
org
>
date:
Mon
Jan
01
00
:
00
:
11
2007
+
0000
summary:
add
beta
$
hg
incoming
-
r
b1
|
grep
-
v
'
no changes found
'
|
grep
-
v
'
bookmark:
'
comparing
with
git:
//local
host
/
gitrepo
changeset:
1
:
9865e289
be73
tag:
t1
user:
test
<
test@example
.
org
>
date:
Mon
Jan
01
00
:
00
:
12
2007
+
0000
summary:
add
d
/
gamma
changeset:
2
:
5202
f48c20c9
user:
test
<
test@example
.
org
>
date:
Mon
Jan
01
00
:
00
:
13
2007
+
0000
summary:
add
d
/
gamma
line
2
$
hg
incoming
-
r
t1
|
grep
-
v
'
no changes found
'
|
grep
-
v
'
bookmark:
'
comparing
with
git:
//local
host
/
gitrepo
changeset:
1
:
9865e289
be73
tag:
t1
user:
test
<
test@example
.
org
>
date:
Mon
Jan
01
00
:
00
:
12
2007
+
0000
summary:
add
d
/
gamma
...
...
@@ -87,6 +165,10 @@
echo
% incoming
-r
hg incoming
-r
master |
grep
-v
'no changes found'
|
grep
-v
'bookmark:'
hg incoming
-r
b1 |
grep
-v
'no changes found'
|
grep
-v
'bookmark:'
hg incoming
-r
t1 |
grep
-v
'no changes found'
|
grep
-v
'bookmark:'
$
echo
%
nothing
incoming
after
pull
%
nothing
incoming
after
pull
$
hg
pull
pulling
from
git:
//local
host
/
gitrepo
importing
git
objects
into
hg
(
run
'
hg heads
'
to
see
heads
,
'
hg merge
'
to
merge
)
$
hg
incoming
|
grep
-
v
'
no changes found
'
|
grep
-
v
'
bookmark:
'
comparing
with
git:
//local
host
/
gitrepo
...
...
@@ -92,6 +174,3 @@
echo
% nothing incoming after pull
hg pull
hg incoming |
grep
-v
'no changes found'
|
grep
-v
'bookmark:'
echo
'done'
$
echo
'
done
'
done
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