mirror of
https://github.com/facebook/sapling.git
synced 2024-10-11 17:27:53 +03:00
66bd74e558
Test Plan: run-tests-.py Reviewers: mitrandir, #mercurial Reviewed By: mitrandir Subscribers: ps, terrelln Differential Revision: https://phabricator.intern.facebook.com/D6675896 Tasks: T24908724 Signature: 6675896:1515448382:df8d80cd7356ae8f5fb04586dc4a0a651bc498fd
166 lines
4.6 KiB
Perl
166 lines
4.6 KiB
Perl
Load commonly used test logic
|
|
$ . "$TESTDIR/hggit/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'
|
|
|
|
$ git checkout -b branch1
|
|
Switched to a new branch 'branch1'
|
|
$ echo beta > beta
|
|
$ git add beta
|
|
$ fn_git_commit -m 'add beta'
|
|
|
|
$ git checkout -b branch2 master
|
|
Switched to a new branch 'branch2'
|
|
$ echo gamma > gamma
|
|
$ git add gamma
|
|
$ fn_git_commit -m 'add gamma'
|
|
|
|
$ git checkout -b branch3 master
|
|
Switched to a new branch 'branch3'
|
|
$ echo epsilon > epsilon
|
|
$ git add epsilon
|
|
$ fn_git_commit -m 'add epsilon'
|
|
|
|
$ git checkout -b branch4 master
|
|
Switched to a new branch 'branch4'
|
|
$ echo zeta > zeta
|
|
$ git add zeta
|
|
$ fn_git_commit -m 'add zeta'
|
|
|
|
$ git checkout master
|
|
Switched to branch 'master'
|
|
$ echo delta > delta
|
|
$ git add delta
|
|
$ fn_git_commit -m 'add delta'
|
|
|
|
$ git merge branch1 branch2
|
|
Trying simple merge with branch1
|
|
Trying simple merge with branch2
|
|
Merge made by the 'octopus' strategy.
|
|
beta | 1 +
|
|
gamma | 1 +
|
|
2 files changed, 2 insertions(+)
|
|
create mode 100644 beta
|
|
create mode 100644 gamma
|
|
|
|
$ git merge branch3 branch4
|
|
Trying simple merge with branch3
|
|
Trying simple merge with branch4
|
|
Merge made by the 'octopus' strategy.
|
|
epsilon | 1 +
|
|
zeta | 1 +
|
|
2 files changed, 2 insertions(+)
|
|
create mode 100644 epsilon
|
|
create mode 100644 zeta
|
|
|
|
$ cd ..
|
|
$ git init --bare gitrepo2
|
|
Initialized empty Git repository in $TESTTMP/gitrepo2/
|
|
|
|
$ hg clone gitrepo hgrepo | grep -v '^updating'
|
|
importing git objects into hg
|
|
6 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
$ cd hgrepo
|
|
$ hg log --graph --style compact
|
|
@ 9[default/master,tip][master]:7,8 307506d6ae8a 2007-01-01 00:00 +0000 test
|
|
|\ Merge branches 'branch3' and 'branch4'
|
|
| |
|
|
| o 8:3,4 2b07220e422e 2007-01-01 00:00 +0000 test
|
|
| |\ Merge branches 'branch3' and 'branch4'
|
|
| | |
|
|
o | | 7:5,6 ccf2d65d982c 2007-01-01 00:00 +0000 test
|
|
|\ \ \ Merge branches 'branch1' and 'branch2'
|
|
| | | |
|
|
| o | | 6:1,2 690b40256117 2007-01-01 00:00 +0000 test
|
|
| |\ \ \ Merge branches 'branch1' and 'branch2'
|
|
| | | | |
|
|
o | | | | 5:0 e459c0629ca4 2007-01-01 00:00 +0000 test
|
|
| | | | | add delta
|
|
| | | | |
|
|
+-------o 4[default/branch4][branch4]:0 e857c9a04474 2007-01-01 00:00 +0000 test
|
|
| | | | add zeta
|
|
| | | |
|
|
+-----o 3[default/branch3][branch3]:0 0071dec0de0e 2007-01-01 00:00 +0000 test
|
|
| | | add epsilon
|
|
| | |
|
|
+---o 2[default/branch2][branch2]:0 205a004356ef 2007-01-01 00:00 +0000 test
|
|
| | add gamma
|
|
| |
|
|
| o 1[default/branch1][branch1] 7fe02317c63d 2007-01-01 00:00 +0000 test
|
|
|/ add beta
|
|
|
|
|
o 0 ff7a2f2d8d70 2007-01-01 00:00 +0000 test
|
|
add alpha
|
|
|
|
$ hg gverify -r 9
|
|
verifying rev 307506d6ae8a against git commit b32ff845df61df998206b630e4370a44f9b36845
|
|
$ hg gverify -r 8
|
|
abort: no git commit found for rev 2b07220e422e
|
|
(if this is an octopus merge, verify against the last rev)
|
|
[255]
|
|
|
|
$ hg gclear
|
|
clearing out the git cache data
|
|
$ hg push ../gitrepo2
|
|
pushing to ../gitrepo2
|
|
searching for changes
|
|
adding objects
|
|
added 8 commits with 8 trees and 6 blobs
|
|
$ cd ..
|
|
|
|
$ git --git-dir=gitrepo2 log --pretty=medium
|
|
commit b32ff845df61df998206b630e4370a44f9b36845
|
|
Merge: 9ac68f9 7e9cd9f e695849
|
|
Author: test <test@example.org>
|
|
Date: Mon Jan 1 00:00:15 2007 +0000
|
|
|
|
Merge branches 'branch3' and 'branch4'
|
|
|
|
commit 9ac68f982ae7426d9597ff16c74afb4e6053c582
|
|
Merge: d40f375 9497a4e e5023f9
|
|
Author: test <test@example.org>
|
|
Date: Mon Jan 1 00:00:15 2007 +0000
|
|
|
|
Merge branches 'branch1' and 'branch2'
|
|
|
|
commit d40f375a81b7d033e92cbad89487115fe2dd472f
|
|
Author: test <test@example.org>
|
|
Date: Mon Jan 1 00:00:15 2007 +0000
|
|
|
|
add delta
|
|
|
|
commit e695849087f6c320c1a447620492b29a82ca41b1
|
|
Author: test <test@example.org>
|
|
Date: Mon Jan 1 00:00:14 2007 +0000
|
|
|
|
add zeta
|
|
|
|
commit 7e9cd9f90b6d2c60579375eb796ce706d2d8bbe6
|
|
Author: test <test@example.org>
|
|
Date: Mon Jan 1 00:00:13 2007 +0000
|
|
|
|
add epsilon
|
|
|
|
commit e5023f9e5cb24fdcec7b6c127cec45d8888e35a9
|
|
Author: test <test@example.org>
|
|
Date: Mon Jan 1 00:00:12 2007 +0000
|
|
|
|
add gamma
|
|
|
|
commit 9497a4ee62e16ee641860d7677cdb2589ea15554
|
|
Author: test <test@example.org>
|
|
Date: Mon Jan 1 00:00:11 2007 +0000
|
|
|
|
add beta
|
|
|
|
commit 7eeab2ea75ec1ac0ff3d500b5b6f8a3447dd7c03
|
|
Author: test <test@example.org>
|
|
Date: Mon Jan 1 00:00:10 2007 +0000
|
|
|
|
add alpha
|