view tests/test-tag @ 5331:8ee5b8129e7b

hgweb: don't raise an exception when displying empty repos The nullid node claims it's in the default branch, but the branch dict is empty. This fixes the main symptom from issue696, but we may want to set branchtags()['default'] = nullid somewhere for empty repos.
author Alexis S. L. Carvalho <alexis@cecm.usp.br>
date Mon, 24 Sep 2007 19:00:11 -0300
parents 5fb8f5992a3d
children
line wrap: on
line source

#!/bin/sh

hg init
echo a > a
hg add a
hg commit -m "test" -d "1000000 0"
hg history
hg tag -d "1000000 0" "bleah"
hg history

echo foo >> .hgtags
hg tag -d "1000000 0" "bleah2" || echo "failed"
hg tag -d "1000000 0" -r 0 "bleah2" 1 || echo "failed"

hg revert .hgtags
hg tag -d "1000000 0" -r 0 "bleah0"
hg tag -l -d "1000000 0" "bleah1" 1

cat .hgtags
cat .hg/localtags

hg update 0
hg tag -d "1000000 0" "foobar"
cat .hgtags
cat .hg/localtags

hg tag -l 'xx
newline'
hg tag -l 'xx:xx'

echo % issue 601
python << EOF
f = file('.hg/localtags'); last = f.readlines()[-1][:-1]; f.close()
f = file('.hg/localtags', 'w'); f.write(last); f.close()
EOF
cat .hg/localtags
hg tag -l localnewline
cat .hg/localtags

python << EOF
f = file('.hgtags'); last = f.readlines()[-1][:-1]; f.close()
f = file('.hgtags', 'w'); f.write(last); f.close()
EOF
hg ci -d '1000000 0' -m'broken manual edit of .hgtags'
cat .hgtags
hg tag -d '1000000 0' newline
cat .hgtags