diff tests/test-tags @ 9151:f528d1a93491

tags: implement persistent tag caching (issue548). - rename findglobaltags() to findglobaltags1() (so the "no cache" implementation is still there if we need it) - add findglobaltags2() and make findglobaltags() an alias for it (disabling tag caching is a one-line patch) - factor out tagcache class with methods readcache() and writecache(); the expensive part of tag finding (iterate over heads and find .hgtags filenode) is now in tagcache.readcache()
author Greg Ward <greg-hg@gerg.ca>
date Thu, 16 Jul 2009 10:39:42 -0400
parents ad72e3b08bc0
children 4017291c4c48
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:42 2009 -0400
@@ -1,15 +1,22 @@
 #!/bin/sh
 
+cacheexists() {
+    [ -f .hg/tags.cache ] && echo "tag cache exists" || echo "no tag cache"
+}
+
 echo "% setup"
 mkdir t
 cd t
 hg init
+cacheexists
 hg id
+cacheexists
 echo a > a
 hg add a
 hg commit -m "test"
 hg co
 hg identify
+cacheexists
 
 echo "% create local tag with long name"
 T=`hg identify --debug --id`
@@ -25,6 +32,10 @@
 hg tags
 hg identify
 
+# repeat with cold tag cache
+rm -f .hg/tags.cache
+hg identify
+
 echo "% create a branch"
 echo bb > a
 hg status