##// END OF EJS Templates
tags: write a separate tags cache file for unfiltered repos...
Gregory Szorc -
r24762:10626638 default
parent child Browse files
Show More
@@ -36,10 +36,11 b' import time'
36 # repositories with very large manifests. Multiplied by dozens or even
36 # repositories with very large manifests. Multiplied by dozens or even
37 # hundreds of heads and there is a significant performance concern.
37 # hundreds of heads and there is a significant performance concern.
38 #
38 #
39 # The "tags" cache stores information about the history of tags.
39 # There also exist a separate cache file for each repository filter.
40 # These "tags-*" files store information about the history of tags.
40 #
41 #
41 # The cache file consists of a cache validation line followed by a history
42 # The tags cache files consists of a cache validation line followed by
42 # of tags.
43 # a history of tags.
43 #
44 #
44 # The cache validation line has the format:
45 # The cache validation line has the format:
45 #
46 #
@@ -239,7 +240,7 b' def _updatetags(filetags, tagtype, allta'
239
240
240 def _filename(repo):
241 def _filename(repo):
241 """name of a tagcache file for a given repo or repoview"""
242 """name of a tagcache file for a given repo or repoview"""
242 filename = 'cache/tags'
243 filename = 'cache/tags2'
243 if repo.filtername:
244 if repo.filtername:
244 filename = '%s-%s' % (filename, repo.filtername)
245 filename = '%s-%s' % (filename, repo.filtername)
245 return filename
246 return filename
@@ -47,7 +47,7 b' Trigger tags cache population by doing s'
47 test2 2:d75775ffbc6b
47 test2 2:d75775ffbc6b
48 test1 0:55482a6fb4b1
48 test1 0:55482a6fb4b1
49
49
50 $ cat .hg/cache/tags-visible
50 $ cat .hg/cache/tags2-visible
51 5 2942a772f72a444bef4bef13874d515f50fa27b6
51 5 2942a772f72a444bef4bef13874d515f50fa27b6
52 042eb6bfcc4909bad84a1cbf6eb1ddf0ab587d41 head2
52 042eb6bfcc4909bad84a1cbf6eb1ddf0ab587d41 head2
53 55482a6fb4b1881fa8f746fd52cf6f096bb21c89 test1
53 55482a6fb4b1881fa8f746fd52cf6f096bb21c89 test1
@@ -62,7 +62,7 b' Hiding a non-tip changeset should change'
62 head2 4:042eb6bfcc49
62 head2 4:042eb6bfcc49
63 test1 0:55482a6fb4b1
63 test1 0:55482a6fb4b1
64
64
65 $ cat .hg/cache/tags-visible
65 $ cat .hg/cache/tags2-visible
66 5 2942a772f72a444bef4bef13874d515f50fa27b6 f34fbc9a9769ba9eff5aff3d008a6b49f85c08b1
66 5 2942a772f72a444bef4bef13874d515f50fa27b6 f34fbc9a9769ba9eff5aff3d008a6b49f85c08b1
67 042eb6bfcc4909bad84a1cbf6eb1ddf0ab587d41 head2
67 042eb6bfcc4909bad84a1cbf6eb1ddf0ab587d41 head2
68 55482a6fb4b1881fa8f746fd52cf6f096bb21c89 test1
68 55482a6fb4b1881fa8f746fd52cf6f096bb21c89 test1
@@ -82,7 +82,7 b' Hiding another changeset should cause th'
82 tip 5:2942a772f72a
82 tip 5:2942a772f72a
83 head2 4:042eb6bfcc49
83 head2 4:042eb6bfcc49
84
84
85 $ cat .hg/cache/tags-visible
85 $ cat .hg/cache/tags2-visible
86 5 2942a772f72a444bef4bef13874d515f50fa27b6 2fce1eec33263d08a4d04293960fc73a555230e4
86 5 2942a772f72a444bef4bef13874d515f50fa27b6 2fce1eec33263d08a4d04293960fc73a555230e4
87 042eb6bfcc4909bad84a1cbf6eb1ddf0ab587d41 head2
87 042eb6bfcc4909bad84a1cbf6eb1ddf0ab587d41 head2
88
88
@@ -91,3 +91,23 b' Hiding another changeset should cause th'
91 1970/01/01 00:00:00 bob> 1/1 cache hits/lookups in * seconds (glob)
91 1970/01/01 00:00:00 bob> 1/1 cache hits/lookups in * seconds (glob)
92 1970/01/01 00:00:00 bob> writing tags cache file with 1 tags
92 1970/01/01 00:00:00 bob> writing tags cache file with 1 tags
93 1970/01/01 00:00:00 bob> tags exited 0 after * seconds (glob)
93 1970/01/01 00:00:00 bob> tags exited 0 after * seconds (glob)
94
95 Resolving tags on an unfiltered repo writes a separate tags cache
96
97 $ hg --hidden tags
98 tip 5:2942a772f72a
99 head2 4:042eb6bfcc49
100 test2 2:d75775ffbc6b
101 test1 0:55482a6fb4b1
102
103 $ cat .hg/cache/tags2
104 5 2942a772f72a444bef4bef13874d515f50fa27b6
105 042eb6bfcc4909bad84a1cbf6eb1ddf0ab587d41 head2
106 55482a6fb4b1881fa8f746fd52cf6f096bb21c89 test1
107 d75775ffbc6bca1794d300f5571272879bd280da test2
108
109 $ hg blackbox -l 4
110 1970/01/01 00:00:00 bob> --hidden tags
111 1970/01/01 00:00:00 bob> 2/2 cache hits/lookups in * seconds (glob)
112 1970/01/01 00:00:00 bob> writing tags cache file with 3 tags
113 1970/01/01 00:00:00 bob> --hidden tags exited 0 after * seconds (glob)
@@ -9,7 +9,7 b' setup'
9 Helper functions:
9 Helper functions:
10
10
11 $ cacheexists() {
11 $ cacheexists() {
12 > [ -f .hg/cache/tags-visible ] && echo "tag cache exists" || echo "no tag cache"
12 > [ -f .hg/cache/tags2-visible ] && echo "tag cache exists" || echo "no tag cache"
13 > }
13 > }
14
14
15 $ fnodescacheexists() {
15 $ fnodescacheexists() {
@@ -56,7 +56,7 b' No fnodes cache because .hgtags file doe'
56
56
57 Try corrupting the cache
57 Try corrupting the cache
58
58
59 $ printf 'a b' > .hg/cache/tags-visible
59 $ printf 'a b' > .hg/cache/tags2-visible
60 $ hg identify
60 $ hg identify
61 acb14030fe0a tip
61 acb14030fe0a tip
62 $ cacheexists
62 $ cacheexists
@@ -102,7 +102,7 b' The cache should have an empty entry for'
102
102
103 Repeat with cold tag cache:
103 Repeat with cold tag cache:
104
104
105 $ rm -f .hg/cache/tags-visible .hg/cache/hgtagsfnodes1
105 $ rm -f .hg/cache/tags2-visible .hg/cache/hgtagsfnodes1
106 $ hg identify
106 $ hg identify
107 b9154636be93 tip
107 b9154636be93 tip
108
108
@@ -117,7 +117,7 b' Repeat with cold tag cache:'
117 And again, but now unable to write tag cache:
117 And again, but now unable to write tag cache:
118
118
119 #if unix-permissions
119 #if unix-permissions
120 $ rm -f .hg/cache/tags-visible .hg/cache/hgtagsfnodes1
120 $ rm -f .hg/cache/tags2-visible .hg/cache/hgtagsfnodes1
121 $ chmod 555 .hg/cache
121 $ chmod 555 .hg/cache
122 $ hg identify
122 $ hg identify
123 b9154636be93 tip
123 b9154636be93 tip
@@ -126,7 +126,7 b' And again, but now unable to write tag c'
126
126
127 Tag cache debug info written to blackbox log
127 Tag cache debug info written to blackbox log
128
128
129 $ rm -f .hg/cache/tags-visible .hg/cache/hgtagsfnodes1
129 $ rm -f .hg/cache/tags2-visible .hg/cache/hgtagsfnodes1
130 $ hg identify
130 $ hg identify
131 b9154636be93 tip
131 b9154636be93 tip
132 $ hg blackbox -l 5
132 $ hg blackbox -l 5
@@ -138,7 +138,7 b' Tag cache debug info written to blackbox'
138
138
139 Failure to acquire lock results in no write
139 Failure to acquire lock results in no write
140
140
141 $ rm -f .hg/cache/tags-visible .hg/cache/hgtagsfnodes1
141 $ rm -f .hg/cache/tags2-visible .hg/cache/hgtagsfnodes1
142 $ echo 'foo:1' > .hg/wlock
142 $ echo 'foo:1' > .hg/wlock
143 $ hg identify
143 $ hg identify
144 b9154636be93 tip
144 b9154636be93 tip
@@ -154,7 +154,7 b' Failure to acquire lock results in no wr'
154
154
155 $ rm .hg/wlock
155 $ rm .hg/wlock
156
156
157 $ rm -f .hg/cache/tags-visible .hg/cache/hgtagsfnodes1
157 $ rm -f .hg/cache/tags2-visible .hg/cache/hgtagsfnodes1
158 $ hg identify
158 $ hg identify
159 b9154636be93 tip
159 b9154636be93 tip
160
160
@@ -311,7 +311,7 b' Detailed dump of tag info:'
311
311
312 Dump cache:
312 Dump cache:
313
313
314 $ cat .hg/cache/tags-visible
314 $ cat .hg/cache/tags2-visible
315 4 0c192d7d5e6b78a714de54a2e9627952a877e25a
315 4 0c192d7d5e6b78a714de54a2e9627952a877e25a
316 bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar
316 bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar
317 bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar
317 bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar
@@ -353,7 +353,7 b' Errors writing to .hgtags fnodes cache a'
353 $ hg commit -m throwaway2
353 $ hg commit -m throwaway2
354
354
355 $ chmod a-w .hg/cache/hgtagsfnodes1
355 $ chmod a-w .hg/cache/hgtagsfnodes1
356 $ rm -f .hg/cache/tags-visible
356 $ rm -f .hg/cache/tags2-visible
357
357
358 $ hg tags
358 $ hg tags
359 tip 6:b968051b5cf3
359 tip 6:b968051b5cf3
@@ -369,7 +369,7 b' Errors writing to .hgtags fnodes cache a'
369 $ chmod a+w .hg/cache/hgtagsfnodes1
369 $ chmod a+w .hg/cache/hgtagsfnodes1
370 #endif
370 #endif
371
371
372 $ rm -f .hg/cache/tags-visible
372 $ rm -f .hg/cache/tags2-visible
373 $ hg tags
373 $ hg tags
374 tip 6:b968051b5cf3
374 tip 6:b968051b5cf3
375 bar 1:78391a272241
375 bar 1:78391a272241
@@ -521,7 +521,7 b' Strip 2: destroy whole branch, no old he'
521 $ hg tags # partly stale
521 $ hg tags # partly stale
522 tip 4:735c3ca72986
522 tip 4:735c3ca72986
523 bar 0:bbd179dfa0a7
523 bar 0:bbd179dfa0a7
524 $ rm -f .hg/cache/tags-visible
524 $ rm -f .hg/cache/tags2-visible
525 $ hg tags # cold cache
525 $ hg tags # cold cache
526 tip 4:735c3ca72986
526 tip 4:735c3ca72986
527 bar 0:bbd179dfa0a7
527 bar 0:bbd179dfa0a7
General Comments 0
You need to be logged in to leave comments. Login now