Skip to content
Snippets Groups Projects
Commit 0db597e1 authored by Dan Villiom Podlaski Christiansen's avatar Dan Villiom Podlaski Christiansen
Browse files

tests: add test for a simple git rebase

We do this in both regular mode and with a suffix; the results are
subtly different.
parent a4b2ba5b
No related branches found
No related tags found
1 merge request!137Bookmark improvements
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
$ git init -q --bare repo.git $ git init -q --bare repo.git
#if with-path
$ hg clone repo.git hgrepo $ hg clone repo.git hgrepo
updating to branch default updating to branch default
0 files updated, 0 files merged, 0 files removed, 0 files unresolved 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
...@@ -12,6 +11,7 @@ ...@@ -12,6 +11,7 @@
$ hg clone repo.git hgrepo $ hg clone repo.git hgrepo
updating to branch default updating to branch default
0 files updated, 0 files merged, 0 files removed, 0 files unresolved 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
#else $ cd hgrepo
$ hg init hgrepo #if without-path
$ rm .hg/hgrc
#endif #endif
...@@ -17,5 +17,4 @@ ...@@ -17,5 +17,4 @@
#endif #endif
$ cd hgrepo
$ hg branch -q branch1 $ hg branch -q branch1
$ hg bookmark branch1_bookmark $ hg bookmark branch1_bookmark
$ echo f1 > f1 $ echo f1 > f1
...@@ -212,4 +211,5 @@ ...@@ -212,4 +211,5 @@
date: Mon Jan 01 00:00:10 2007 +0000 date: Mon Jan 01 00:00:10 2007 +0000
summary: add f1 summary: add f1
$ cd .. $ cd ..
...@@ -215,1 +215,70 @@ ...@@ -215,1 +215,70 @@
$ cd .. $ cd ..
Now try pulling a diverged bookmark:
$ rm -r hgrepo
#if with-path
$ hg clone -U repo.git hgrepo
importing 5 git commits
new changesets 40a840c1f8ae:faf44fc3a4e8 (5 drafts)
#else
$ hg init hgrepo
$ hg -R hgrepo pull repo.git
pulling from repo.git
importing 5 git commits
new changesets 40a840c1f8ae:faf44fc3a4e8 (5 drafts)
(run 'hg heads' to see heads, 'hg merge' to merge)
#endif
$ cd gitrepo
$ git checkout -q branch1
$ fn_git_rebase branch3
$ git push -f
To $TESTTMP/repo.git
+ d8aef79...ce1d1c5 branch1 -> branch1 (forced update)
$ cd ../hgrepo
$ hg pull ../repo.git
pulling from ../repo.git
importing 1 git commits
new changesets 895d0307f8b7 (1 drafts)
(run 'hg update' to get a working copy)
$ hg log --graph
o changeset: 5:895d0307f8b7
| bookmark: branch1_bookmark
| tag: default/branch1 (with-path !)
| tag: tip
| user: test <test@example.org>
| date: Mon Jan 01 00:00:12 2007 +0000
| summary: append f1
|
o changeset: 4:faf44fc3a4e8
| bookmark: branch3_bookmark
| tag: default/branch3 (with-path !)
| user: test <test@example.org>
| date: Mon Jan 01 00:00:14 2007 +0000
| summary: append f3
|
o changeset: 3:ae8eb55f7090
| bookmark: branch2_bookmark
| tag: default/branch2 (with-path !)
| user: test <test@example.org>
| date: Mon Jan 01 00:00:13 2007 +0000
| summary: append f2
|
o changeset: 2:600de9b6d498
| branch: branch2
| parent: 0:40a840c1f8ae
| user: test
| date: Mon Jan 01 00:00:11 2007 +0000
| summary: add f2
|
| o changeset: 1:8211cade99e4
|/ user: test <test@example.org>
| date: Mon Jan 01 00:00:12 2007 +0000
| summary: append f1
|
o changeset: 0:40a840c1f8ae
branch: branch1
user: test
date: Mon Jan 01 00:00:10 2007 +0000
summary: add f1
...@@ -101,3 +101,59 @@ ...@@ -101,3 +101,59 @@
|/ add beta |/ add beta
o 0:ff7a2f2d8d7099694ae1e8b03838d40575bebb63 o 0:ff7a2f2d8d7099694ae1e8b03838d40575bebb63
add alpha add alpha
$ cd ..
Now try rebasing that branch, from the Git side of things
$ cd gitrepo
$ git checkout -q otherbranch
$ fn_git_rebase --onto branch otherbranch
$ git push -f
To $TESTTMP/repo.git
+ c4cfa5e...e5023f9 otherbranch -> otherbranch (forced update)
$ cd ..
$ cd hgrepo
$ hg pull
pulling from $TESTTMP/repo.git
no changes found
$ hg state
* otherbranch tip 4:f4bd265a9d39e5c4da2c0a752de5ea70335199c5
| add gamma
| @ branch default/branch 3:52def9937d74e43b83dfded6ce0e5adf731b9d22
| | add gamma
x | default/otherbranch 2:205a004356ef32b8da782afb89d9179d12ca31e9
| | add gamma
| o master default/master 1:7fe02317c63d9ee324d4b5df7c9296085162da1b
|/ add beta
o 0:ff7a2f2d8d7099694ae1e8b03838d40575bebb63
add alpha
$ cd ..
And finally, delete it:
$ cd gitrepo
$ git push origin :otherbranch
To $TESTTMP/repo.git
- [deleted] otherbranch
$ cd ..
And pull that:
$ cd hgrepo
$ hg pull
pulling from $TESTTMP/repo.git
no changes found
$ hg state
* otherbranch tip 4:f4bd265a9d39e5c4da2c0a752de5ea70335199c5
| add gamma
| @ branch default/branch 3:52def9937d74e43b83dfded6ce0e5adf731b9d22
| | add gamma
x | 2:205a004356ef32b8da782afb89d9179d12ca31e9
| | add gamma
| o master default/master 1:7fe02317c63d9ee324d4b5df7c9296085162da1b
|/ add beta
o 0:ff7a2f2d8d7099694ae1e8b03838d40575bebb63
add alpha
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment