Show More
@@ -1,258 +1,320 b'' | |||||
1 |
|
1 | |||
2 | #require no-reposimplestore no-chg |
|
2 | #require no-reposimplestore no-chg | |
3 |
|
3 | |||
4 | initial setup |
|
4 | initial setup | |
5 |
|
5 | |||
6 | $ hg init server |
|
6 | $ hg init server | |
7 | $ cat >> server/.hg/hgrc << EOF |
|
7 | $ cat >> server/.hg/hgrc << EOF | |
8 | > [extensions] |
|
8 | > [extensions] | |
9 | > clonebundles = |
|
9 | > clonebundles = | |
10 | > |
|
10 | > | |
11 | > [clone-bundles] |
|
11 | > [clone-bundles] | |
12 | > auto-generate.on-change = yes |
|
12 | > auto-generate.on-change = yes | |
13 | > auto-generate.formats = v2 |
|
13 | > auto-generate.formats = v2 | |
14 | > upload-command = cp "\$HGCB_BUNDLE_PATH" "$TESTTMP"/final-upload/ |
|
14 | > upload-command = cp "\$HGCB_BUNDLE_PATH" "$TESTTMP"/final-upload/ | |
15 | > delete-command = rm -f "$TESTTMP/final-upload/\$HGCB_BASENAME" |
|
15 | > delete-command = rm -f "$TESTTMP/final-upload/\$HGCB_BASENAME" | |
16 | > url-template = file://$TESTTMP/final-upload/{basename} |
|
16 | > url-template = file://$TESTTMP/final-upload/{basename} | |
17 | > |
|
17 | > | |
18 | > [devel] |
|
18 | > [devel] | |
19 | > debug.clonebundles=yes |
|
19 | > debug.clonebundles=yes | |
20 | > EOF |
|
20 | > EOF | |
21 |
|
21 | |||
22 | $ mkdir final-upload |
|
22 | $ mkdir final-upload | |
23 | $ hg clone server client |
|
23 | $ hg clone server client | |
24 | updating to branch default |
|
24 | updating to branch default | |
25 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
25 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
26 | $ cd client |
|
26 | $ cd client | |
27 |
|
27 | |||
28 | Test bundles are generated on push |
|
28 | Test bundles are generated on push | |
29 | ================================== |
|
29 | ================================== | |
30 |
|
30 | |||
31 | $ touch foo |
|
31 | $ touch foo | |
32 | $ hg -q commit -A -m 'add foo' |
|
32 | $ hg -q commit -A -m 'add foo' | |
33 | $ touch bar |
|
33 | $ touch bar | |
34 | $ hg -q commit -A -m 'add bar' |
|
34 | $ hg -q commit -A -m 'add bar' | |
35 | $ hg push |
|
35 | $ hg push | |
36 | pushing to $TESTTMP/server |
|
36 | pushing to $TESTTMP/server | |
37 | searching for changes |
|
37 | searching for changes | |
38 | adding changesets |
|
38 | adding changesets | |
39 | adding manifests |
|
39 | adding manifests | |
40 | adding file changes |
|
40 | adding file changes | |
41 | 2 changesets found |
|
41 | 2 changesets found | |
42 | added 2 changesets with 2 changes to 2 files |
|
42 | added 2 changesets with 2 changes to 2 files | |
43 | clone-bundles: starting bundle generation: v2 |
|
43 | clone-bundles: starting bundle generation: v2 | |
44 | $ cat ../server/.hg/clonebundles.manifest |
|
44 | $ cat ../server/.hg/clonebundles.manifest | |
45 | file:/*/$TESTTMP/final-upload/full-v2-2_revs-aaff8d2ffbbf_tip-*_txn.hg BUNDLESPEC=v2 REQUIRESNI=true (glob) |
|
45 | file:/*/$TESTTMP/final-upload/full-v2-2_revs-aaff8d2ffbbf_tip-*_txn.hg BUNDLESPEC=v2 REQUIRESNI=true (glob) | |
46 | $ ls -1 ../final-upload |
|
46 | $ ls -1 ../final-upload | |
47 | full-v2-2_revs-aaff8d2ffbbf_tip-*_txn.hg (glob) |
|
47 | full-v2-2_revs-aaff8d2ffbbf_tip-*_txn.hg (glob) | |
48 | $ ls -1 ../server/.hg/tmp-bundles |
|
48 | $ ls -1 ../server/.hg/tmp-bundles | |
49 |
|
49 | |||
50 | Newer bundles are generated with more pushes |
|
50 | Newer bundles are generated with more pushes | |
51 | -------------------------------------------- |
|
51 | -------------------------------------------- | |
52 |
|
52 | |||
53 | $ touch baz |
|
53 | $ touch baz | |
54 | $ hg -q commit -A -m 'add baz' |
|
54 | $ hg -q commit -A -m 'add baz' | |
55 | $ touch buz |
|
55 | $ touch buz | |
56 | $ hg -q commit -A -m 'add buz' |
|
56 | $ hg -q commit -A -m 'add buz' | |
57 | $ hg push |
|
57 | $ hg push | |
58 | pushing to $TESTTMP/server |
|
58 | pushing to $TESTTMP/server | |
59 | searching for changes |
|
59 | searching for changes | |
60 | adding changesets |
|
60 | adding changesets | |
61 | adding manifests |
|
61 | adding manifests | |
62 | adding file changes |
|
62 | adding file changes | |
63 | 4 changesets found |
|
63 | 4 changesets found | |
64 | added 2 changesets with 2 changes to 2 files |
|
64 | added 2 changesets with 2 changes to 2 files | |
65 | clone-bundles: starting bundle generation: v2 |
|
65 | clone-bundles: starting bundle generation: v2 | |
66 |
|
66 | |||
67 | $ cat ../server/.hg/clonebundles.manifest |
|
67 | $ cat ../server/.hg/clonebundles.manifest | |
68 | file:/*/$TESTTMP/final-upload/full-v2-4_revs-6427147b985a_tip-*_txn.hg BUNDLESPEC=v2 REQUIRESNI=true (glob) |
|
68 | file:/*/$TESTTMP/final-upload/full-v2-4_revs-6427147b985a_tip-*_txn.hg BUNDLESPEC=v2 REQUIRESNI=true (glob) | |
69 | $ ls -1 ../final-upload |
|
69 | $ ls -1 ../final-upload | |
70 | full-v2-2_revs-aaff8d2ffbbf_tip-*_txn.hg (glob) |
|
70 | full-v2-2_revs-aaff8d2ffbbf_tip-*_txn.hg (glob) | |
71 | full-v2-4_revs-6427147b985a_tip-*_txn.hg (glob) |
|
71 | full-v2-4_revs-6427147b985a_tip-*_txn.hg (glob) | |
72 | $ ls -1 ../server/.hg/tmp-bundles |
|
72 | $ ls -1 ../server/.hg/tmp-bundles | |
73 |
|
73 | |||
74 | Older bundles are cleaned up with more pushes |
|
74 | Older bundles are cleaned up with more pushes | |
75 | --------------------------------------------- |
|
75 | --------------------------------------------- | |
76 |
|
76 | |||
77 | $ touch faz |
|
77 | $ touch faz | |
78 | $ hg -q commit -A -m 'add faz' |
|
78 | $ hg -q commit -A -m 'add faz' | |
79 | $ touch fuz |
|
79 | $ touch fuz | |
80 | $ hg -q commit -A -m 'add fuz' |
|
80 | $ hg -q commit -A -m 'add fuz' | |
81 | $ hg push |
|
81 | $ hg push | |
82 | pushing to $TESTTMP/server |
|
82 | pushing to $TESTTMP/server | |
83 | searching for changes |
|
83 | searching for changes | |
84 | adding changesets |
|
84 | adding changesets | |
85 | adding manifests |
|
85 | adding manifests | |
86 | adding file changes |
|
86 | adding file changes | |
87 | clone-bundles: deleting bundle full-v2-2_revs-aaff8d2ffbbf_tip-*_txn.hg (glob) |
|
87 | clone-bundles: deleting bundle full-v2-2_revs-aaff8d2ffbbf_tip-*_txn.hg (glob) | |
88 | 6 changesets found |
|
88 | 6 changesets found | |
89 | added 2 changesets with 2 changes to 2 files |
|
89 | added 2 changesets with 2 changes to 2 files | |
90 | clone-bundles: starting bundle generation: v2 |
|
90 | clone-bundles: starting bundle generation: v2 | |
91 |
|
91 | |||
92 | $ cat ../server/.hg/clonebundles.manifest |
|
92 | $ cat ../server/.hg/clonebundles.manifest | |
93 | file:/*/$TESTTMP/final-upload/full-v2-6_revs-b1010e95ea00_tip-*_txn.hg BUNDLESPEC=v2 REQUIRESNI=true (glob) |
|
93 | file:/*/$TESTTMP/final-upload/full-v2-6_revs-b1010e95ea00_tip-*_txn.hg BUNDLESPEC=v2 REQUIRESNI=true (glob) | |
94 | $ ls -1 ../final-upload |
|
94 | $ ls -1 ../final-upload | |
95 | full-v2-4_revs-6427147b985a_tip-*_txn.hg (glob) |
|
95 | full-v2-4_revs-6427147b985a_tip-*_txn.hg (glob) | |
96 | full-v2-6_revs-b1010e95ea00_tip-*_txn.hg (glob) |
|
96 | full-v2-6_revs-b1010e95ea00_tip-*_txn.hg (glob) | |
97 | $ ls -1 ../server/.hg/tmp-bundles |
|
97 | $ ls -1 ../server/.hg/tmp-bundles | |
98 |
|
98 | |||
99 | Test conditions to get them generated |
|
99 | Test conditions to get them generated | |
100 | ===================================== |
|
100 | ===================================== | |
101 |
|
101 | |||
102 | Check ratio |
|
102 | Check ratio | |
103 |
|
103 | |||
104 | $ cat >> ../server/.hg/hgrc << EOF |
|
104 | $ cat >> ../server/.hg/hgrc << EOF | |
105 | > [clone-bundles] |
|
105 | > [clone-bundles] | |
106 | > trigger.below-bundled-ratio = 0.5 |
|
106 | > trigger.below-bundled-ratio = 0.5 | |
107 | > EOF |
|
107 | > EOF | |
108 | $ touch far |
|
108 | $ touch far | |
109 | $ hg -q commit -A -m 'add far' |
|
109 | $ hg -q commit -A -m 'add far' | |
110 | $ hg push |
|
110 | $ hg push | |
111 | pushing to $TESTTMP/server |
|
111 | pushing to $TESTTMP/server | |
112 | searching for changes |
|
112 | searching for changes | |
113 | adding changesets |
|
113 | adding changesets | |
114 | adding manifests |
|
114 | adding manifests | |
115 | adding file changes |
|
115 | adding file changes | |
116 | added 1 changesets with 1 changes to 1 files |
|
116 | added 1 changesets with 1 changes to 1 files | |
117 | $ cat ../server/.hg/clonebundles.manifest |
|
117 | $ cat ../server/.hg/clonebundles.manifest | |
118 | file:/*/$TESTTMP/final-upload/full-v2-6_revs-b1010e95ea00_tip-*_txn.hg BUNDLESPEC=v2 REQUIRESNI=true (glob) |
|
118 | file:/*/$TESTTMP/final-upload/full-v2-6_revs-b1010e95ea00_tip-*_txn.hg BUNDLESPEC=v2 REQUIRESNI=true (glob) | |
119 | $ ls -1 ../final-upload |
|
119 | $ ls -1 ../final-upload | |
120 | full-v2-4_revs-6427147b985a_tip-*_txn.hg (glob) |
|
120 | full-v2-4_revs-6427147b985a_tip-*_txn.hg (glob) | |
121 | full-v2-6_revs-b1010e95ea00_tip-*_txn.hg (glob) |
|
121 | full-v2-6_revs-b1010e95ea00_tip-*_txn.hg (glob) | |
122 | $ ls -1 ../server/.hg/tmp-bundles |
|
122 | $ ls -1 ../server/.hg/tmp-bundles | |
123 |
|
123 | |||
124 | Check absolute number of revisions |
|
124 | Check absolute number of revisions | |
125 |
|
125 | |||
126 | $ cat >> ../server/.hg/hgrc << EOF |
|
126 | $ cat >> ../server/.hg/hgrc << EOF | |
127 | > [clone-bundles] |
|
127 | > [clone-bundles] | |
128 | > trigger.revs = 2 |
|
128 | > trigger.revs = 2 | |
129 | > EOF |
|
129 | > EOF | |
130 | $ touch bur |
|
130 | $ touch bur | |
131 | $ hg -q commit -A -m 'add bur' |
|
131 | $ hg -q commit -A -m 'add bur' | |
132 | $ hg push |
|
132 | $ hg push | |
133 | pushing to $TESTTMP/server |
|
133 | pushing to $TESTTMP/server | |
134 | searching for changes |
|
134 | searching for changes | |
135 | adding changesets |
|
135 | adding changesets | |
136 | adding manifests |
|
136 | adding manifests | |
137 | adding file changes |
|
137 | adding file changes | |
138 | clone-bundles: deleting bundle full-v2-4_revs-6427147b985a_tip-*_txn.hg (glob) |
|
138 | clone-bundles: deleting bundle full-v2-4_revs-6427147b985a_tip-*_txn.hg (glob) | |
139 | 8 changesets found |
|
139 | 8 changesets found | |
140 | added 1 changesets with 1 changes to 1 files |
|
140 | added 1 changesets with 1 changes to 1 files | |
141 | clone-bundles: starting bundle generation: v2 |
|
141 | clone-bundles: starting bundle generation: v2 | |
142 | $ cat ../server/.hg/clonebundles.manifest |
|
142 | $ cat ../server/.hg/clonebundles.manifest | |
143 | file:/*/$TESTTMP/final-upload/full-v2-8_revs-8353e8af1306_tip-*_txn.hg BUNDLESPEC=v2 REQUIRESNI=true (glob) |
|
143 | file:/*/$TESTTMP/final-upload/full-v2-8_revs-8353e8af1306_tip-*_txn.hg BUNDLESPEC=v2 REQUIRESNI=true (glob) | |
144 | $ ls -1 ../final-upload |
|
144 | $ ls -1 ../final-upload | |
145 | full-v2-6_revs-b1010e95ea00_tip-*_txn.hg (glob) |
|
145 | full-v2-6_revs-b1010e95ea00_tip-*_txn.hg (glob) | |
146 | full-v2-8_revs-8353e8af1306_tip-*_txn.hg (glob) |
|
146 | full-v2-8_revs-8353e8af1306_tip-*_txn.hg (glob) | |
147 | $ ls -1 ../server/.hg/tmp-bundles |
|
147 | $ ls -1 ../server/.hg/tmp-bundles | |
148 |
|
148 | |||
149 | (that one would not generate new bundles) |
|
149 | (that one would not generate new bundles) | |
150 |
|
150 | |||
151 | $ touch tur |
|
151 | $ touch tur | |
152 | $ hg -q commit -A -m 'add tur' |
|
152 | $ hg -q commit -A -m 'add tur' | |
153 | $ hg push |
|
153 | $ hg push | |
154 | pushing to $TESTTMP/server |
|
154 | pushing to $TESTTMP/server | |
155 | searching for changes |
|
155 | searching for changes | |
156 | adding changesets |
|
156 | adding changesets | |
157 | adding manifests |
|
157 | adding manifests | |
158 | adding file changes |
|
158 | adding file changes | |
159 | added 1 changesets with 1 changes to 1 files |
|
159 | added 1 changesets with 1 changes to 1 files | |
160 | $ cat ../server/.hg/clonebundles.manifest |
|
160 | $ cat ../server/.hg/clonebundles.manifest | |
161 | file:/*/$TESTTMP/final-upload/full-v2-8_revs-8353e8af1306_tip-*_txn.hg BUNDLESPEC=v2 REQUIRESNI=true (glob) |
|
161 | file:/*/$TESTTMP/final-upload/full-v2-8_revs-8353e8af1306_tip-*_txn.hg BUNDLESPEC=v2 REQUIRESNI=true (glob) | |
162 | $ ls -1 ../final-upload |
|
162 | $ ls -1 ../final-upload | |
163 | full-v2-6_revs-b1010e95ea00_tip-*_txn.hg (glob) |
|
163 | full-v2-6_revs-b1010e95ea00_tip-*_txn.hg (glob) | |
164 | full-v2-8_revs-8353e8af1306_tip-*_txn.hg (glob) |
|
164 | full-v2-8_revs-8353e8af1306_tip-*_txn.hg (glob) | |
165 | $ ls -1 ../server/.hg/tmp-bundles |
|
165 | $ ls -1 ../server/.hg/tmp-bundles | |
166 |
|
166 | |||
167 | Test generation through the dedicated command |
|
167 | Test generation through the dedicated command | |
168 | ============================================= |
|
168 | ============================================= | |
169 |
|
169 | |||
170 | $ cat >> ../server/.hg/hgrc << EOF |
|
170 | $ cat >> ../server/.hg/hgrc << EOF | |
171 | > [clone-bundles] |
|
171 | > [clone-bundles] | |
172 | > auto-generate.on-change = no |
|
172 | > auto-generate.on-change = no | |
173 | > EOF |
|
173 | > EOF | |
174 |
|
174 | |||
175 | Check the command can generate content when needed |
|
175 | Check the command can generate content when needed | |
176 | -------------------------------------------------- |
|
176 | -------------------------------------------------- | |
177 |
|
177 | |||
178 | Do a push that makes the condition fulfilled, |
|
178 | Do a push that makes the condition fulfilled, | |
179 | Yet it should not automatically generate a bundle with |
|
179 | Yet it should not automatically generate a bundle with | |
180 | "auto-generate.on-change" not set. |
|
180 | "auto-generate.on-change" not set. | |
181 |
|
181 | |||
182 | $ touch quoi |
|
182 | $ touch quoi | |
183 | $ hg -q commit -A -m 'add quoi' |
|
183 | $ hg -q commit -A -m 'add quoi' | |
184 |
|
184 | |||
185 | $ pre_push_manifest=`cat ../server/.hg/clonebundles.manifest|f --sha256 | sed 's/.*=//' | cat` |
|
185 | $ pre_push_manifest=`cat ../server/.hg/clonebundles.manifest|f --sha256 | sed 's/.*=//' | cat` | |
186 | $ pre_push_upload=`ls -1 ../final-upload|f --sha256 | sed 's/.*=//' | cat` |
|
186 | $ pre_push_upload=`ls -1 ../final-upload|f --sha256 | sed 's/.*=//' | cat` | |
187 | $ ls -1 ../server/.hg/tmp-bundles |
|
187 | $ ls -1 ../server/.hg/tmp-bundles | |
188 |
|
188 | |||
189 | $ hg push |
|
189 | $ hg push | |
190 | pushing to $TESTTMP/server |
|
190 | pushing to $TESTTMP/server | |
191 | searching for changes |
|
191 | searching for changes | |
192 | adding changesets |
|
192 | adding changesets | |
193 | adding manifests |
|
193 | adding manifests | |
194 | adding file changes |
|
194 | adding file changes | |
195 | added 1 changesets with 1 changes to 1 files |
|
195 | added 1 changesets with 1 changes to 1 files | |
196 |
|
196 | |||
197 | $ post_push_manifest=`cat ../server/.hg/clonebundles.manifest|f --sha256 | sed 's/.*=//' | cat` |
|
197 | $ post_push_manifest=`cat ../server/.hg/clonebundles.manifest|f --sha256 | sed 's/.*=//' | cat` | |
198 | $ post_push_upload=`ls -1 ../final-upload|f --sha256 | sed 's/.*=//' | cat` |
|
198 | $ post_push_upload=`ls -1 ../final-upload|f --sha256 | sed 's/.*=//' | cat` | |
199 | $ ls -1 ../server/.hg/tmp-bundles |
|
199 | $ ls -1 ../server/.hg/tmp-bundles | |
200 | $ test "$pre_push_manifest" = "$post_push_manifest" |
|
200 | $ test "$pre_push_manifest" = "$post_push_manifest" | |
201 | $ test "$pre_push_upload" = "$post_push_upload" |
|
201 | $ test "$pre_push_upload" = "$post_push_upload" | |
202 |
|
202 | |||
203 | Running the command should detect the stale bundles, and do the full automatic |
|
203 | Running the command should detect the stale bundles, and do the full automatic | |
204 | generation logic. |
|
204 | generation logic. | |
205 |
|
205 | |||
206 | $ hg -R ../server/ admin::clone-bundles-refresh |
|
206 | $ hg -R ../server/ admin::clone-bundles-refresh | |
207 | clone-bundles: deleting bundle full-v2-6_revs-b1010e95ea00_tip-*_txn.hg (glob) |
|
207 | clone-bundles: deleting bundle full-v2-6_revs-b1010e95ea00_tip-*_txn.hg (glob) | |
208 | clone-bundles: starting bundle generation: v2 |
|
208 | clone-bundles: starting bundle generation: v2 | |
209 | 10 changesets found |
|
209 | 10 changesets found | |
210 | $ cat ../server/.hg/clonebundles.manifest |
|
210 | $ cat ../server/.hg/clonebundles.manifest | |
211 | file:/*/$TESTTMP/final-upload/full-v2-10_revs-3b6f57f17d70_tip-*_acbr.hg BUNDLESPEC=v2 REQUIRESNI=true (glob) |
|
211 | file:/*/$TESTTMP/final-upload/full-v2-10_revs-3b6f57f17d70_tip-*_acbr.hg BUNDLESPEC=v2 REQUIRESNI=true (glob) | |
212 | $ ls -1 ../final-upload |
|
212 | $ ls -1 ../final-upload | |
213 | full-v2-10_revs-3b6f57f17d70_tip-*_acbr.hg (glob) |
|
213 | full-v2-10_revs-3b6f57f17d70_tip-*_acbr.hg (glob) | |
214 | full-v2-8_revs-8353e8af1306_tip-*_txn.hg (glob) |
|
214 | full-v2-8_revs-8353e8af1306_tip-*_txn.hg (glob) | |
215 | $ ls -1 ../server/.hg/tmp-bundles |
|
215 | $ ls -1 ../server/.hg/tmp-bundles | |
216 |
|
216 | |||
217 | Check the command cleans up older bundles when possible |
|
217 | Check the command cleans up older bundles when possible | |
218 | ------------------------------------------------------- |
|
218 | ------------------------------------------------------- | |
219 |
|
219 | |||
220 | $ hg -R ../server/ admin::clone-bundles-refresh |
|
220 | $ hg -R ../server/ admin::clone-bundles-refresh | |
221 | clone-bundles: deleting bundle full-v2-8_revs-8353e8af1306_tip-*_txn.hg (glob) |
|
221 | clone-bundles: deleting bundle full-v2-8_revs-8353e8af1306_tip-*_txn.hg (glob) | |
222 | $ cat ../server/.hg/clonebundles.manifest |
|
222 | $ cat ../server/.hg/clonebundles.manifest | |
223 | file:/*/$TESTTMP/final-upload/full-v2-10_revs-3b6f57f17d70_tip-*_acbr.hg BUNDLESPEC=v2 REQUIRESNI=true (glob) |
|
223 | file:/*/$TESTTMP/final-upload/full-v2-10_revs-3b6f57f17d70_tip-*_acbr.hg BUNDLESPEC=v2 REQUIRESNI=true (glob) | |
224 | $ ls -1 ../final-upload |
|
224 | $ ls -1 ../final-upload | |
225 | full-v2-10_revs-3b6f57f17d70_tip-*_acbr.hg (glob) |
|
225 | full-v2-10_revs-3b6f57f17d70_tip-*_acbr.hg (glob) | |
226 | $ ls -1 ../server/.hg/tmp-bundles |
|
226 | $ ls -1 ../server/.hg/tmp-bundles | |
227 |
|
227 | |||
228 | Nothing is generated when the bundles are sufficiently up to date |
|
228 | Nothing is generated when the bundles are sufficiently up to date | |
229 | ----------------------------------------------------------------- |
|
229 | ----------------------------------------------------------------- | |
230 |
|
230 | |||
231 | $ touch feur |
|
231 | $ touch feur | |
232 | $ hg -q commit -A -m 'add feur' |
|
232 | $ hg -q commit -A -m 'add feur' | |
233 |
|
233 | |||
234 | $ pre_push_manifest=`cat ../server/.hg/clonebundles.manifest|f --sha256 | sed 's/.*=//' | cat` |
|
234 | $ pre_push_manifest=`cat ../server/.hg/clonebundles.manifest|f --sha256 | sed 's/.*=//' | cat` | |
235 | $ pre_push_upload=`ls -1 ../final-upload|f --sha256 | sed 's/.*=//' | cat` |
|
235 | $ pre_push_upload=`ls -1 ../final-upload|f --sha256 | sed 's/.*=//' | cat` | |
236 | $ ls -1 ../server/.hg/tmp-bundles |
|
236 | $ ls -1 ../server/.hg/tmp-bundles | |
237 |
|
237 | |||
238 | $ hg push |
|
238 | $ hg push | |
239 | pushing to $TESTTMP/server |
|
239 | pushing to $TESTTMP/server | |
240 | searching for changes |
|
240 | searching for changes | |
241 | adding changesets |
|
241 | adding changesets | |
242 | adding manifests |
|
242 | adding manifests | |
243 | adding file changes |
|
243 | adding file changes | |
244 | added 1 changesets with 1 changes to 1 files |
|
244 | added 1 changesets with 1 changes to 1 files | |
245 |
|
245 | |||
246 | $ post_push_manifest=`cat ../server/.hg/clonebundles.manifest|f --sha256 | sed 's/.*=//' | cat` |
|
246 | $ post_push_manifest=`cat ../server/.hg/clonebundles.manifest|f --sha256 | sed 's/.*=//' | cat` | |
247 | $ post_push_upload=`ls -1 ../final-upload|f --sha256 | sed 's/.*=//' | cat` |
|
247 | $ post_push_upload=`ls -1 ../final-upload|f --sha256 | sed 's/.*=//' | cat` | |
248 | $ ls -1 ../server/.hg/tmp-bundles |
|
248 | $ ls -1 ../server/.hg/tmp-bundles | |
249 | $ test "$pre_push_manifest" = "$post_push_manifest" |
|
249 | $ test "$pre_push_manifest" = "$post_push_manifest" | |
250 | $ test "$pre_push_upload" = "$post_push_upload" |
|
250 | $ test "$pre_push_upload" = "$post_push_upload" | |
251 |
|
251 | |||
252 | $ hg -R ../server/ admin::clone-bundles-refresh |
|
252 | $ hg -R ../server/ admin::clone-bundles-refresh | |
253 |
|
253 | |||
254 | $ post_refresh_manifest=`cat ../server/.hg/clonebundles.manifest|f --sha256 | sed 's/.*=//' | cat` |
|
254 | $ post_refresh_manifest=`cat ../server/.hg/clonebundles.manifest|f --sha256 | sed 's/.*=//' | cat` | |
255 | $ post_refresh_upload=`ls -1 ../final-upload|f --sha256 | sed 's/.*=//' | cat` |
|
255 | $ post_refresh_upload=`ls -1 ../final-upload|f --sha256 | sed 's/.*=//' | cat` | |
256 | $ ls -1 ../server/.hg/tmp-bundles |
|
256 | $ ls -1 ../server/.hg/tmp-bundles | |
257 | $ test "$pre_push_manifest" = "$post_refresh_manifest" |
|
257 | $ test "$pre_push_manifest" = "$post_refresh_manifest" | |
258 | $ test "$pre_push_upload" = "$post_refresh_upload" |
|
258 | $ test "$pre_push_upload" = "$post_refresh_upload" | |
|
259 | ||||
|
260 | Test modification of configuration | |||
|
261 | ================================== | |||
|
262 | ||||
|
263 | Testing that later runs adapt to configuration changes even if the repository is | |||
|
264 | unchanged. | |||
|
265 | ||||
|
266 | adding more formats | |||
|
267 | ------------------- | |||
|
268 | ||||
|
269 | bundle for added formats should be generated | |||
|
270 | ||||
|
271 | change configuration | |||
|
272 | ||||
|
273 | $ cat >> ../server/.hg/hgrc << EOF | |||
|
274 | > [clone-bundles] | |||
|
275 | > auto-generate.formats = v1, v2 | |||
|
276 | > EOF | |||
|
277 | ||||
|
278 | refresh the bundles | |||
|
279 | ||||
|
280 | $ hg -R ../server/ admin::clone-bundles-refresh | |||
|
281 | clone-bundles: starting bundle generation: v1 | |||
|
282 | 11 changesets found | |||
|
283 | ||||
|
284 | the bundle for the "new" format should have been added | |||
|
285 | ||||
|
286 | $ cat ../server/.hg/clonebundles.manifest | |||
|
287 | file:/*/$TESTTMP/final-upload/full-v1-11_revs-4226b1cd5fda_tip-*_acbr.hg BUNDLESPEC=v1 REQUIRESNI=true (glob) | |||
|
288 | file:/*/$TESTTMP/final-upload/full-v2-10_revs-3b6f57f17d70_tip-*_acbr.hg BUNDLESPEC=v2 REQUIRESNI=true (glob) | |||
|
289 | $ ls -1 ../final-upload | |||
|
290 | full-v1-11_revs-4226b1cd5fda_tip-*_acbr.hg (glob) | |||
|
291 | full-v2-10_revs-3b6f57f17d70_tip-*_acbr.hg (glob) | |||
|
292 | $ ls -1 ../server/.hg/tmp-bundles | |||
|
293 | ||||
|
294 | Changing the ratio | |||
|
295 | ------------------ | |||
|
296 | ||||
|
297 | Changing the ratio to something that would have triggered a bundle during the last push. | |||
|
298 | ||||
|
299 | $ cat >> ../server/.hg/hgrc << EOF | |||
|
300 | > [clone-bundles] | |||
|
301 | > trigger.below-bundled-ratio = 0.95 | |||
|
302 | > EOF | |||
|
303 | ||||
|
304 | refresh the bundles | |||
|
305 | ||||
|
306 | $ hg -R ../server/ admin::clone-bundles-refresh | |||
|
307 | clone-bundles: starting bundle generation: v2 | |||
|
308 | 11 changesets found | |||
|
309 | ||||
|
310 | ||||
|
311 | the "outdated' bundle should be refreshed | |||
|
312 | ||||
|
313 | $ cat ../server/.hg/clonebundles.manifest | |||
|
314 | file:/*/$TESTTMP/final-upload/full-v1-11_revs-4226b1cd5fda_tip-*_acbr.hg BUNDLESPEC=v1 REQUIRESNI=true (glob) | |||
|
315 | file:/*/$TESTTMP/final-upload/full-v2-11_revs-4226b1cd5fda_tip-*_acbr.hg BUNDLESPEC=v2 REQUIRESNI=true (glob) | |||
|
316 | $ ls -1 ../final-upload | |||
|
317 | full-v1-11_revs-4226b1cd5fda_tip-*_acbr.hg (glob) | |||
|
318 | full-v2-10_revs-3b6f57f17d70_tip-*_acbr.hg (glob) | |||
|
319 | full-v2-11_revs-4226b1cd5fda_tip-*_acbr.hg (glob) | |||
|
320 | $ ls -1 ../server/.hg/tmp-bundles |
General Comments 0
You need to be logged in to leave comments.
Login now