##// END OF EJS Templates
branchcache: stop writing more branchcache file on disk than needed...
marmoute -
r52385:2e8a88e5 default
parent child Browse files
Show More
@@ -85,7 +85,8 b' class BranchMapCache:'
85 85 bcache._filtername,
86 86 repo.filtername,
87 87 )
88 bcache.write(repo)
88 if bcache._dirty:
89 bcache.write(repo)
89 90
90 91 def updatecache(self, repo):
91 92 """Update the cache for the given filtered view on a repository"""
@@ -810,7 +810,6 b' fred is not blocked from moving bookmark'
810 810 acl: bookmark access granted: "ef1ea85a6374b77d6da9dcda9541f498f2d17df7" on bookmark "moving-bookmark"
811 811 bundle2-input-bundle: 7 parts total
812 812 updating the branch cache
813 invalid branch cache (served.hidden): tip differs
814 813 added 1 changesets with 1 changes to 1 files
815 814 bundle2-output-bundle: "HG20", 1 parts total
816 815 bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) empty payload
@@ -1797,7 +1796,6 b' No branch acls specified'
1797 1796 bundle2-input-part: total payload size * (glob)
1798 1797 bundle2-input-bundle: 5 parts total
1799 1798 updating the branch cache
1800 invalid branch cache (served.hidden): tip differs
1801 1799 added 4 changesets with 4 changes to 4 files (+1 heads)
1802 1800 bundle2-output-bundle: "HG20", 1 parts total
1803 1801 bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) empty payload
@@ -2104,7 +2102,6 b' Branch acl allow other'
2104 2102 bundle2-input-part: total payload size * (glob)
2105 2103 bundle2-input-bundle: 5 parts total
2106 2104 updating the branch cache
2107 invalid branch cache (served.hidden): tip differs
2108 2105 added 4 changesets with 4 changes to 4 files (+1 heads)
2109 2106 bundle2-output-bundle: "HG20", 1 parts total
2110 2107 bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) empty payload
@@ -2196,7 +2193,6 b' push foobar into the remote'
2196 2193 bundle2-input-part: total payload size * (glob)
2197 2194 bundle2-input-bundle: 5 parts total
2198 2195 updating the branch cache
2199 invalid branch cache (served.hidden): tip differs
2200 2196 added 4 changesets with 4 changes to 4 files (+1 heads)
2201 2197 bundle2-output-bundle: "HG20", 1 parts total
2202 2198 bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) empty payload
@@ -2360,7 +2356,6 b" User 'astro' must not be denied"
2360 2356 bundle2-input-part: total payload size * (glob)
2361 2357 bundle2-input-bundle: 5 parts total
2362 2358 updating the branch cache
2363 invalid branch cache (served.hidden): tip differs
2364 2359 added 4 changesets with 4 changes to 4 files (+1 heads)
2365 2360 bundle2-output-bundle: "HG20", 1 parts total
2366 2361 bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) empty payload
@@ -127,13 +127,11 b' clone, commit, pull'
127 127 added 1 changesets with 1 changes to 1 files
128 128 new changesets d02f48003e62
129 129 (run 'hg update' to get a working copy)
130 $ hg blackbox -l 6
130 $ hg blackbox -l 4
131 131 1970-01-01 00:00:00.000 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> wrote branch cache (served) with 1 labels and 2 nodes
132 1970-01-01 00:00:00.000 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> updated branch cache (served.hidden) in * seconds (glob)
133 1970-01-01 00:00:00.000 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> wrote branch cache (served.hidden) with 1 labels and 2 nodes
134 132 1970-01-01 00:00:00.000 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> 1 incoming changes - new heads: d02f48003e62
135 133 1970-01-01 00:00:00.000 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> pull exited 0 after * seconds (glob)
136 1970-01-01 00:00:00.000 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> blackbox -l 6
134 1970-01-01 00:00:00.000 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> blackbox -l 4
137 135
138 136 we must not cause a failure if we cannot write to the log
139 137
@@ -193,8 +191,8 b' backup bundles get logged'
193 191 $ hg blackbox -l 6
194 192 1970-01-01 00:00:00.000 bob @73f6ee326b27d820b0472f1a825e3a50f3dc489b (5000)> strip tip
195 193 1970-01-01 00:00:00.000 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> saved backup bundle to $TESTTMP/blackboxtest2/.hg/strip-backup/73f6ee326b27-7612e004-backup.hg
196 1970-01-01 00:00:00.000 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> updated branch cache (immutable) in * seconds (glob)
197 1970-01-01 00:00:00.000 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> wrote branch cache (immutable) with 1 labels and 2 nodes
194 1970-01-01 00:00:00.000 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> updated branch cache (base) in * seconds (glob)
195 1970-01-01 00:00:00.000 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> wrote branch cache (base) with 1 labels and 2 nodes
198 196 1970-01-01 00:00:00.000 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> strip tip exited 0 after * seconds (glob)
199 197 1970-01-01 00:00:00.000 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> blackbox -l 6
200 198
@@ -1316,7 +1316,7 b' Unbundling revision should warm the serv'
1316 1316 new changesets 2ab8003a1750:99ba08759bc7
1317 1317 updating to branch A
1318 1318 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1319 $ cat branchmap-update-01/.hg/cache/branch2-served
1319 $ cat branchmap-update-01/.hg/cache/branch2-base
1320 1320 99ba08759bc7f6fdbe5304e83d0387f35c082479 1
1321 1321 99ba08759bc7f6fdbe5304e83d0387f35c082479 o A
1322 1322 $ hg -R branchmap-update-01 unbundle bundle.hg
@@ -1350,7 +1350,7 b' aborted Unbundle should not update the o'
1350 1350 updating to branch A
1351 1351 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1352 1352
1353 $ cat branchmap-update-02/.hg/cache/branch2-served
1353 $ cat branchmap-update-02/.hg/cache/branch2-base
1354 1354 99ba08759bc7f6fdbe5304e83d0387f35c082479 1
1355 1355 99ba08759bc7f6fdbe5304e83d0387f35c082479 o A
1356 1356 $ hg -R branchmap-update-02 unbundle bundle.hg --config "hooks.pretxnclose=python:$TESTTMP/simplehook.py:hook"
@@ -1361,6 +1361,6 b' aborted Unbundle should not update the o'
1361 1361 rollback completed
1362 1362 abort: pretxnclose hook failed
1363 1363 [40]
1364 $ cat branchmap-update-02/.hg/cache/branch2-served
1364 $ cat branchmap-update-02/.hg/cache/branch2-base
1365 1365 99ba08759bc7f6fdbe5304e83d0387f35c082479 1
1366 1366 99ba08759bc7f6fdbe5304e83d0387f35c082479 o A
@@ -220,11 +220,7 b' changes in the process.'
220 220 #if no-stream-legacy
221 221 $ ls -1 clone1/.hg/cache
222 222 branch2-base
223 branch2-immutable
224 223 branch2-served
225 branch2-served.hidden
226 branch2-visible
227 branch2-visible-hidden
228 224 rbc-names-v1
229 225 rbc-revs-v1
230 226 tags2
@@ -47,11 +47,7 b' Ensure branchcache got copied over:'
47 47
48 48 $ ls .hg/cache
49 49 branch2-base
50 branch2-immutable
51 50 branch2-served
52 branch2-served.hidden
53 branch2-visible
54 branch2-visible-hidden
55 51 rbc-names-v1
56 52 rbc-revs-v1
57 53 tags2
@@ -71,42 +67,34 b' No update, with debug option:'
71 67
72 68 #if hardlink
73 69 $ hg --debug clone -U . ../c --config progress.debug=true
74 linking: 1/16 files (6.25%) (no-rust !)
75 linking: 2/16 files (12.50%) (no-rust !)
76 linking: 3/16 files (18.75%) (no-rust !)
77 linking: 4/16 files (25.00%) (no-rust !)
78 linking: 5/16 files (31.25%) (no-rust !)
79 linking: 6/16 files (37.50%) (no-rust !)
80 linking: 7/16 files (43.75%) (no-rust !)
81 linking: 8/16 files (50.00%) (no-rust !)
82 linking: 9/16 files (56.25%) (no-rust !)
83 linking: 10/16 files (62.50%) (no-rust !)
84 linking: 11/16 files (68.75%) (no-rust !)
85 linking: 12/16 files (75.00%) (no-rust !)
86 linking: 13/16 files (81.25%) (no-rust !)
87 linking: 14/16 files (87.50%) (no-rust !)
88 linking: 15/16 files (93.75%) (no-rust !)
89 linking: 16/16 files (100.00%) (no-rust !)
90 linked 16 files (no-rust !)
91 linking: 1/18 files (5.56%) (rust !)
92 linking: 2/18 files (11.11%) (rust !)
93 linking: 3/18 files (16.67%) (rust !)
94 linking: 4/18 files (22.22%) (rust !)
95 linking: 5/18 files (27.78%) (rust !)
96 linking: 6/18 files (33.33%) (rust !)
97 linking: 7/18 files (38.89%) (rust !)
98 linking: 8/18 files (44.44%) (rust !)
99 linking: 9/18 files (50.00%) (rust !)
100 linking: 10/18 files (55.56%) (rust !)
101 linking: 11/18 files (61.11%) (rust !)
102 linking: 12/18 files (66.67%) (rust !)
103 linking: 13/18 files (72.22%) (rust !)
104 linking: 14/18 files (77.78%) (rust !)
105 linking: 15/18 files (83.33%) (rust !)
106 linking: 16/18 files (88.89%) (rust !)
107 linking: 17/18 files (94.44%) (rust !)
108 linking: 18/18 files (100.00%) (rust !)
109 linked 18 files (rust !)
70 linking: 1/12 files (8.33%) (no-rust !)
71 linking: 2/12 files (16.67%) (no-rust !)
72 linking: 3/12 files (25.00%) (no-rust !)
73 linking: 4/12 files (33.33%) (no-rust !)
74 linking: 5/12 files (41.67%) (no-rust !)
75 linking: 6/12 files (50.00%) (no-rust !)
76 linking: 7/12 files (58.33%) (no-rust !)
77 linking: 8/12 files (66.67%) (no-rust !)
78 linking: 9/12 files (75.00%) (no-rust !)
79 linking: 10/12 files (83.33%) (no-rust !)
80 linking: 11/12 files (91.67%) (no-rust !)
81 linking: 12/12 files (100.00%) (no-rust !)
82 linked 12 files (no-rust !)
83 linking: 1/14 files (7.14%) (rust !)
84 linking: 2/14 files (14.29%) (rust !)
85 linking: 3/14 files (21.43%) (rust !)
86 linking: 4/14 files (28.57%) (rust !)
87 linking: 5/14 files (35.71%) (rust !)
88 linking: 6/14 files (42.86%) (rust !)
89 linking: 7/14 files (50.00%) (rust !)
90 linking: 8/14 files (57.14%) (rust !)
91 linking: 9/14 files (64.29%) (rust !)
92 linking: 10/14 files (71.43%) (rust !)
93 linking: 11/14 files (78.57%) (rust !)
94 linking: 12/14 files (85.71%) (rust !)
95 linking: 13/14 files (92.86%) (rust !)
96 linking: 14/14 files (100.00%) (rust !)
97 linked 14 files (rust !)
110 98 updating the branch cache
111 99 #else
112 100 $ hg --debug clone -U . ../c --config progress.debug=true
@@ -125,11 +113,7 b' Ensure branchcache got copied over:'
125 113
126 114 $ ls .hg/cache
127 115 branch2-base
128 branch2-immutable
129 116 branch2-served
130 branch2-served.hidden
131 branch2-visible
132 branch2-visible-hidden
133 117 rbc-names-v1
134 118 rbc-revs-v1
135 119 tags2
@@ -652,12 +652,7 b' Test cache warming command'
652 652 .hg/cache/rbc-revs-v1
653 653 .hg/cache/rbc-names-v1
654 654 .hg/cache/hgtagsfnodes1
655 .hg/cache/branch2-visible-hidden
656 .hg/cache/branch2-visible
657 .hg/cache/branch2-served.hidden
658 655 .hg/cache/branch2-served
659 .hg/cache/branch2-immutable
660 .hg/cache/branch2-base
661 656
662 657 Test debug::unbundle
663 658
@@ -263,11 +263,7 b' r4 has hardlinks in the working dir (not'
263 263 2 r4/.hg/00changelog.i
264 264 [24] r4/.hg/branch (re)
265 265 2 r4/.hg/cache/branch2-base
266 2 r4/.hg/cache/branch2-immutable
267 266 2 r4/.hg/cache/branch2-served
268 2 r4/.hg/cache/branch2-served.hidden
269 2 r4/.hg/cache/branch2-visible
270 2 r4/.hg/cache/branch2-visible-hidden
271 267 2 r4/.hg/cache/rbc-names-v1
272 268 2 r4/.hg/cache/rbc-revs-v1
273 269 2 r4/.hg/cache/tags2
@@ -320,11 +316,7 b' Update back to revision 12 in r4 should '
320 316 2 r4/.hg/00changelog.i
321 317 1 r4/.hg/branch
322 318 2 r4/.hg/cache/branch2-base
323 2 r4/.hg/cache/branch2-immutable
324 319 2 r4/.hg/cache/branch2-served
325 2 r4/.hg/cache/branch2-served.hidden
326 2 r4/.hg/cache/branch2-visible
327 2 r4/.hg/cache/branch2-visible-hidden
328 320 2 r4/.hg/cache/rbc-names-v1
329 321 2 r4/.hg/cache/rbc-revs-v1
330 322 2 r4/.hg/cache/tags2
@@ -36,12 +36,7 b' Check same result using `experimental.ex'
36 36 $ hg -R test --config experimental.extra-filter-revs='not public()' debugupdatecache
37 37 $ ls -1 test/.hg/cache/
38 38 branch2-base%89c45d2fa07e
39 branch2-immutable%89c45d2fa07e
40 39 branch2-served
41 branch2-served%89c45d2fa07e
42 branch2-served.hidden%89c45d2fa07e
43 branch2-visible%89c45d2fa07e
44 branch2-visible-hidden%89c45d2fa07e
45 40 hgtagsfnodes1
46 41 rbc-names-v1
47 42 rbc-revs-v1
@@ -63,11 +63,7 b' Cloning a shared repo should pick up the'
63 63 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
64 64 $ ls -1 ../repo2-clone/.hg/cache
65 65 branch2-base
66 branch2-immutable
67 66 branch2-served
68 branch2-served.hidden
69 branch2-visible
70 branch2-visible-hidden
71 67 rbc-names-v1
72 68 rbc-revs-v1
73 69 tags2
@@ -72,8 +72,8 b' clone bookmarks via stream'
72 72 $ hg -R local-stream book mybook
73 73 $ hg clone --stream ssh://user@dummy/local-stream stream2
74 74 streaming all changes
75 16 files to transfer, * of data (glob) (no-rust !)
76 18 files to transfer, * of data (glob) (rust !)
75 12 files to transfer, * of data (glob) (no-rust !)
76 14 files to transfer, * of data (glob) (rust !)
77 77 transferred * in * seconds (*) (glob)
78 78 updating to branch default
79 79 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
@@ -1,3 +1,5 b''
1 This test cover a bug that no longer exist.
2
1 3 Define helpers.
2 4
3 5 $ hg_log () { hg log -G -T "{rev}:{node|short}"; }
@@ -18,7 +20,10 b' Setup hg repo.'
18 20
19 21 $ hg pull -q ../repo
20 22
21 $ cat .hg/cache/branch2-visible
23 $ ls -1 .hg/cache/branch?*
24 .hg/cache/branch2-base
25 .hg/cache/branch2-served
26 $ cat .hg/cache/branch?-served
22 27 222ae9789a75703f9836e44de7db179cbfd420ee 2
23 28 a3498d6e39376d2456425dd8c692367bdbf00fa2 o default
24 29 222ae9789a75703f9836e44de7db179cbfd420ee o default
@@ -33,24 +38,38 b' Setup hg repo.'
33 38
34 39 $ strip '1:'
35 40
36 The branchmap cache is not adjusted on strip.
37 Now mentions a changelog entry that has been stripped.
41 After the strip the "served" cache is now identical to the "base" one, and the
42 older one have been actively deleted.
38 43
39 $ cat .hg/cache/branch2-visible
44 $ ls -1 .hg/cache/branch?*
45 .hg/cache/branch2-base
46 .hg/cache/branch2-served
47 $ cat .hg/cache/branch?-served
40 48 222ae9789a75703f9836e44de7db179cbfd420ee 2
41 49 a3498d6e39376d2456425dd8c692367bdbf00fa2 o default
42 50 222ae9789a75703f9836e44de7db179cbfd420ee o default
43 51
44 $ commit c
45
46 Not adjusted on commit, either.
52 We do a new commit and we get a new valid branchmap for the served version
47 53
48 $ cat .hg/cache/branch2-visible
49 222ae9789a75703f9836e44de7db179cbfd420ee 2
50 a3498d6e39376d2456425dd8c692367bdbf00fa2 o default
51 222ae9789a75703f9836e44de7db179cbfd420ee o default
54 $ commit c
55 $ ls -1 .hg/cache/branch?*
56 .hg/cache/branch2-base
57 .hg/cache/branch2-served
58 $ cat .hg/cache/branch?-served
59 a1602b357cfca067600406eb19060c7128804d72 1
60 a1602b357cfca067600406eb19060c7128804d72 o default
61
52 62
53 63 On pull we end up with the same tip, and so wrongly reuse the invalid cache and crash.
54 64
55 $ hg pull ../repo 2>&1 | grep 'ValueError:'
56 ValueError: node a3498d6e39376d2456425dd8c692367bdbf00fa2 does not exist (known-bad-output !)
65 $ hg pull ../repo --quiet
66 $ hg heads -T '{rev} {node} {branch}\n'
67 2 222ae9789a75703f9836e44de7db179cbfd420ee default
68 1 a1602b357cfca067600406eb19060c7128804d72 default
69 $ ls -1 .hg/cache/branch?*
70 .hg/cache/branch2-base
71 .hg/cache/branch2-served
72 $ cat .hg/cache/branch?-served
73 222ae9789a75703f9836e44de7db179cbfd420ee 2
74 a1602b357cfca067600406eb19060c7128804d72 o default
75 222ae9789a75703f9836e44de7db179cbfd420ee o default
@@ -792,11 +792,6 b' Missing tags2* files means the cache was'
792 792
793 793 $ ls tagsclient/.hg/cache
794 794 branch2-base
795 branch2-immutable
796 branch2-served
797 branch2-served.hidden
798 branch2-visible
799 branch2-visible-hidden
800 795 hgtagsfnodes1
801 796 rbc-names-v1
802 797 rbc-revs-v1
@@ -823,11 +818,6 b' Running hg tags should produce tags2* fi'
823 818
824 819 $ ls tagsclient/.hg/cache
825 820 branch2-base
826 branch2-immutable
827 branch2-served
828 branch2-served.hidden
829 branch2-visible
830 branch2-visible-hidden
831 821 hgtagsfnodes1
832 822 rbc-names-v1
833 823 rbc-revs-v1
@@ -761,8 +761,8 b' Stream clone with basicstore'
761 761 $ hg clone --config experimental.changegroup3=True --stream -U \
762 762 > http://localhost:$HGPORT1 stream-clone-basicstore
763 763 streaming all changes
764 29 files to transfer, * of data (glob) (no-rust !)
765 31 files to transfer, * of data (glob) (rust !)
764 24 files to transfer, * of data (glob) (no-rust !)
765 26 files to transfer, * of data (glob) (rust !)
766 766 transferred * in * seconds (*) (glob)
767 767 $ hg -R stream-clone-basicstore verify -q
768 768 $ cat port-1-errors.log
@@ -771,8 +771,8 b' Stream clone with encodedstore'
771 771 $ hg clone --config experimental.changegroup3=True --stream -U \
772 772 > http://localhost:$HGPORT2 stream-clone-encodedstore
773 773 streaming all changes
774 29 files to transfer, * of data (glob) (no-rust !)
775 31 files to transfer, * of data (glob) (rust !)
774 24 files to transfer, * of data (glob) (no-rust !)
775 26 files to transfer, * of data (glob) (rust !)
776 776 transferred * in * seconds (*) (glob)
777 777 $ hg -R stream-clone-encodedstore verify -q
778 778 $ cat port-2-errors.log
General Comments 0
You need to be logged in to leave comments. Login now