##// 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
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
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'
@@ -1,907 +1,819
1 1 #require serve no-reposimplestore no-chg
2 2
3 3 #testcases stream-legacy stream-bundle2
4 4
5 5 #if stream-legacy
6 6 $ cat << EOF >> $HGRCPATH
7 7 > [server]
8 8 > bundle2.stream = no
9 9 > EOF
10 10 #endif
11 11
12 12 Initialize repository
13 the status call is to check for issue5130
14 13
15 14 $ hg init server
16 15 $ cd server
17 $ touch foo
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 .
16 $ sh $TESTDIR/testlib/stream_clone_setup.sh
105 17 adding 00changelog-ab349180a0405010.nd
106 18 adding 00changelog.d
107 19 adding 00changelog.i
108 20 adding 00changelog.n
109 21 adding 00manifest.d
110 22 adding 00manifest.i
111 23 adding container/isam-build-centos7/bazel-coverage-generator-sandboxfs-compatibility-0758e3e4f6057904d44399bd666faba9e7f40686.patch
112 24 adding data/foo.d
113 25 adding data/foo.i
114 26 adding data/foo.n
115 27 adding data/undo.babar
116 28 adding data/undo.d
117 29 adding data/undo.foo.d
118 30 adding data/undo.foo.i
119 31 adding data/undo.foo.n
120 32 adding data/undo.i
121 33 adding data/undo.n
122 34 adding data/undo.py
123 35 adding foo.d
124 36 adding foo.i
125 37 adding foo.n
126 38 adding meta/foo.d
127 39 adding meta/foo.i
128 40 adding meta/foo.n
129 41 adding meta/undo.babar
130 42 adding meta/undo.d
131 43 adding meta/undo.foo.d
132 44 adding meta/undo.foo.i
133 45 adding meta/undo.foo.n
134 46 adding meta/undo.i
135 47 adding meta/undo.n
136 48 adding meta/undo.py
137 49 adding savanah/foo.d
138 50 adding savanah/foo.i
139 51 adding savanah/foo.n
140 52 adding savanah/undo.babar
141 53 adding savanah/undo.d
142 54 adding savanah/undo.foo.d
143 55 adding savanah/undo.foo.i
144 56 adding savanah/undo.foo.n
145 57 adding savanah/undo.i
146 58 adding savanah/undo.n
147 59 adding savanah/undo.py
148 60 adding store/C\xc3\xa9lesteVille_is_a_Capital_City (esc)
149 61 adding store/foo.d
150 62 adding store/foo.i
151 63 adding store/foo.n
152 64 adding store/undo.babar
153 65 adding store/undo.d
154 66 adding store/undo.foo.d
155 67 adding store/undo.foo.i
156 68 adding store/undo.foo.n
157 69 adding store/undo.i
158 70 adding store/undo.n
159 71 adding store/undo.py
160 72 adding undo.babar
161 73 adding undo.d
162 74 adding undo.foo.d
163 75 adding undo.foo.i
164 76 adding undo.foo.n
165 77 adding undo.i
166 78 adding undo.n
167 79 adding undo.py
168 $ hg ci -m 'add files with "tricky" name'
80
169 81 $ hg --config server.uncompressed=false serve -p $HGPORT -d --pid-file=hg.pid
170 82 $ cat hg.pid > $DAEMON_PIDS
171 83 $ cd ..
172 84
173 85 Check local clone
174 86 ==================
175 87
176 88 The logic is close enough of uncompressed.
177 89 This is present here to reuse the testing around file with "special" names.
178 90
179 91 $ hg clone server local-clone
180 92 updating to branch default
181 93 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved
182 94
183 95 Check that the clone went well
184 96
185 97 $ hg verify -R local-clone
186 98 checking changesets
187 99 checking manifests
188 100 crosschecking files in changesets and manifests
189 101 checking files
190 102 checked 3 changesets with 1088 changes to 1088 files
191 103
192 104 Check uncompressed
193 105 ==================
194 106
195 107 Cannot stream clone when server.uncompressed is set
196 108
197 109 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=stream_out'
198 110 200 Script output follows
199 111
200 112 1
201 113
202 114 #if stream-legacy
203 115 $ hg debugcapabilities http://localhost:$HGPORT
204 116 Main capabilities:
205 117 batch
206 118 branchmap
207 119 $USUAL_BUNDLE2_CAPS_SERVER$
208 120 changegroupsubset
209 121 compression=$BUNDLE2_COMPRESSIONS$
210 122 getbundle
211 123 httpheader=1024
212 124 httpmediatype=0.1rx,0.1tx,0.2tx
213 125 known
214 126 lookup
215 127 pushkey
216 128 unbundle=HG10GZ,HG10BZ,HG10UN
217 129 unbundlehash
218 130 Bundle2 capabilities:
219 131 HG20
220 132 bookmarks
221 133 changegroup
222 134 01
223 135 02
224 136 checkheads
225 137 related
226 138 digests
227 139 md5
228 140 sha1
229 141 sha512
230 142 error
231 143 abort
232 144 unsupportedcontent
233 145 pushraced
234 146 pushkey
235 147 hgtagsfnodes
236 148 listkeys
237 149 phases
238 150 heads
239 151 pushkey
240 152 remote-changegroup
241 153 http
242 154 https
243 155
244 156 $ hg clone --stream -U http://localhost:$HGPORT server-disabled
245 157 warning: stream clone requested but server has them disabled
246 158 requesting all changes
247 159 adding changesets
248 160 adding manifests
249 161 adding file changes
250 162 added 3 changesets with 1088 changes to 1088 files
251 163 new changesets 96ee1d7354c4:5223b5e3265f
252 164
253 165 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=getbundle' content-type --bodyfile body --hgproto 0.2 --requestheader "x-hgarg-1=bundlecaps=HG20%2Cbundle2%3DHG20%250Abookmarks%250Achangegroup%253D01%252C02%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Aphases%253Dheads%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps&cg=0&common=0000000000000000000000000000000000000000&heads=c17445101a72edac06facd130d14808dfbd5c7c2&stream=1"
254 166 200 Script output follows
255 167 content-type: application/mercurial-0.2
256 168
257 169
258 170 $ f --size body --hexdump --bytes 100
259 171 body: size=232
260 172 0000: 04 6e 6f 6e 65 48 47 32 30 00 00 00 00 00 00 00 |.noneHG20.......|
261 173 0010: cf 0b 45 52 52 4f 52 3a 41 42 4f 52 54 00 00 00 |..ERROR:ABORT...|
262 174 0020: 00 01 01 07 3c 04 72 6d 65 73 73 61 67 65 73 74 |....<.rmessagest|
263 175 0030: 72 65 61 6d 20 64 61 74 61 20 72 65 71 75 65 73 |ream data reques|
264 176 0040: 74 65 64 20 62 75 74 20 73 65 72 76 65 72 20 64 |ted but server d|
265 177 0050: 6f 65 73 20 6e 6f 74 20 61 6c 6c 6f 77 20 74 68 |oes not allow th|
266 178 0060: 69 73 20 66 |is f|
267 179
268 180 #endif
269 181 #if stream-bundle2
270 182 $ hg debugcapabilities http://localhost:$HGPORT
271 183 Main capabilities:
272 184 batch
273 185 branchmap
274 186 $USUAL_BUNDLE2_CAPS_SERVER$
275 187 changegroupsubset
276 188 compression=$BUNDLE2_COMPRESSIONS$
277 189 getbundle
278 190 httpheader=1024
279 191 httpmediatype=0.1rx,0.1tx,0.2tx
280 192 known
281 193 lookup
282 194 pushkey
283 195 unbundle=HG10GZ,HG10BZ,HG10UN
284 196 unbundlehash
285 197 Bundle2 capabilities:
286 198 HG20
287 199 bookmarks
288 200 changegroup
289 201 01
290 202 02
291 203 checkheads
292 204 related
293 205 digests
294 206 md5
295 207 sha1
296 208 sha512
297 209 error
298 210 abort
299 211 unsupportedcontent
300 212 pushraced
301 213 pushkey
302 214 hgtagsfnodes
303 215 listkeys
304 216 phases
305 217 heads
306 218 pushkey
307 219 remote-changegroup
308 220 http
309 221 https
310 222
311 223 $ hg clone --stream -U http://localhost:$HGPORT server-disabled
312 224 warning: stream clone requested but server has them disabled
313 225 requesting all changes
314 226 adding changesets
315 227 adding manifests
316 228 adding file changes
317 229 added 3 changesets with 1088 changes to 1088 files
318 230 new changesets 96ee1d7354c4:5223b5e3265f
319 231
320 232 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=getbundle' content-type --bodyfile body --hgproto 0.2 --requestheader "x-hgarg-1=bundlecaps=HG20%2Cbundle2%3DHG20%250Abookmarks%250Achangegroup%253D01%252C02%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Aphases%253Dheads%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps&cg=0&common=0000000000000000000000000000000000000000&heads=c17445101a72edac06facd130d14808dfbd5c7c2&stream=1"
321 233 200 Script output follows
322 234 content-type: application/mercurial-0.2
323 235
324 236
325 237 $ f --size body --hexdump --bytes 100
326 238 body: size=232
327 239 0000: 04 6e 6f 6e 65 48 47 32 30 00 00 00 00 00 00 00 |.noneHG20.......|
328 240 0010: cf 0b 45 52 52 4f 52 3a 41 42 4f 52 54 00 00 00 |..ERROR:ABORT...|
329 241 0020: 00 01 01 07 3c 04 72 6d 65 73 73 61 67 65 73 74 |....<.rmessagest|
330 242 0030: 72 65 61 6d 20 64 61 74 61 20 72 65 71 75 65 73 |ream data reques|
331 243 0040: 74 65 64 20 62 75 74 20 73 65 72 76 65 72 20 64 |ted but server d|
332 244 0050: 6f 65 73 20 6e 6f 74 20 61 6c 6c 6f 77 20 74 68 |oes not allow th|
333 245 0060: 69 73 20 66 |is f|
334 246
335 247 #endif
336 248
337 249 $ killdaemons.py
338 250 $ cd server
339 251 $ hg serve -p $HGPORT -d --pid-file=hg.pid --error errors.txt
340 252 $ cat hg.pid > $DAEMON_PIDS
341 253 $ cd ..
342 254
343 255 Basic clone
344 256
345 257 #if stream-legacy
346 258 $ hg clone --stream -U http://localhost:$HGPORT clone1
347 259 streaming all changes
348 260 1090 files to transfer, 102 KB of data (no-zstd !)
349 261 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
350 262 1090 files to transfer, 98.8 KB of data (zstd !)
351 263 transferred 98.8 KB in * seconds (* */sec) (glob) (zstd !)
352 264 searching for changes
353 265 no changes found
354 266 $ cat server/errors.txt
355 267 #endif
356 268 #if stream-bundle2
357 269 $ hg clone --stream -U http://localhost:$HGPORT clone1
358 270 streaming all changes
359 271 1093 files to transfer, 102 KB of data (no-zstd !)
360 272 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
361 273 1093 files to transfer, 98.9 KB of data (zstd !)
362 274 transferred 98.9 KB in * seconds (* */sec) (glob) (zstd !)
363 275
364 276 $ ls -1 clone1/.hg/cache
365 277 branch2-base
366 278 branch2-immutable
367 279 branch2-served
368 280 branch2-served.hidden
369 281 branch2-visible
370 282 branch2-visible-hidden
371 283 rbc-names-v1
372 284 rbc-revs-v1
373 285 tags2
374 286 tags2-served
375 287 $ cat server/errors.txt
376 288 #endif
377 289
378 290 getbundle requests with stream=1 are uncompressed
379 291
380 292 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=getbundle' content-type --bodyfile body --hgproto '0.1 0.2 comp=zlib,none' --requestheader "x-hgarg-1=bundlecaps=HG20%2Cbundle2%3DHG20%250Abookmarks%250Achangegroup%253D01%252C02%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Aphases%253Dheads%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps&cg=0&common=0000000000000000000000000000000000000000&heads=c17445101a72edac06facd130d14808dfbd5c7c2&stream=1"
381 293 200 Script output follows
382 294 content-type: application/mercurial-0.2
383 295
384 296
385 297 #if no-zstd no-rust
386 298 $ f --size --hex --bytes 256 body
387 299 body: size=119153
388 300 0000: 04 6e 6f 6e 65 48 47 32 30 00 00 00 00 00 00 00 |.noneHG20.......|
389 301 0010: 80 07 53 54 52 45 41 4d 32 00 00 00 00 03 00 09 |..STREAM2.......|
390 302 0020: 06 09 04 0c 44 62 79 74 65 63 6f 75 6e 74 31 30 |....Dbytecount10|
391 303 0030: 34 31 31 35 66 69 6c 65 63 6f 75 6e 74 31 30 39 |4115filecount109|
392 304 0040: 33 72 65 71 75 69 72 65 6d 65 6e 74 73 64 6f 74 |3requirementsdot|
393 305 0050: 65 6e 63 6f 64 65 25 32 43 66 6e 63 61 63 68 65 |encode%2Cfncache|
394 306 0060: 25 32 43 67 65 6e 65 72 61 6c 64 65 6c 74 61 25 |%2Cgeneraldelta%|
395 307 0070: 32 43 72 65 76 6c 6f 67 76 31 25 32 43 73 70 61 |2Crevlogv1%2Cspa|
396 308 0080: 72 73 65 72 65 76 6c 6f 67 25 32 43 73 74 6f 72 |rserevlog%2Cstor|
397 309 0090: 65 00 00 80 00 73 08 42 64 61 74 61 2f 30 2e 69 |e....s.Bdata/0.i|
398 310 00a0: 00 03 00 01 00 00 00 00 00 00 00 02 00 00 00 01 |................|
399 311 00b0: 00 00 00 00 00 00 00 01 ff ff ff ff ff ff ff ff |................|
400 312 00c0: 80 29 63 a0 49 d3 23 87 bf ce fe 56 67 92 67 2c |.)c.I.#....Vg.g,|
401 313 00d0: 69 d1 ec 39 00 00 00 00 00 00 00 00 00 00 00 00 |i..9............|
402 314 00e0: 75 30 73 26 45 64 61 74 61 2f 30 30 63 68 61 6e |u0s&Edata/00chan|
403 315 00f0: 67 65 6c 6f 67 2d 61 62 33 34 39 31 38 30 61 30 |gelog-ab349180a0|
404 316 #endif
405 317 #if zstd no-rust
406 318 $ f --size --hex --bytes 256 body
407 319 body: size=116340 (no-bigendian !)
408 320 body: size=116335 (bigendian !)
409 321 0000: 04 6e 6f 6e 65 48 47 32 30 00 00 00 00 00 00 00 |.noneHG20.......|
410 322 0010: 9a 07 53 54 52 45 41 4d 32 00 00 00 00 03 00 09 |..STREAM2.......|
411 323 0020: 06 09 04 0c 5e 62 79 74 65 63 6f 75 6e 74 31 30 |....^bytecount10|
412 324 0030: 31 32 37 36 66 69 6c 65 63 6f 75 6e 74 31 30 39 |1276filecount109| (no-bigendian !)
413 325 0030: 31 32 37 31 66 69 6c 65 63 6f 75 6e 74 31 30 39 |1271filecount109| (bigendian !)
414 326 0040: 33 72 65 71 75 69 72 65 6d 65 6e 74 73 64 6f 74 |3requirementsdot|
415 327 0050: 65 6e 63 6f 64 65 25 32 43 66 6e 63 61 63 68 65 |encode%2Cfncache|
416 328 0060: 25 32 43 67 65 6e 65 72 61 6c 64 65 6c 74 61 25 |%2Cgeneraldelta%|
417 329 0070: 32 43 72 65 76 6c 6f 67 2d 63 6f 6d 70 72 65 73 |2Crevlog-compres|
418 330 0080: 73 69 6f 6e 2d 7a 73 74 64 25 32 43 72 65 76 6c |sion-zstd%2Crevl|
419 331 0090: 6f 67 76 31 25 32 43 73 70 61 72 73 65 72 65 76 |ogv1%2Csparserev|
420 332 00a0: 6c 6f 67 25 32 43 73 74 6f 72 65 00 00 80 00 73 |log%2Cstore....s|
421 333 00b0: 08 42 64 61 74 61 2f 30 2e 69 00 03 00 01 00 00 |.Bdata/0.i......|
422 334 00c0: 00 00 00 00 00 02 00 00 00 01 00 00 00 00 00 00 |................|
423 335 00d0: 00 01 ff ff ff ff ff ff ff ff 80 29 63 a0 49 d3 |...........)c.I.|
424 336 00e0: 23 87 bf ce fe 56 67 92 67 2c 69 d1 ec 39 00 00 |#....Vg.g,i..9..|
425 337 00f0: 00 00 00 00 00 00 00 00 00 00 75 30 73 26 45 64 |..........u0s&Ed|
426 338 #endif
427 339 #if zstd rust no-dirstate-v2
428 340 $ f --size --hex --bytes 256 body
429 341 body: size=116361
430 342 0000: 04 6e 6f 6e 65 48 47 32 30 00 00 00 00 00 00 00 |.noneHG20.......|
431 343 0010: af 07 53 54 52 45 41 4d 32 00 00 00 00 03 00 09 |..STREAM2.......|
432 344 0020: 06 09 04 0c 73 62 79 74 65 63 6f 75 6e 74 31 30 |....sbytecount10|
433 345 0030: 31 32 37 36 66 69 6c 65 63 6f 75 6e 74 31 30 39 |1276filecount109|
434 346 0040: 33 72 65 71 75 69 72 65 6d 65 6e 74 73 64 6f 74 |3requirementsdot|
435 347 0050: 65 6e 63 6f 64 65 25 32 43 66 6e 63 61 63 68 65 |encode%2Cfncache|
436 348 0060: 25 32 43 67 65 6e 65 72 61 6c 64 65 6c 74 61 25 |%2Cgeneraldelta%|
437 349 0070: 32 43 70 65 72 73 69 73 74 65 6e 74 2d 6e 6f 64 |2Cpersistent-nod|
438 350 0080: 65 6d 61 70 25 32 43 72 65 76 6c 6f 67 2d 63 6f |emap%2Crevlog-co|
439 351 0090: 6d 70 72 65 73 73 69 6f 6e 2d 7a 73 74 64 25 32 |mpression-zstd%2|
440 352 00a0: 43 72 65 76 6c 6f 67 76 31 25 32 43 73 70 61 72 |Crevlogv1%2Cspar|
441 353 00b0: 73 65 72 65 76 6c 6f 67 25 32 43 73 74 6f 72 65 |serevlog%2Cstore|
442 354 00c0: 00 00 80 00 73 08 42 64 61 74 61 2f 30 2e 69 00 |....s.Bdata/0.i.|
443 355 00d0: 03 00 01 00 00 00 00 00 00 00 02 00 00 00 01 00 |................|
444 356 00e0: 00 00 00 00 00 00 01 ff ff ff ff ff ff ff ff 80 |................|
445 357 00f0: 29 63 a0 49 d3 23 87 bf ce fe 56 67 92 67 2c 69 |)c.I.#....Vg.g,i|
446 358 #endif
447 359 #if zstd dirstate-v2
448 360 $ f --size --hex --bytes 256 body
449 361 body: size=109549
450 362 0000: 04 6e 6f 6e 65 48 47 32 30 00 00 00 00 00 00 00 |.noneHG20.......|
451 363 0010: c0 07 53 54 52 45 41 4d 32 00 00 00 00 03 00 09 |..STREAM2.......|
452 364 0020: 05 09 04 0c 85 62 79 74 65 63 6f 75 6e 74 39 35 |.....bytecount95|
453 365 0030: 38 39 37 66 69 6c 65 63 6f 75 6e 74 31 30 33 30 |897filecount1030|
454 366 0040: 72 65 71 75 69 72 65 6d 65 6e 74 73 64 6f 74 65 |requirementsdote|
455 367 0050: 6e 63 6f 64 65 25 32 43 65 78 70 2d 64 69 72 73 |ncode%2Cexp-dirs|
456 368 0060: 74 61 74 65 2d 76 32 25 32 43 66 6e 63 61 63 68 |tate-v2%2Cfncach|
457 369 0070: 65 25 32 43 67 65 6e 65 72 61 6c 64 65 6c 74 61 |e%2Cgeneraldelta|
458 370 0080: 25 32 43 70 65 72 73 69 73 74 65 6e 74 2d 6e 6f |%2Cpersistent-no|
459 371 0090: 64 65 6d 61 70 25 32 43 72 65 76 6c 6f 67 2d 63 |demap%2Crevlog-c|
460 372 00a0: 6f 6d 70 72 65 73 73 69 6f 6e 2d 7a 73 74 64 25 |ompression-zstd%|
461 373 00b0: 32 43 72 65 76 6c 6f 67 76 31 25 32 43 73 70 61 |2Crevlogv1%2Cspa|
462 374 00c0: 72 73 65 72 65 76 6c 6f 67 25 32 43 73 74 6f 72 |rserevlog%2Cstor|
463 375 00d0: 65 00 00 80 00 73 08 42 64 61 74 61 2f 30 2e 69 |e....s.Bdata/0.i|
464 376 00e0: 00 03 00 01 00 00 00 00 00 00 00 02 00 00 00 01 |................|
465 377 00f0: 00 00 00 00 00 00 00 01 ff ff ff ff ff ff ff ff |................|
466 378 #endif
467 379
468 380 --uncompressed is an alias to --stream
469 381
470 382 #if stream-legacy
471 383 $ hg clone --uncompressed -U http://localhost:$HGPORT clone1-uncompressed
472 384 streaming all changes
473 385 1090 files to transfer, 102 KB of data (no-zstd !)
474 386 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
475 387 1090 files to transfer, 98.8 KB of data (zstd !)
476 388 transferred 98.8 KB in * seconds (* */sec) (glob) (zstd !)
477 389 searching for changes
478 390 no changes found
479 391 #endif
480 392 #if stream-bundle2
481 393 $ hg clone --uncompressed -U http://localhost:$HGPORT clone1-uncompressed
482 394 streaming all changes
483 395 1093 files to transfer, 102 KB of data (no-zstd !)
484 396 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
485 397 1093 files to transfer, 98.9 KB of data (zstd !)
486 398 transferred 98.9 KB in * seconds (* */sec) (glob) (zstd !)
487 399 #endif
488 400
489 401 Clone with background file closing enabled
490 402
491 403 #if stream-legacy
492 404 $ hg --debug --config worker.backgroundclose=true --config worker.backgroundcloseminfilecount=1 clone --stream -U http://localhost:$HGPORT clone-background | grep -v adding
493 405 using http://localhost:$HGPORT/
494 406 sending capabilities command
495 407 sending branchmap command
496 408 streaming all changes
497 409 sending stream_out command
498 410 1090 files to transfer, 102 KB of data (no-zstd !)
499 411 1090 files to transfer, 98.8 KB of data (zstd !)
500 412 starting 4 threads for background file closing
501 413 updating the branch cache
502 414 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
503 415 transferred 98.8 KB in * seconds (* */sec) (glob) (zstd !)
504 416 query 1; heads
505 417 sending batch command
506 418 searching for changes
507 419 all remote heads known locally
508 420 no changes found
509 421 sending getbundle command
510 422 bundle2-input-bundle: with-transaction
511 423 bundle2-input-part: "listkeys" (params: 1 mandatory) supported
512 424 bundle2-input-part: "phase-heads" supported
513 425 bundle2-input-part: total payload size 24
514 426 bundle2-input-bundle: 2 parts total
515 427 checking for updated bookmarks
516 428 updating the branch cache
517 429 (sent 5 HTTP requests and * bytes; received * bytes in responses) (glob)
518 430 #endif
519 431 #if stream-bundle2
520 432 $ hg --debug --config worker.backgroundclose=true --config worker.backgroundcloseminfilecount=1 clone --stream -U http://localhost:$HGPORT clone-background | grep -v adding
521 433 using http://localhost:$HGPORT/
522 434 sending capabilities command
523 435 query 1; heads
524 436 sending batch command
525 437 streaming all changes
526 438 sending getbundle command
527 439 bundle2-input-bundle: with-transaction
528 440 bundle2-input-part: "stream2" (params: 3 mandatory) supported
529 441 applying stream bundle
530 442 1093 files to transfer, 102 KB of data (no-zstd !)
531 443 1093 files to transfer, 98.9 KB of data (zstd !)
532 444 starting 4 threads for background file closing
533 445 starting 4 threads for background file closing
534 446 updating the branch cache
535 447 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
536 448 bundle2-input-part: total payload size 118984 (no-zstd !)
537 449 transferred 98.9 KB in * seconds (* */sec) (glob) (zstd !)
538 450 bundle2-input-part: total payload size 116145 (zstd no-bigendian !)
539 451 bundle2-input-part: total payload size 116140 (zstd bigendian !)
540 452 bundle2-input-part: "listkeys" (params: 1 mandatory) supported
541 453 bundle2-input-bundle: 2 parts total
542 454 checking for updated bookmarks
543 455 updating the branch cache
544 456 (sent 3 HTTP requests and * bytes; received * bytes in responses) (glob)
545 457 #endif
546 458
547 459 Cannot stream clone when there are secret changesets
548 460
549 461 $ hg -R server phase --force --secret -r tip
550 462 $ hg clone --stream -U http://localhost:$HGPORT secret-denied
551 463 warning: stream clone requested but server has them disabled
552 464 requesting all changes
553 465 adding changesets
554 466 adding manifests
555 467 adding file changes
556 468 added 2 changesets with 1025 changes to 1025 files
557 469 new changesets 96ee1d7354c4:c17445101a72
558 470
559 471 $ killdaemons.py
560 472
561 473 Streaming of secrets can be overridden by server config
562 474
563 475 $ cd server
564 476 $ hg serve --config server.uncompressedallowsecret=true -p $HGPORT -d --pid-file=hg.pid
565 477 $ cat hg.pid > $DAEMON_PIDS
566 478 $ cd ..
567 479
568 480 #if stream-legacy
569 481 $ hg clone --stream -U http://localhost:$HGPORT secret-allowed
570 482 streaming all changes
571 483 1090 files to transfer, 102 KB of data (no-zstd !)
572 484 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
573 485 1090 files to transfer, 98.8 KB of data (zstd !)
574 486 transferred 98.8 KB in * seconds (* */sec) (glob) (zstd !)
575 487 searching for changes
576 488 no changes found
577 489 #endif
578 490 #if stream-bundle2
579 491 $ hg clone --stream -U http://localhost:$HGPORT secret-allowed
580 492 streaming all changes
581 493 1093 files to transfer, 102 KB of data (no-zstd !)
582 494 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
583 495 1093 files to transfer, 98.9 KB of data (zstd !)
584 496 transferred 98.9 KB in * seconds (* */sec) (glob) (zstd !)
585 497 #endif
586 498
587 499 $ killdaemons.py
588 500
589 501 Verify interaction between preferuncompressed and secret presence
590 502
591 503 $ cd server
592 504 $ hg serve --config server.preferuncompressed=true -p $HGPORT -d --pid-file=hg.pid
593 505 $ cat hg.pid > $DAEMON_PIDS
594 506 $ cd ..
595 507
596 508 $ hg clone -U http://localhost:$HGPORT preferuncompressed-secret
597 509 requesting all changes
598 510 adding changesets
599 511 adding manifests
600 512 adding file changes
601 513 added 2 changesets with 1025 changes to 1025 files
602 514 new changesets 96ee1d7354c4:c17445101a72
603 515
604 516 $ killdaemons.py
605 517
606 518 Clone not allowed when full bundles disabled and can't serve secrets
607 519
608 520 $ cd server
609 521 $ hg serve --config server.disablefullbundle=true -p $HGPORT -d --pid-file=hg.pid
610 522 $ cat hg.pid > $DAEMON_PIDS
611 523 $ cd ..
612 524
613 525 $ hg clone --stream http://localhost:$HGPORT secret-full-disabled
614 526 warning: stream clone requested but server has them disabled
615 527 requesting all changes
616 528 remote: abort: server has pull-based clones disabled
617 529 abort: pull failed on remote
618 530 (remove --pull if specified or upgrade Mercurial)
619 531 [100]
620 532
621 533 Local stream clone with secrets involved
622 534 (This is just a test over behavior: if you have access to the repo's files,
623 535 there is no security so it isn't important to prevent a clone here.)
624 536
625 537 $ hg clone -U --stream server local-secret
626 538 warning: stream clone requested but server has them disabled
627 539 requesting all changes
628 540 adding changesets
629 541 adding manifests
630 542 adding file changes
631 543 added 2 changesets with 1025 changes to 1025 files
632 544 new changesets 96ee1d7354c4:c17445101a72
633 545
634 546 Stream clone while repo is changing:
635 547
636 548 $ mkdir changing
637 549 $ cd changing
638 550
639 551 extension for delaying the server process so we reliably can modify the repo
640 552 while cloning
641 553
642 554 $ cat > stream_steps.py <<EOF
643 555 > import os
644 556 > import sys
645 557 > from mercurial import (
646 558 > encoding,
647 559 > extensions,
648 560 > streamclone,
649 561 > testing,
650 562 > )
651 563 > WALKED_FILE_1 = encoding.environ[b'HG_TEST_STREAM_WALKED_FILE_1']
652 564 > WALKED_FILE_2 = encoding.environ[b'HG_TEST_STREAM_WALKED_FILE_2']
653 565 >
654 566 > def _test_sync_point_walk_1(orig, repo):
655 567 > testing.write_file(WALKED_FILE_1)
656 568 >
657 569 > def _test_sync_point_walk_2(orig, repo):
658 570 > assert repo._currentlock(repo._lockref) is None
659 571 > testing.wait_file(WALKED_FILE_2)
660 572 >
661 573 > extensions.wrapfunction(
662 574 > streamclone,
663 575 > '_test_sync_point_walk_1',
664 576 > _test_sync_point_walk_1
665 577 > )
666 578 > extensions.wrapfunction(
667 579 > streamclone,
668 580 > '_test_sync_point_walk_2',
669 581 > _test_sync_point_walk_2
670 582 > )
671 583 > EOF
672 584
673 585 prepare repo with small and big file to cover both code paths in emitrevlogdata
674 586
675 587 $ hg init repo
676 588 $ touch repo/f1
677 589 $ $TESTDIR/seq.py 50000 > repo/f2
678 590 $ hg -R repo ci -Aqm "0"
679 591 $ HG_TEST_STREAM_WALKED_FILE_1="$TESTTMP/sync_file_walked_1"
680 592 $ export HG_TEST_STREAM_WALKED_FILE_1
681 593 $ HG_TEST_STREAM_WALKED_FILE_2="$TESTTMP/sync_file_walked_2"
682 594 $ export HG_TEST_STREAM_WALKED_FILE_2
683 595 $ HG_TEST_STREAM_WALKED_FILE_3="$TESTTMP/sync_file_walked_3"
684 596 $ export HG_TEST_STREAM_WALKED_FILE_3
685 597 # $ cat << EOF >> $HGRCPATH
686 598 # > [hooks]
687 599 # > pre-clone=rm -f "$TESTTMP/sync_file_walked_*"
688 600 # > EOF
689 601 $ hg serve -R repo -p $HGPORT1 -d --error errors.log --pid-file=hg.pid --config extensions.stream_steps="$RUNTESTDIR/testlib/ext-stream-clone-steps.py"
690 602 $ cat hg.pid >> $DAEMON_PIDS
691 603
692 604 clone while modifying the repo between stating file with write lock and
693 605 actually serving file content
694 606
695 607 $ (hg clone -q --stream -U http://localhost:$HGPORT1 clone; touch "$HG_TEST_STREAM_WALKED_FILE_3") &
696 608 $ $RUNTESTDIR/testlib/wait-on-file 10 $HG_TEST_STREAM_WALKED_FILE_1
697 609 $ echo >> repo/f1
698 610 $ echo >> repo/f2
699 611 $ hg -R repo ci -m "1" --config ui.timeout.warn=-1
700 612 $ touch $HG_TEST_STREAM_WALKED_FILE_2
701 613 $ $RUNTESTDIR/testlib/wait-on-file 10 $HG_TEST_STREAM_WALKED_FILE_3
702 614 $ hg -R clone id
703 615 000000000000
704 616 $ cat errors.log
705 617 $ cd ..
706 618
707 619 Stream repository with bookmarks
708 620 --------------------------------
709 621
710 622 (revert introduction of secret changeset)
711 623
712 624 $ hg -R server phase --draft 'secret()'
713 625
714 626 add a bookmark
715 627
716 628 $ hg -R server bookmark -r tip some-bookmark
717 629
718 630 clone it
719 631
720 632 #if stream-legacy
721 633 $ hg clone --stream http://localhost:$HGPORT with-bookmarks
722 634 streaming all changes
723 635 1090 files to transfer, 102 KB of data (no-zstd !)
724 636 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
725 637 1090 files to transfer, 98.8 KB of data (zstd !)
726 638 transferred 98.8 KB in * seconds (* */sec) (glob) (zstd !)
727 639 searching for changes
728 640 no changes found
729 641 updating to branch default
730 642 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved
731 643 #endif
732 644 #if stream-bundle2
733 645 $ hg clone --stream http://localhost:$HGPORT with-bookmarks
734 646 streaming all changes
735 647 1096 files to transfer, 102 KB of data (no-zstd !)
736 648 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
737 649 1096 files to transfer, 99.1 KB of data (zstd !)
738 650 transferred 99.1 KB in * seconds (* */sec) (glob) (zstd !)
739 651 updating to branch default
740 652 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved
741 653 #endif
742 654 $ hg verify -R with-bookmarks
743 655 checking changesets
744 656 checking manifests
745 657 crosschecking files in changesets and manifests
746 658 checking files
747 659 checked 3 changesets with 1088 changes to 1088 files
748 660 $ hg -R with-bookmarks bookmarks
749 661 some-bookmark 2:5223b5e3265f
750 662
751 663 Stream repository with phases
752 664 -----------------------------
753 665
754 666 Clone as publishing
755 667
756 668 $ hg -R server phase -r 'all()'
757 669 0: draft
758 670 1: draft
759 671 2: draft
760 672
761 673 #if stream-legacy
762 674 $ hg clone --stream http://localhost:$HGPORT phase-publish
763 675 streaming all changes
764 676 1090 files to transfer, 102 KB of data (no-zstd !)
765 677 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
766 678 1090 files to transfer, 98.8 KB of data (zstd !)
767 679 transferred 98.8 KB in * seconds (* */sec) (glob) (zstd !)
768 680 searching for changes
769 681 no changes found
770 682 updating to branch default
771 683 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved
772 684 #endif
773 685 #if stream-bundle2
774 686 $ hg clone --stream http://localhost:$HGPORT phase-publish
775 687 streaming all changes
776 688 1096 files to transfer, 102 KB of data (no-zstd !)
777 689 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
778 690 1096 files to transfer, 99.1 KB of data (zstd !)
779 691 transferred 99.1 KB in * seconds (* */sec) (glob) (zstd !)
780 692 updating to branch default
781 693 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved
782 694 #endif
783 695 $ hg verify -R phase-publish
784 696 checking changesets
785 697 checking manifests
786 698 crosschecking files in changesets and manifests
787 699 checking files
788 700 checked 3 changesets with 1088 changes to 1088 files
789 701 $ hg -R phase-publish phase -r 'all()'
790 702 0: public
791 703 1: public
792 704 2: public
793 705
794 706 Clone as non publishing
795 707
796 708 $ cat << EOF >> server/.hg/hgrc
797 709 > [phases]
798 710 > publish = False
799 711 > EOF
800 712 $ killdaemons.py
801 713 $ hg -R server serve -p $HGPORT -d --pid-file=hg.pid
802 714 $ cat hg.pid > $DAEMON_PIDS
803 715
804 716 #if stream-legacy
805 717
806 718 With v1 of the stream protocol, changeset are always cloned as public. It make
807 719 stream v1 unsuitable for non-publishing repository.
808 720
809 721 $ hg clone --stream http://localhost:$HGPORT phase-no-publish
810 722 streaming all changes
811 723 1090 files to transfer, 102 KB of data (no-zstd !)
812 724 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
813 725 1090 files to transfer, 98.8 KB of data (zstd !)
814 726 transferred 98.8 KB in * seconds (* */sec) (glob) (zstd !)
815 727 searching for changes
816 728 no changes found
817 729 updating to branch default
818 730 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved
819 731 $ hg -R phase-no-publish phase -r 'all()'
820 732 0: public
821 733 1: public
822 734 2: public
823 735 #endif
824 736 #if stream-bundle2
825 737 $ hg clone --stream http://localhost:$HGPORT phase-no-publish
826 738 streaming all changes
827 739 1097 files to transfer, 102 KB of data (no-zstd !)
828 740 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
829 741 1097 files to transfer, 99.1 KB of data (zstd !)
830 742 transferred 99.1 KB in * seconds (* */sec) (glob) (zstd !)
831 743 updating to branch default
832 744 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved
833 745 $ hg -R phase-no-publish phase -r 'all()'
834 746 0: draft
835 747 1: draft
836 748 2: draft
837 749 #endif
838 750 $ hg verify -R phase-no-publish
839 751 checking changesets
840 752 checking manifests
841 753 crosschecking files in changesets and manifests
842 754 checking files
843 755 checked 3 changesets with 1088 changes to 1088 files
844 756
845 757 $ killdaemons.py
846 758
847 759 #if stream-legacy
848 760
849 761 With v1 of the stream protocol, changeset are always cloned as public. There's
850 762 no obsolescence markers exchange in stream v1.
851 763
852 764 #endif
853 765 #if stream-bundle2
854 766
855 767 Stream repository with obsolescence
856 768 -----------------------------------
857 769
858 770 Clone non-publishing with obsolescence
859 771
860 772 $ cat >> $HGRCPATH << EOF
861 773 > [experimental]
862 774 > evolution=all
863 775 > EOF
864 776
865 777 $ cd server
866 778 $ echo foo > foo
867 779 $ hg -q commit -m 'about to be pruned'
868 780 $ hg debugobsolete `hg log -r . -T '{node}'` -d '0 0' -u test --record-parents
869 781 1 new obsolescence markers
870 782 obsoleted 1 changesets
871 783 $ hg up null -q
872 784 $ hg log -T '{rev}: {phase}\n'
873 785 2: draft
874 786 1: draft
875 787 0: draft
876 788 $ hg serve -p $HGPORT -d --pid-file=hg.pid
877 789 $ cat hg.pid > $DAEMON_PIDS
878 790 $ cd ..
879 791
880 792 $ hg clone -U --stream http://localhost:$HGPORT with-obsolescence
881 793 streaming all changes
882 794 1098 files to transfer, 102 KB of data (no-zstd !)
883 795 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
884 796 1098 files to transfer, 99.5 KB of data (zstd !)
885 797 transferred 99.5 KB in * seconds (* */sec) (glob) (zstd !)
886 798 $ hg -R with-obsolescence log -T '{rev}: {phase}\n'
887 799 2: draft
888 800 1: draft
889 801 0: draft
890 802 $ hg debugobsolete -R with-obsolescence
891 803 8c206a663911c1f97f2f9d7382e417ae55872cfa 0 {5223b5e3265f0df40bb743da62249413d74ac70f} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
892 804 $ hg verify -R with-obsolescence
893 805 checking changesets
894 806 checking manifests
895 807 crosschecking files in changesets and manifests
896 808 checking files
897 809 checked 4 changesets with 1089 changes to 1088 files
898 810
899 811 $ hg clone -U --stream --config experimental.evolution=0 http://localhost:$HGPORT with-obsolescence-no-evolution
900 812 streaming all changes
901 813 remote: abort: server has obsolescence markers, but client cannot receive them via stream clone
902 814 abort: pull failed on remote
903 815 [100]
904 816
905 817 $ killdaemons.py
906 818
907 819 #endif
General Comments 0
You need to be logged in to leave comments. Login now