test-newbranch
75 lines
| 1.6 KiB
| text/plain
|
TextLexer
/ tests / test-newbranch
Matt Mackall
|
r3420 | #!/bin/sh | ||
hg init t | ||||
cd t | ||||
Matt Mackall
|
r3502 | hg branches | ||
Matt Mackall
|
r3420 | |||
echo foo > a | ||||
hg add a | ||||
Alexis S. L. Carvalho
|
r3760 | hg ci -m "initial" -d "1000000 0" | ||
Matt Mackall
|
r3502 | hg branch foo | ||
hg branch | ||||
Alexis S. L. Carvalho
|
r3760 | hg ci -m "add branch name" -d "1000000 0" | ||
Matt Mackall
|
r3502 | hg branch bar | ||
Alexis S. L. Carvalho
|
r3760 | hg ci -m "change branch name" -d "1000000 0" | ||
Brendan Cully
|
r4203 | echo % branch shadowing | ||
Matt Mackall
|
r3502 | hg branch "" | ||
Brendan Cully
|
r4203 | hg branch -f '' | ||
Alexis S. L. Carvalho
|
r3760 | hg ci -m "clear branch name" -d "1000000 0" | ||
Matt Mackall
|
r3420 | |||
hg co foo | ||||
Matt Mackall
|
r3502 | hg branch | ||
Matt Mackall
|
r3420 | echo bleah > a | ||
Alexis S. L. Carvalho
|
r3760 | hg ci -m "modify a branch" -d "1000000 0" | ||
Matt Mackall
|
r3420 | |||
hg merge | ||||
Matt Mackall
|
r3502 | hg branch | ||
Alexis S. L. Carvalho
|
r3760 | hg ci -m "merge" -d "1000000 0" | ||
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
|
r3761 | cp .hg/branches.cache .hg/bc-invalid | ||
Alexis S. L. Carvalho
|
r3760 | hg log -r foo | ||
Alexis S. L. Carvalho
|
r3761 | cp .hg/bc-invalid .hg/branches.cache | ||
hg --debug log -r foo | ||||
rm .hg/branches.cache | ||||
echo corrupted > .hg/branches.cache | ||||
hg log -qr foo | ||||
cat .hg/branches.cache | ||||
Thomas Arendsen Hein
|
r4169 | |||
echo % test for different branch cache features | ||||
echo '4909a3732169c0c20011c4f4b8fdff4e3d89b23f 4' > .hg/branches.cache | ||||
hg branches --debug | ||||
echo ' features: unnamed dummy foo bar' > .hg/branches.cache | ||||
hg branches --debug | ||||
echo ' features: dummy' > .hg/branches.cache | ||||
hg branches --debug | ||||
echo % test old hg reading branch cache with feature list | ||||
python << EOF | ||||
import binascii | ||||
f = file('.hg/branches.cache') | ||||
lines = f.read().split('\n') | ||||
f.close() | ||||
firstline = lines[0] | ||||
last, lrev = lines.pop(0).rstrip().split(" ", 1) | ||||
try: | ||||
last, lrev = binascii.unhexlify(last), int(lrev) | ||||
except ValueError, inst: | ||||
if str(inst) == "invalid literal for int():%s" % firstline: | ||||
print "ValueError raised correctly, good." | ||||
else: | ||||
print "ValueError: %s" % inst | ||||
EOF | ||||
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 | ||||