sapling/tests/test-hggit-outgoing.t

140 lines
3.5 KiB
Perl
Raw Normal View History

Load commonly used test logic
$ . "$TESTDIR/hggit/testutil"
$ git init gitrepo
Initialized empty Git repository in $TESTTMP/gitrepo/.git/
$ cd gitrepo
2012-09-14 02:48:46 +04:00
$ echo alpha > alpha
$ git add alpha
$ fn_git_commit -m "add alpha"
$ git branch alpha
$ git show-ref
7eeab2ea75ec1ac0ff3d500b5b6f8a3447dd7c03 refs/heads/alpha
7eeab2ea75ec1ac0ff3d500b5b6f8a3447dd7c03 refs/heads/master
2012-09-14 02:48:46 +04:00
$ cd ..
$ hg clone gitrepo hgrepo | grep -v '^updating'
2012-09-14 02:48:46 +04:00
importing git objects into hg
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ cd hgrepo
$ hg update -q master
2012-09-14 02:48:46 +04:00
$ echo beta > beta
$ hg add beta
$ fn_hg_commit -m 'add beta'
2012-09-14 02:48:46 +04:00
$ echo gamma > gamma
$ hg add gamma
$ fn_hg_commit -m 'add gamma'
2012-09-14 02:48:46 +04:00
$ hg book -r 1 beta
$ hg outgoing | grep -v 'searching for changes'
comparing with */gitrepo (glob)
changeset: 1:47580592d3d6
bookmark: beta
2012-09-14 02:48:46 +04:00
user: test
date: Mon Jan 01 00:00:11 2007 +0000
summary: add beta
changeset: 2:953796e1cfd8
bookmark: master
2012-09-14 02:48:46 +04:00
tag: tip
user: test
date: Mon Jan 01 00:00:12 2007 +0000
summary: add gamma
$ hg outgoing -r beta | grep -v 'searching for changes'
comparing with */gitrepo (glob)
changeset: 1:47580592d3d6
bookmark: beta
2012-09-14 02:48:46 +04:00
user: test
date: Mon Jan 01 00:00:11 2007 +0000
summary: add beta
$ hg outgoing -r master | grep -v 'searching for changes'
comparing with */gitrepo (glob)
changeset: 1:47580592d3d6
bookmark: beta
2012-09-14 02:48:46 +04:00
user: test
date: Mon Jan 01 00:00:11 2007 +0000
summary: add beta
changeset: 2:953796e1cfd8
bookmark: master
2012-09-14 02:48:46 +04:00
tag: tip
user: test
date: Mon Jan 01 00:00:12 2007 +0000
summary: add gamma
$ cd ..
some more work on master from git
2012-09-14 02:48:46 +04:00
$ cd gitrepo
Check state of refs after outgoing
$ git show-ref
7eeab2ea75ec1ac0ff3d500b5b6f8a3447dd7c03 refs/heads/alpha
7eeab2ea75ec1ac0ff3d500b5b6f8a3447dd7c03 refs/heads/master
$ git checkout master
Already on 'master'
2012-09-14 02:48:46 +04:00
$ echo delta > delta
$ git add delta
$ fn_git_commit -m "add delta"
2012-09-14 02:48:46 +04:00
$ cd ..
$ cd hgrepo
this will fail # maybe we should try to make it work
2012-09-14 02:48:46 +04:00
$ hg outgoing
comparing with */gitrepo (glob)
abort: branch 'refs/heads/master' changed on the server, please pull and merge before pushing
2012-09-14 02:48:46 +04:00
[255]
let's pull and try again
$ hg pull 2>&1 | grep -v 'divergent bookmark'
pulling from */gitrepo (glob)
2012-09-14 02:48:46 +04:00
importing git objects into hg
(run 'hg heads' to see heads, 'hg merge' to merge)
$ hg outgoing | grep -v 'searching for changes'
comparing with */gitrepo (glob)
changeset: 1:47580592d3d6
bookmark: beta
2012-09-14 02:48:46 +04:00
user: test
date: Mon Jan 01 00:00:11 2007 +0000
summary: add beta
changeset: 2:953796e1cfd8
bookmark: master
2012-09-14 02:48:46 +04:00
user: test
date: Mon Jan 01 00:00:12 2007 +0000
summary: add gamma
$ hg outgoing -r beta | grep -v 'searching for changes'
comparing with */gitrepo (glob)
changeset: 1:47580592d3d6
bookmark: beta
2012-09-14 02:48:46 +04:00
user: test
date: Mon Jan 01 00:00:11 2007 +0000
summary: add beta
$ hg outgoing -r master | grep -v 'searching for changes'
comparing with */gitrepo (glob)
changeset: 1:47580592d3d6
bookmark: beta
2012-09-14 02:48:46 +04:00
user: test
date: Mon Jan 01 00:00:11 2007 +0000
summary: add beta
changeset: 2:953796e1cfd8
bookmark: master
2012-09-14 02:48:46 +04:00
user: test
date: Mon Jan 01 00:00:12 2007 +0000
summary: add gamma
$ cd ..