Mercurial > hg
comparison 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 |
comparison
equal
deleted
inserted
replaced
9150:09a1ee498756 | 9151:f528d1a93491 |
---|---|
1 #!/bin/sh | 1 #!/bin/sh |
2 | |
3 cacheexists() { | |
4 [ -f .hg/tags.cache ] && echo "tag cache exists" || echo "no tag cache" | |
5 } | |
2 | 6 |
3 echo "% setup" | 7 echo "% setup" |
4 mkdir t | 8 mkdir t |
5 cd t | 9 cd t |
6 hg init | 10 hg init |
7 hg id | 11 cacheexists |
12 hg id | |
13 cacheexists | |
8 echo a > a | 14 echo a > a |
9 hg add a | 15 hg add a |
10 hg commit -m "test" | 16 hg commit -m "test" |
11 hg co | 17 hg co |
12 hg identify | 18 hg identify |
19 cacheexists | |
13 | 20 |
14 echo "% create local tag with long name" | 21 echo "% create local tag with long name" |
15 T=`hg identify --debug --id` | 22 T=`hg identify --debug --id` |
16 hg tag -l "This is a local tag with a really long name!" | 23 hg tag -l "This is a local tag with a really long name!" |
17 hg tags | 24 hg tags |
21 echo "$T first" > .hgtags | 28 echo "$T first" > .hgtags |
22 cat .hgtags | 29 cat .hgtags |
23 hg add .hgtags | 30 hg add .hgtags |
24 hg commit -m "add tags" | 31 hg commit -m "add tags" |
25 hg tags | 32 hg tags |
33 hg identify | |
34 | |
35 # repeat with cold tag cache | |
36 rm -f .hg/tags.cache | |
26 hg identify | 37 hg identify |
27 | 38 |
28 echo "% create a branch" | 39 echo "% create a branch" |
29 echo bb > a | 40 echo bb > a |
30 hg status | 41 hg status |