##// END OF EJS Templates
stream-clone: add a explicit test for format change during stream clone...
marmoute -
r49444:a6f16ec0 default
parent child Browse files
Show More
@@ -0,0 +1,285 b''
1 This file contains tests case that deal with format change accross stream clone
2
3 #require serve no-reposimplestore no-chg
4
5 #testcases stream-legacy
6
7 (the #stream-bundle2 variant is actually buggy for the moment)
8
9 #if stream-legacy
10 $ cat << EOF >> $HGRCPATH
11 > [server]
12 > bundle2.stream = no
13 > EOF
14 #endif
15
16 Initialize repository
17
18 $ hg init server
19 $ cd server
20 $ sh $TESTDIR/testlib/stream_clone_setup.sh
21 adding 00changelog-ab349180a0405010.nd
22 adding 00changelog.d
23 adding 00changelog.i
24 adding 00changelog.n
25 adding 00manifest.d
26 adding 00manifest.i
27 adding container/isam-build-centos7/bazel-coverage-generator-sandboxfs-compatibility-0758e3e4f6057904d44399bd666faba9e7f40686.patch
28 adding data/foo.d
29 adding data/foo.i
30 adding data/foo.n
31 adding data/undo.babar
32 adding data/undo.d
33 adding data/undo.foo.d
34 adding data/undo.foo.i
35 adding data/undo.foo.n
36 adding data/undo.i
37 adding data/undo.n
38 adding data/undo.py
39 adding foo.d
40 adding foo.i
41 adding foo.n
42 adding meta/foo.d
43 adding meta/foo.i
44 adding meta/foo.n
45 adding meta/undo.babar
46 adding meta/undo.d
47 adding meta/undo.foo.d
48 adding meta/undo.foo.i
49 adding meta/undo.foo.n
50 adding meta/undo.i
51 adding meta/undo.n
52 adding meta/undo.py
53 adding savanah/foo.d
54 adding savanah/foo.i
55 adding savanah/foo.n
56 adding savanah/undo.babar
57 adding savanah/undo.d
58 adding savanah/undo.foo.d
59 adding savanah/undo.foo.i
60 adding savanah/undo.foo.n
61 adding savanah/undo.i
62 adding savanah/undo.n
63 adding savanah/undo.py
64 adding store/C\xc3\xa9lesteVille_is_a_Capital_City (esc)
65 adding store/foo.d
66 adding store/foo.i
67 adding store/foo.n
68 adding store/undo.babar
69 adding store/undo.d
70 adding store/undo.foo.d
71 adding store/undo.foo.i
72 adding store/undo.foo.n
73 adding store/undo.i
74 adding store/undo.n
75 adding store/undo.py
76 adding undo.babar
77 adding undo.d
78 adding undo.foo.d
79 adding undo.foo.i
80 adding undo.foo.n
81 adding undo.i
82 adding undo.n
83 adding undo.py
84 $ cd ..
85
86
87 Test streaming from/to repository without a store:
88 ==================================================
89
90 $ hg clone --pull --config format.usestore=no server server-no-store
91 requesting all changes
92 adding changesets
93 adding manifests
94 adding file changes
95 added 3 changesets with 1088 changes to 1088 files
96 new changesets 96ee1d7354c4:5223b5e3265f
97 updating to branch default
98 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved
99 $ hg verify -R server-no-store
100 checking changesets
101 checking manifests
102 crosschecking files in changesets and manifests
103 checking files
104 checked 3 changesets with 1088 changes to 1088 files
105 $ hg -R server serve -p $HGPORT -d --pid-file=hg-1.pid --error errors-1.txt
106 $ cat hg-1.pid > $DAEMON_PIDS
107 $ hg -R server-no-store serve -p $HGPORT2 -d --pid-file=hg-2.pid --error errors-2.txt
108 $ cat hg-2.pid >> $DAEMON_PIDS
109 $ hg debugrequires -R server | grep store
110 store
111 $ hg debugrequires -R server-no-store | grep store
112 [1]
113
114 store no-store cloning
115
116 $ hg clone --quiet --stream -U http://localhost:$HGPORT clone-remove-store --config format.usestore=no
117 $ cat errors-1.txt
118 $ hg -R clone-remove-store verify
119 checking changesets
120 checking manifests
121 crosschecking files in changesets and manifests
122 checking files
123 checked 3 changesets with 1088 changes to 1088 files
124 $ hg debugrequires -R clone-remove-store | grep store
125 [1]
126
127
128 no-store store cloning
129
130 $ hg clone --quiet --stream -U http://localhost:$HGPORT2 clone-add-store --config format.usestore=yes
131 $ cat errors-2.txt
132 $ hg -R clone-add-store verify
133 checking changesets
134 checking manifests
135 crosschecking files in changesets and manifests
136 checking files
137 checked 3 changesets with 1088 changes to 1088 files
138 $ hg debugrequires -R clone-add-store | grep store
139 store
140
141
142 $ killdaemons.py
143
144
145 Test streaming from/to repository without a fncache
146 ===================================================
147
148 $ rm hg-*.pid errors-*.txt
149 $ hg clone --pull --config format.usefncache=no server server-no-fncache
150 requesting all changes
151 adding changesets
152 adding manifests
153 adding file changes
154 added 3 changesets with 1088 changes to 1088 files
155 new changesets 96ee1d7354c4:5223b5e3265f
156 updating to branch default
157 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved
158 $ hg verify -R server-no-fncache
159 checking changesets
160 checking manifests
161 crosschecking files in changesets and manifests
162 checking files
163 checked 3 changesets with 1088 changes to 1088 files
164 $ hg -R server serve -p $HGPORT -d --pid-file=hg-1.pid --error errors-1.txt
165 $ cat hg-1.pid > $DAEMON_PIDS
166 $ hg -R server-no-fncache serve -p $HGPORT2 -d --pid-file=hg-2.pid --error errors-2.txt
167 $ cat hg-2.pid >> $DAEMON_PIDS
168 $ hg debugrequires -R server | grep fncache
169 fncache
170 $ hg debugrequires -R server-no-fncache | grep fncache
171 [1]
172
173 fncache no-fncache cloning
174
175 $ hg clone --quiet --stream -U http://localhost:$HGPORT clone-remove-fncache --config format.usefncache=no
176 $ cat errors-1.txt
177 $ hg -R clone-remove-fncache verify
178 checking changesets
179 checking manifests
180 crosschecking files in changesets and manifests
181 checking files
182 checked 3 changesets with 1088 changes to 1088 files
183 $ hg debugrequires -R clone-remove-fncache | grep fncache
184 [1]
185
186
187 no-fncache fncache cloning
188
189 $ hg clone --quiet --stream -U http://localhost:$HGPORT2 clone-add-fncache --config format.usefncache=yes
190 $ cat errors-2.txt
191 $ hg -R clone-add-fncache verify
192 checking changesets
193 checking manifests
194 crosschecking files in changesets and manifests
195 checking files
196 checked 3 changesets with 1088 changes to 1088 files
197 $ hg debugrequires -R clone-add-fncache | grep fncache
198 fncache
199
200
201 $ killdaemons.py
202
203
204
205 Test streaming from/to repository without a dotencode
206 ===================================================
207
208 $ rm hg-*.pid errors-*.txt
209 $ hg clone --pull --config format.dotencode=no server server-no-dotencode
210 requesting all changes
211 adding changesets
212 adding manifests
213 adding file changes
214 added 3 changesets with 1088 changes to 1088 files
215 new changesets 96ee1d7354c4:5223b5e3265f
216 updating to branch default
217 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved
218 $ hg verify -R server-no-dotencode
219 checking changesets
220 checking manifests
221 crosschecking files in changesets and manifests
222 checking files
223 checked 3 changesets with 1088 changes to 1088 files
224 $ hg -R server serve -p $HGPORT -d --pid-file=hg-1.pid --error errors-1.txt
225 $ cat hg-1.pid > $DAEMON_PIDS
226 $ hg -R server-no-dotencode serve -p $HGPORT2 -d --pid-file=hg-2.pid --error errors-2.txt
227 $ cat hg-2.pid >> $DAEMON_PIDS
228 $ hg debugrequires -R server | grep dotencode
229 dotencode
230 $ hg debugrequires -R server-no-dotencode | grep dotencode
231 [1]
232
233 dotencode no-dotencode cloning
234
235 $ hg clone --quiet --stream -U http://localhost:$HGPORT clone-remove-dotencode --config format.dotencode=no
236 $ cat errors-1.txt
237 $ hg -R clone-remove-dotencode verify
238 checking changesets
239 checking manifests
240 crosschecking files in changesets and manifests
241 checking files
242 checked 3 changesets with 1088 changes to 1088 files
243 $ hg debugrequires -R clone-remove-dotencode | grep dotencode
244 [1]
245
246
247 no-dotencode dotencode cloning
248
249 $ hg clone --quiet --stream -U http://localhost:$HGPORT2 clone-add-dotencode --config format.dotencode=yes
250 $ cat errors-2.txt
251 $ hg -R clone-add-dotencode verify
252 checking changesets
253 checking manifests
254 crosschecking files in changesets and manifests
255 checking files
256 checked 3 changesets with 1088 changes to 1088 files
257 $ hg debugrequires -R clone-add-dotencode | grep dotencode
258 dotencode
259
260
261 $ killdaemons.py
262
263 Cloning from a share
264 --------------------
265
266 We should be able to clone from a "share" repository, it will use the source store for streaming.
267
268 The resulting clone should not use share.
269
270 $ rm hg-*.pid errors-*.txt
271 $ hg share --config extensions.share= server server-share -U
272 $ hg -R server-share serve -p $HGPORT -d --pid-file=hg-1.pid --error errors-1.txt
273 $ cat hg-1.pid > $DAEMON_PIDS
274
275 $ hg clone --quiet --stream -U http://localhost:$HGPORT clone-from-share
276 $ hg -R clone-from-share verify
277 checking changesets
278 checking manifests
279 crosschecking files in changesets and manifests
280 checking files
281 checked 3 changesets with 1088 changes to 1088 files
282 $ hg debugrequires -R clone-from-share | grep share
283 [1]
284
285 $ killdaemons.py
@@ -0,0 +1,97 b''
1 # setup some files and commit for a good stream clone testing.
2
3 touch foo
4 hg -q commit -A -m initial
5
6 python3 << EOF
7 for i in range(1024):
8 with open(str(i), 'wb') as fh:
9 fh.write(b"%d" % i) and None
10 EOF
11 hg -q commit -A -m 'add a lot of files'
12
13 # (the status call is to check for issue5130)
14
15 hg st
16
17 # add files with "tricky" name:
18
19 echo foo > 00changelog.i
20 echo foo > 00changelog.d
21 echo foo > 00changelog.n
22 echo foo > 00changelog-ab349180a0405010.nd
23 echo foo > 00manifest.i
24 echo foo > 00manifest.d
25 echo foo > foo.i
26 echo foo > foo.d
27 echo foo > foo.n
28 echo foo > undo.py
29 echo foo > undo.i
30 echo foo > undo.d
31 echo foo > undo.n
32 echo foo > undo.foo.i
33 echo foo > undo.foo.d
34 echo foo > undo.foo.n
35 echo foo > undo.babar
36 mkdir savanah
37 echo foo > savanah/foo.i
38 echo foo > savanah/foo.d
39 echo foo > savanah/foo.n
40 echo foo > savanah/undo.py
41 echo foo > savanah/undo.i
42 echo foo > savanah/undo.d
43 echo foo > savanah/undo.n
44 echo foo > savanah/undo.foo.i
45 echo foo > savanah/undo.foo.d
46 echo foo > savanah/undo.foo.n
47 echo foo > savanah/undo.babar
48 mkdir data
49 echo foo > data/foo.i
50 echo foo > data/foo.d
51 echo foo > data/foo.n
52 echo foo > data/undo.py
53 echo foo > data/undo.i
54 echo foo > data/undo.d
55 echo foo > data/undo.n
56 echo foo > data/undo.foo.i
57 echo foo > data/undo.foo.d
58 echo foo > data/undo.foo.n
59 echo foo > data/undo.babar
60 mkdir meta
61 echo foo > meta/foo.i
62 echo foo > meta/foo.d
63 echo foo > meta/foo.n
64 echo foo > meta/undo.py
65 echo foo > meta/undo.i
66 echo foo > meta/undo.d
67 echo foo > meta/undo.n
68 echo foo > meta/undo.foo.i
69 echo foo > meta/undo.foo.d
70 echo foo > meta/undo.foo.n
71 echo foo > meta/undo.babar
72 mkdir store
73 echo foo > store/foo.i
74 echo foo > store/foo.d
75 echo foo > store/foo.n
76 echo foo > store/undo.py
77 echo foo > store/undo.i
78 echo foo > store/undo.d
79 echo foo > store/undo.n
80 echo foo > store/undo.foo.i
81 echo foo > store/undo.foo.d
82 echo foo > store/undo.foo.n
83 echo foo > store/undo.babar
84
85 # Name with special characters
86
87 echo foo > store/CélesteVille_is_a_Capital_City
88
89 # name causing issue6581
90
91 mkdir -p container/isam-build-centos7/
92 touch container/isam-build-centos7/bazel-coverage-generator-sandboxfs-compatibility-0758e3e4f6057904d44399bd666faba9e7f40686.patch
93
94 # Add all that
95
96 hg add .
97 hg ci -m 'add files with "tricky" name'
@@ -10,98 +10,10 b''
10 #endif
10 #endif
11
11
12 Initialize repository
12 Initialize repository
13 the status call is to check for issue5130
14
13
15 $ hg init server
14 $ hg init server
16 $ cd server
15 $ cd server
17 $ touch foo
16 $ sh $TESTDIR/testlib/stream_clone_setup.sh
18 $ hg -q commit -A -m initial
19 >>> for i in range(1024):
20 ... with open(str(i), 'wb') as fh:
21 ... fh.write(b"%d" % i) and None
22 $ hg -q commit -A -m 'add a lot of files'
23 $ hg st
24
25 add files with "tricky" name:
26
27 $ echo foo > 00changelog.i
28 $ echo foo > 00changelog.d
29 $ echo foo > 00changelog.n
30 $ echo foo > 00changelog-ab349180a0405010.nd
31 $ echo foo > 00manifest.i
32 $ echo foo > 00manifest.d
33 $ echo foo > foo.i
34 $ echo foo > foo.d
35 $ echo foo > foo.n
36 $ echo foo > undo.py
37 $ echo foo > undo.i
38 $ echo foo > undo.d
39 $ echo foo > undo.n
40 $ echo foo > undo.foo.i
41 $ echo foo > undo.foo.d
42 $ echo foo > undo.foo.n
43 $ echo foo > undo.babar
44 $ mkdir savanah
45 $ echo foo > savanah/foo.i
46 $ echo foo > savanah/foo.d
47 $ echo foo > savanah/foo.n
48 $ echo foo > savanah/undo.py
49 $ echo foo > savanah/undo.i
50 $ echo foo > savanah/undo.d
51 $ echo foo > savanah/undo.n
52 $ echo foo > savanah/undo.foo.i
53 $ echo foo > savanah/undo.foo.d
54 $ echo foo > savanah/undo.foo.n
55 $ echo foo > savanah/undo.babar
56 $ mkdir data
57 $ echo foo > data/foo.i
58 $ echo foo > data/foo.d
59 $ echo foo > data/foo.n
60 $ echo foo > data/undo.py
61 $ echo foo > data/undo.i
62 $ echo foo > data/undo.d
63 $ echo foo > data/undo.n
64 $ echo foo > data/undo.foo.i
65 $ echo foo > data/undo.foo.d
66 $ echo foo > data/undo.foo.n
67 $ echo foo > data/undo.babar
68 $ mkdir meta
69 $ echo foo > meta/foo.i
70 $ echo foo > meta/foo.d
71 $ echo foo > meta/foo.n
72 $ echo foo > meta/undo.py
73 $ echo foo > meta/undo.i
74 $ echo foo > meta/undo.d
75 $ echo foo > meta/undo.n
76 $ echo foo > meta/undo.foo.i
77 $ echo foo > meta/undo.foo.d
78 $ echo foo > meta/undo.foo.n
79 $ echo foo > meta/undo.babar
80 $ mkdir store
81 $ echo foo > store/foo.i
82 $ echo foo > store/foo.d
83 $ echo foo > store/foo.n
84 $ echo foo > store/undo.py
85 $ echo foo > store/undo.i
86 $ echo foo > store/undo.d
87 $ echo foo > store/undo.n
88 $ echo foo > store/undo.foo.i
89 $ echo foo > store/undo.foo.d
90 $ echo foo > store/undo.foo.n
91 $ echo foo > store/undo.babar
92
93 Name with special characters
94
95 $ echo foo > store/CélesteVille_is_a_Capital_City
96
97 name causing issue6581
98
99 $ mkdir -p container/isam-build-centos7/
100 $ touch container/isam-build-centos7/bazel-coverage-generator-sandboxfs-compatibility-0758e3e4f6057904d44399bd666faba9e7f40686.patch
101
102 Add all that
103
104 $ hg add .
105 adding 00changelog-ab349180a0405010.nd
17 adding 00changelog-ab349180a0405010.nd
106 adding 00changelog.d
18 adding 00changelog.d
107 adding 00changelog.i
19 adding 00changelog.i
@@ -165,7 +77,7 b' Add all that'
165 adding undo.i
77 adding undo.i
166 adding undo.n
78 adding undo.n
167 adding undo.py
79 adding undo.py
168 $ hg ci -m 'add files with "tricky" name'
80
169 $ hg --config server.uncompressed=false serve -p $HGPORT -d --pid-file=hg.pid
81 $ hg --config server.uncompressed=false serve -p $HGPORT -d --pid-file=hg.pid
170 $ cat hg.pid > $DAEMON_PIDS
82 $ cat hg.pid > $DAEMON_PIDS
171 $ cd ..
83 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now