view tests/test-tag @ 5369:7530334bf301

revlog: generate trivial deltas against null revision To avoid extra memory usage and performance issues with large files, generate a trivial delta header for deltas against the null revision rather than calling the usual delta generator. We append the delta header to meta rather than prepending it to data to avoid a large allocate and copy.
author Matt Mackall <mpm@selenic.com>
date Wed, 03 Oct 2007 17:17:27 -0500
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