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-09-10 08:26:37 +04:00
|
|
|
$ hg init hgrepo1
|
|
|
|
$ cd hgrepo1
|
|
|
|
$ echo A > afile
|
|
|
|
$ hg add afile
|
|
|
|
$ hg ci -m "origin"
|
|
|
|
|
|
|
|
$ echo B > afile
|
|
|
|
$ hg ci -m "A->B"
|
|
|
|
|
|
|
|
$ hg up -r0
|
|
|
|
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
|
|
$ echo C > afile
|
|
|
|
$ hg ci -m "A->C"
|
|
|
|
|
2018-01-09 16:53:20 +03:00
|
|
|
$ hg merge -r1
|
|
|
|
merging afile
|
2018-10-22 22:45:46 +03:00
|
|
|
warning: 1 conflicts while merging afile! (edit, then use 'hg resolve --mark')
|
2012-09-10 08:26:37 +04:00
|
|
|
0 files updated, 0 files merged, 0 files removed, 1 files unresolved
|
2018-01-09 16:53:20 +03:00
|
|
|
use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
|
|
|
|
[1]
|
2012-09-10 08:26:37 +04:00
|
|
|
resolve using first parent
|
|
|
|
$ echo C > afile
|
2014-08-23 21:05:28 +04:00
|
|
|
$ hg resolve -m afile | egrep -v 'no more unresolved files' || true
|
2012-09-10 08:26:37 +04:00
|
|
|
$ hg ci -m "merge to C"
|
|
|
|
|
2018-01-09 16:53:20 +03:00
|
|
|
$ hg log --graph --style compact
|
2019-12-18 00:45:17 +03:00
|
|
|
@ 3:2,1 6c53bc0f062f 1970-01-01 00:00 +0000 test
|
2012-09-10 08:26:37 +04:00
|
|
|
|\ merge to C
|
|
|
|
| |
|
|
|
|
| o 2:0 ea82b67264a1 1970-01-01 00:00 +0000 test
|
|
|
|
| | A->C
|
|
|
|
| |
|
|
|
|
o | 1 7205e83b5a3f 1970-01-01 00:00 +0000 test
|
|
|
|
|/ A->B
|
|
|
|
|
|
|
|
|
o 0 5d1a6b64f9d0 1970-01-01 00:00 +0000 test
|
|
|
|
origin
|
|
|
|
|
|
|
|
|
|
|
|
$ cd ..
|
|
|
|
|
2012-10-31 08:01:03 +04:00
|
|
|
$ git init --bare gitrepo
|
2012-09-14 04:49:42 +04:00
|
|
|
Initialized empty Git repository in $TESTTMP/gitrepo/
|
2012-09-10 08:26:37 +04:00
|
|
|
|
|
|
|
$ cd hgrepo1
|
|
|
|
$ hg bookmark -r tip master
|
2012-09-14 04:49:45 +04:00
|
|
|
$ hg push -r master ../gitrepo
|
|
|
|
pushing to ../gitrepo
|
2012-10-08 04:11:27 +04:00
|
|
|
searching for changes
|
2013-01-06 10:46:57 +04:00
|
|
|
adding objects
|
|
|
|
added 4 commits with 3 trees and 3 blobs
|
2012-09-10 08:26:37 +04:00
|
|
|
$ cd ..
|
|
|
|
|
2012-09-14 04:49:45 +04:00
|
|
|
$ hg clone gitrepo hgrepo2 | grep -v '^updating'
|
2012-09-10 08:26:37 +04:00
|
|
|
importing git objects into hg
|
|
|
|
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
2012-11-04 03:14:17 +04:00
|
|
|
expect the same revision ids as above
|
2018-01-09 16:53:20 +03:00
|
|
|
$ hg -R hgrepo2 log --graph --style compact
|
2019-12-18 00:45:17 +03:00
|
|
|
@ 3[default/master][master]:1,2 b70d5f2ec3c4 1970-01-01 00:00 +0000 test
|
2012-09-10 08:26:37 +04:00
|
|
|
|\ merge to C
|
|
|
|
| |
|
2018-12-06 23:00:57 +03:00
|
|
|
| o 2:0 47fc555571b8 1970-01-01 00:00 +0000 test
|
2012-09-10 08:26:37 +04:00
|
|
|
| | A->B
|
|
|
|
| |
|
2018-12-06 23:00:57 +03:00
|
|
|
o | 1 8ec5b459b86e 1970-01-01 00:00 +0000 test
|
2012-09-10 08:26:37 +04:00
|
|
|
|/ A->C
|
|
|
|
|
|
2018-12-06 23:00:57 +03:00
|
|
|
o 0 fd5eb788c3a1 1970-01-01 00:00 +0000 test
|
2012-09-10 08:26:37 +04:00
|
|
|
origin
|
|
|
|
|