2006-10-18 03:48:41 +04:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
hg init t
|
|
|
|
cd t
|
2006-10-25 01:49:36 +04:00
|
|
|
hg branches
|
2006-10-18 03:48:41 +04:00
|
|
|
|
|
|
|
echo foo > a
|
|
|
|
hg add a
|
2006-12-02 08:16:17 +03:00
|
|
|
hg ci -m "initial" -d "1000000 0"
|
2006-10-25 01:49:36 +04:00
|
|
|
hg branch foo
|
|
|
|
hg branch
|
2006-12-02 08:16:17 +03:00
|
|
|
hg ci -m "add branch name" -d "1000000 0"
|
2006-10-25 01:49:36 +04:00
|
|
|
hg branch bar
|
2006-12-02 08:16:17 +03:00
|
|
|
hg ci -m "change branch name" -d "1000000 0"
|
2007-03-13 00:50:19 +03:00
|
|
|
echo % branch shadowing
|
2006-10-25 01:49:36 +04:00
|
|
|
hg branch ""
|
2007-03-13 00:50:19 +03:00
|
|
|
hg branch -f ''
|
2006-12-02 08:16:17 +03:00
|
|
|
hg ci -m "clear branch name" -d "1000000 0"
|
2006-10-18 03:48:41 +04:00
|
|
|
|
|
|
|
hg co foo
|
2006-10-25 01:49:36 +04:00
|
|
|
hg branch
|
2006-10-18 03:48:41 +04:00
|
|
|
echo bleah > a
|
2006-12-02 08:16:17 +03:00
|
|
|
hg ci -m "modify a branch" -d "1000000 0"
|
2006-10-18 03:48:41 +04:00
|
|
|
|
|
|
|
hg merge
|
2006-10-25 01:49:36 +04:00
|
|
|
hg branch
|
2006-12-02 08:16:17 +03:00
|
|
|
hg ci -m "merge" -d "1000000 0"
|
2006-10-18 03:48:41 +04:00
|
|
|
hg log
|
|
|
|
|
2006-10-25 01:49:36 +04:00
|
|
|
hg branches
|
|
|
|
hg branches -q
|
|
|
|
|
2006-10-18 12:35:14 +04:00
|
|
|
echo % test for invalid branch cache
|
|
|
|
hg rollback
|
2006-12-02 08:38:55 +03:00
|
|
|
cp .hg/branches.cache .hg/bc-invalid
|
2006-12-02 08:16:17 +03:00
|
|
|
hg log -r foo
|
2006-12-02 08:38:55 +03:00
|
|
|
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
|
2007-03-09 21:57:26 +03:00
|
|
|
|
|
|
|
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
|
2007-03-11 04:36:29 +03:00
|
|
|
|
|
|
|
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
|