test-newbranch
113 lines
| 1.7 KiB
| text/plain
|
TextLexer
/ tests / test-newbranch
Matt Mackall
|
r3420 | #!/bin/sh | ||
John Mulligan
|
r7654 | branchcache=.hg/branchheads.cache | ||
Alexis S. L. Carvalho
|
r6160 | |||
Matt Mackall
|
r3420 | hg init t | ||
cd t | ||||
Matt Mackall
|
r3502 | hg branches | ||
Matt Mackall
|
r3420 | |||
echo foo > a | ||||
hg add a | ||||
Martin Geisler
|
r12156 | hg ci -m "initial" | ||
Matt Mackall
|
r3502 | hg branch foo | ||
hg branch | ||||
Martin Geisler
|
r12156 | hg ci -m "add branch name" | ||
Matt Mackall
|
r3502 | hg branch bar | ||
Martin Geisler
|
r12156 | hg ci -m "change branch name" | ||
Brendan Cully
|
r4203 | echo % branch shadowing | ||
Matt Mackall
|
r4179 | hg branch default | ||
Matt Mackall
|
r4209 | hg branch -f default | ||
Martin Geisler
|
r12156 | hg ci -m "clear branch name" | ||
Matt Mackall
|
r3420 | |||
Brendan Cully
|
r8954 | echo % there should be only one default branch head | ||
hg heads . | ||||
Matt Mackall
|
r3420 | hg co foo | ||
Matt Mackall
|
r3502 | hg branch | ||
Matt Mackall
|
r3420 | echo bleah > a | ||
Martin Geisler
|
r12156 | hg ci -m "modify a branch" | ||
Matt Mackall
|
r3420 | |||
Dirkjan Ochtman
|
r6723 | hg merge default | ||
Matt Mackall
|
r3502 | hg branch | ||
Martin Geisler
|
r12156 | hg ci -m "merge" | ||
Matt Mackall
|
r3420 | hg log | ||
Matt Mackall
|
r3502 | hg branches | ||
hg branches -q | ||||
Thomas Arendsen Hein
|
r3451 | echo % test for invalid branch cache | ||
hg rollback | ||||
Alexis S. L. Carvalho
|
r6160 | cp $branchcache .hg/bc-invalid | ||
Alexis S. L. Carvalho
|
r3760 | hg log -r foo | ||
Alexis S. L. Carvalho
|
r6160 | cp .hg/bc-invalid $branchcache | ||
Alexis S. L. Carvalho
|
r3761 | hg --debug log -r foo | ||
Alexis S. L. Carvalho
|
r6160 | rm $branchcache | ||
echo corrupted > $branchcache | ||||
Alexis S. L. Carvalho
|
r3761 | hg log -qr foo | ||
Alexis S. L. Carvalho
|
r6160 | cat $branchcache | ||
Brendan Cully
|
r4175 | |||
Alexis S. L. Carvalho
|
r5988 | echo % push should update the branch cache | ||
hg init ../target | ||||
echo % pushing just rev 0 | ||||
hg push -qr 0 ../target | ||||
Alexis S. L. Carvalho
|
r6160 | cat ../target/$branchcache | ||
Alexis S. L. Carvalho
|
r5988 | echo % pushing everything | ||
hg push -qf ../target | ||||
Alexis S. L. Carvalho
|
r6160 | cat ../target/$branchcache | ||
Alexis S. L. Carvalho
|
r5988 | |||
Brendan Cully
|
r4175 | echo % update with no arguments: tipmost revision of the current branch | ||
hg up -q -C 0 | ||||
hg up -q | ||||
hg id | ||||
hg up -q 1 | ||||
hg up -q | ||||
hg id | ||||
Alexis S. L. Carvalho
|
r4231 | hg branch foobar | ||
hg up | ||||
Brendan Cully
|
r4410 | echo % fastforward merge | ||
hg branch ff | ||||
echo ff > ff | ||||
Martin Geisler
|
r12156 | hg ci -Am'fast forward' | ||
Brendan Cully
|
r4410 | hg up foo | ||
hg merge ff | ||||
hg branch | ||||
Martin Geisler
|
r12156 | hg commit -m'Merge ff into foo' | ||
Brendan Cully
|
r4410 | hg parents | ||
hg manifest | ||||
Dirkjan Ochtman
|
r6723 | echo % test merging, add 3 default heads and one test head | ||
cd .. | ||||
hg init merges | ||||
cd merges | ||||
echo a > a | ||||
hg ci -Ama | ||||
echo b > b | ||||
hg ci -Amb | ||||
hg up 0 | ||||
echo c > c | ||||
hg ci -Amc | ||||
hg up 0 | ||||
echo d > d | ||||
hg ci -Amd | ||||
hg up 0 | ||||
hg branch test | ||||
echo e >> e | ||||
hg ci -Ame | ||||
hg log | ||||
echo % implicit merge with test branch as parent | ||||
hg merge | ||||
hg up -C default | ||||
echo % implicit merge with default branch as parent | ||||
hg merge | ||||
echo % 3 branch heads, explicit merge required | ||||
hg merge 2 | ||||
hg ci -m merge | ||||
echo % 2 branch heads, implicit merge works | ||||
hg merge | ||||