2012-10-31 04:03:26 +04:00
|
|
|
Load commonly used test logic
|
2018-01-09 17:08:01 +03:00
|
|
|
$ . "$TESTDIR/hggit/testutil"
|
2012-10-31 04:03:26 +04:00
|
|
|
|
2012-10-31 08:01:03 +04:00
|
|
|
$ git init gitrepo
|
2012-09-14 04:49:42 +04:00
|
|
|
Initialized empty Git repository in $TESTTMP/gitrepo/.git/
|
2012-10-31 08:01:03 +04:00
|
|
|
$ cd gitrepo
|
2012-09-10 08:27:32 +04:00
|
|
|
$ echo alpha > alpha
|
|
|
|
$ git add alpha
|
2012-10-31 06:59:20 +04:00
|
|
|
$ fn_git_commit -m "add alpha"
|
2012-09-10 08:27:32 +04:00
|
|
|
|
|
|
|
$ cd ..
|
2014-02-25 12:23:12 +04:00
|
|
|
$ hg init hgrepo-empty
|
2015-03-12 20:29:58 +03:00
|
|
|
$ hg -R hgrepo-empty incoming gitrepo | grep -v 'no changes found'
|
2014-02-25 12:23:12 +04:00
|
|
|
comparing with gitrepo
|
|
|
|
changeset: 0:7eeab2ea75ec
|
2015-03-12 20:29:58 +03:00
|
|
|
bookmark: master
|
2014-02-25 12:23:12 +04:00
|
|
|
user: test <test@example.org>
|
|
|
|
date: Mon Jan 01 00:00:10 2007 +0000
|
|
|
|
summary: add alpha
|
|
|
|
|
|
|
|
|
2012-09-14 04:49:45 +04:00
|
|
|
$ hg clone gitrepo hgrepo | grep -v '^updating'
|
2012-09-10 08:27:32 +04:00
|
|
|
importing git objects into hg
|
|
|
|
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
|
|
|
2015-03-12 20:29:58 +03:00
|
|
|
$ hg -R hgrepo incoming | grep -v 'no changes found'
|
2012-09-14 04:49:45 +04:00
|
|
|
comparing with $TESTTMP/gitrepo
|
2012-09-10 08:27:32 +04:00
|
|
|
|
2012-11-04 03:12:08 +04:00
|
|
|
$ cd gitrepo
|
2012-09-10 08:27:32 +04:00
|
|
|
$ echo beta > beta
|
|
|
|
$ git add beta
|
2012-10-31 06:59:20 +04:00
|
|
|
$ fn_git_commit -m 'add beta'
|
2012-11-04 03:12:08 +04:00
|
|
|
$ cd ..
|
2012-09-10 08:27:32 +04:00
|
|
|
|
2015-03-12 20:29:58 +03:00
|
|
|
$ hg -R hgrepo incoming | grep -v 'no changes found'
|
2012-09-14 04:49:45 +04:00
|
|
|
comparing with $TESTTMP/gitrepo
|
2012-09-10 08:27:32 +04:00
|
|
|
changeset: 1:9497a4ee62e1
|
2015-03-12 20:29:58 +03:00
|
|
|
bookmark: master
|
2012-09-10 08:27:32 +04:00
|
|
|
user: test <test@example.org>
|
|
|
|
date: Mon Jan 01 00:00:11 2007 +0000
|
|
|
|
summary: add beta
|
|
|
|
|
|
|
|
|
2012-11-04 03:12:08 +04:00
|
|
|
$ cd gitrepo
|
2018-01-09 16:53:20 +03:00
|
|
|
$ git checkout -b b1 'HEAD^'
|
2012-09-10 08:27:32 +04:00
|
|
|
Switched to a new branch 'b1'
|
|
|
|
$ mkdir d
|
|
|
|
$ echo gamma > d/gamma
|
|
|
|
$ git add d/gamma
|
2012-10-31 06:59:20 +04:00
|
|
|
$ fn_git_commit -m'add d/gamma'
|
2012-09-10 08:27:32 +04:00
|
|
|
$ git tag t1
|
|
|
|
|
|
|
|
$ echo gamma 2 >> d/gamma
|
|
|
|
$ git add d/gamma
|
2012-10-31 06:59:20 +04:00
|
|
|
$ fn_git_commit -m'add d/gamma line 2'
|
2012-09-10 08:27:32 +04:00
|
|
|
$ cd ../hgrepo
|
2015-03-12 20:29:58 +03:00
|
|
|
$ hg incoming -p | grep -v 'no changes found'
|
2012-09-14 04:49:45 +04:00
|
|
|
comparing with $TESTTMP/gitrepo
|
2012-09-10 08:27:32 +04:00
|
|
|
changeset: 1:9497a4ee62e1
|
2015-03-12 20:29:58 +03:00
|
|
|
bookmark: master
|
2012-09-10 08:27:32 +04:00
|
|
|
user: test <test@example.org>
|
|
|
|
date: Mon Jan 01 00:00:11 2007 +0000
|
|
|
|
summary: add beta
|
|
|
|
|
2014-12-03 01:17:09 +03:00
|
|
|
diff -r ff7a2f2d8d70 -r 9497a4ee62e1 beta
|
2012-09-10 08:27:32 +04:00
|
|
|
--- /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
|
2014-12-03 01:17:09 +03:00
|
|
|
parent: 0:ff7a2f2d8d70
|
2012-09-10 08:27:32 +04:00
|
|
|
user: test <test@example.org>
|
|
|
|
date: Mon Jan 01 00:00:12 2007 +0000
|
|
|
|
summary: add d/gamma
|
|
|
|
|
2014-12-03 01:17:09 +03:00
|
|
|
diff -r ff7a2f2d8d70 -r 9865e289be73 d/gamma
|
2012-09-10 08:27:32 +04:00
|
|
|
--- /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
|
2015-03-12 20:29:58 +03:00
|
|
|
bookmark: b1
|
2012-09-10 08:27:32 +04:00
|
|
|
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
|
|
|
|
|
|
|
|
|
2012-11-04 03:14:17 +04:00
|
|
|
incoming -r
|
2015-03-12 20:29:58 +03:00
|
|
|
$ hg incoming -r master | grep -v 'no changes found'
|
2012-09-14 04:49:45 +04:00
|
|
|
comparing with $TESTTMP/gitrepo
|
2012-09-10 08:27:32 +04:00
|
|
|
changeset: 1:9497a4ee62e1
|
2015-03-12 20:29:58 +03:00
|
|
|
bookmark: master
|
2012-09-10 08:27:32 +04:00
|
|
|
user: test <test@example.org>
|
|
|
|
date: Mon Jan 01 00:00:11 2007 +0000
|
|
|
|
summary: add beta
|
|
|
|
|
2015-03-12 20:29:58 +03:00
|
|
|
$ hg incoming -r b1 | grep -v 'no changes found'
|
2012-09-14 04:49:45 +04:00
|
|
|
comparing with $TESTTMP/gitrepo
|
2012-09-10 08:27:32 +04:00
|
|
|
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
|
2015-03-12 20:29:58 +03:00
|
|
|
bookmark: b1
|
2012-09-10 08:27:32 +04:00
|
|
|
user: test <test@example.org>
|
|
|
|
date: Mon Jan 01 00:00:13 2007 +0000
|
|
|
|
summary: add d/gamma line 2
|
|
|
|
|
2015-03-12 20:29:58 +03:00
|
|
|
$ hg incoming -r t1 | grep -v 'no changes found'
|
2012-09-14 04:49:45 +04:00
|
|
|
comparing with $TESTTMP/gitrepo
|
2012-09-10 08:27:32 +04:00
|
|
|
changeset: 1:9865e289be73
|
|
|
|
tag: t1
|
|
|
|
user: test <test@example.org>
|
|
|
|
date: Mon Jan 01 00:00:12 2007 +0000
|
|
|
|
summary: add d/gamma
|
|
|
|
|
|
|
|
|
2012-11-04 03:14:17 +04:00
|
|
|
nothing incoming after pull
|
2012-10-26 04:49:08 +04:00
|
|
|
"adding remote bookmark" message was added in Mercurial 2.3
|
|
|
|
$ hg pull | grep -v "adding remote bookmark"
|
2012-09-14 04:49:45 +04:00
|
|
|
pulling from $TESTTMP/gitrepo
|
2012-09-10 08:27:32 +04:00
|
|
|
importing git objects into hg
|
|
|
|
(run 'hg heads' to see heads, 'hg merge' to merge)
|
2015-03-12 20:29:58 +03:00
|
|
|
$ hg incoming | grep -v 'no changes found'
|
2012-09-14 04:49:45 +04:00
|
|
|
comparing with $TESTTMP/gitrepo
|