Mercurial > hg
changeset 9144:ad72e3b08bc0
test-tags: enhance the test to probe tag caching better (issue548).
- give detailed dumps of .hgtags and localtags content
- repeat some query operations to expose cache bugs
- ensure that rollback/strip undo tagging operations
author | Greg Ward <greg-hg@gerg.ca> |
---|---|
date | Thu, 16 Jul 2009 10:39:41 -0400 |
parents | a604c98dbf62 |
children | 6b03f93b8ff3 |
files | tests/test-tags tests/test-tags.out |
diffstat | 2 files changed, 66 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/tests/test-tags Thu Jul 16 10:39:41 2009 -0400 +++ b/tests/test-tags Thu Jul 16 10:39:41 2009 -0400 @@ -90,16 +90,38 @@ echo >> foo hg ci -m 'change foo 2' # rev 4 hg tags +hg tags # repeat in case of cache effects + +dumptags() { + rev=$1 + echo "rev $rev: .hgtags:" + hg cat -r$rev .hgtags +} + +echo "% detailed dump of tag info" +echo "heads:" +hg heads -q # expect 4, 3, 2 +dumptags 2 +dumptags 3 +dumptags 4 +echo ".hg/tags.cache:" +[ -f .hg/tags.cache ] && cat .hg/tags.cache || echo "no such file" echo "% test tag removal" hg tag --remove bar # rev 5 hg tip -vp hg tags +hg tags # again, try to expose cache bugs echo '% remove nonexistent tag' hg tag --remove foobar hg tip +echo "% rollback undoes tag operation" +hg rollback # destroy rev 5 (restore bar) +hg tags +hg tags + echo "% test tag rank" cd .. hg init t3 @@ -122,6 +144,16 @@ hg tag -r 3 bar hg tags +echo "% strip 1: expose an old head" +hg --config extensions.mq= strip 5 > /dev/null 2>&1 +hg tags # partly stale cache +hg tags # up-to-date cache +echo "% strip 2: destroy whole branch, no old head exposed" +hg --config extensions.mq= strip 4 > /dev/null 2>&1 +hg tags # partly stale +rm -f .hg/tags.cache +hg tags # cold cache + echo "% test tag rank with 3 heads" cd .. hg init t4
--- a/tests/test-tags.out Thu Jul 16 10:39:41 2009 -0400 +++ b/tests/test-tags.out Thu Jul 16 10:39:41 2009 -0400 @@ -57,6 +57,23 @@ created new head tip 4:0c192d7d5e6b bar 1:78391a272241 +tip 4:0c192d7d5e6b +bar 1:78391a272241 +% detailed dump of tag info +heads: +4:0c192d7d5e6b +3:6fa450212aeb +2:7a94127795a3 +rev 2: .hgtags: +bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar +rev 3: .hgtags: +bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar +bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar +78391a272241d70354aa14c874552cad6b51bb42 bar +rev 4: .hgtags: +bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar +.hg/tags.cache: +no such file % test tag removal changeset: 5:5f6e8655b1c7 tag: tip @@ -76,6 +93,7 @@ +0000000000000000000000000000000000000000 bar tip 5:5f6e8655b1c7 +tip 5:5f6e8655b1c7 % remove nonexistent tag abort: tag 'foobar' does not exist changeset: 5:5f6e8655b1c7 @@ -84,6 +102,12 @@ date: Thu Jan 01 00:00:00 1970 +0000 summary: Removed tag bar +% rollback undoes tag operation +rolling back last transaction +tip 4:0c192d7d5e6b +bar 1:78391a272241 +tip 4:0c192d7d5e6b +bar 1:78391a272241 % test tag rank tip 5:85f05169d91d bar 0:bbd179dfa0a7 @@ -95,6 +119,16 @@ abort: tag 'bar' already exists (use -f to force) tip 6:735c3ca72986 bar 0:bbd179dfa0a7 +% strip 1: expose an old head +tip 5:735c3ca72986 +bar 1:78391a272241 +tip 5:735c3ca72986 +bar 1:78391a272241 +% strip 2: destroy whole branch, no old head exposed +tip 4:735c3ca72986 +bar 0:bbd179dfa0a7 +tip 4:735c3ca72986 +bar 0:bbd179dfa0a7 % test tag rank with 3 heads adding foo tip 3:197c21bbbf2c