##// END OF EJS Templates
tests: add tests showing pulling from infinitepush works over wire...
Pulkit Goyal -
r37579:8478b198 default
parent child Browse files
Show More
@@ -1,384 +1,443 b''
1 1 #require no-reposimplestore
2 2
3 3 Testing the case when there is no infinitepush extension present on the client
4 4 side and the server routes each push to bundlestore. This case is very much
5 5 similar to CI use case.
6 6
7 7 Setup
8 8 -----
9 9
10 10 $ . "$TESTDIR/library-infinitepush.sh"
11 11 $ cat >> $HGRCPATH <<EOF
12 > [ui]
13 > ssh = python "$TESTDIR/dummyssh"
12 14 > [alias]
13 15 > glog = log -GT "{rev}:{node|short} {desc}\n{phase}"
14 16 > EOF
15 17 $ cp $HGRCPATH $TESTTMP/defaulthgrc
16 18 $ hg init repo
17 19 $ cd repo
18 20 $ setupserver
19 21 $ echo "pushtobundlestore = True" >> .hg/hgrc
20 22 $ echo "[extensions]" >> .hg/hgrc
21 23 $ echo "infinitepush=" >> .hg/hgrc
22 24 $ echo initialcommit > initialcommit
23 25 $ hg ci -Aqm "initialcommit"
24 26 $ hg phase --public .
25 27
26 28 $ cd ..
27 29 $ hg clone repo client -q
28 30 $ hg clone repo client2 -q
31 $ hg clone ssh://user@dummy/repo client3 -q
29 32 $ cd client
30 33
31 34 Pushing a new commit from the client to the server
32 35 -----------------------------------------------------
33 36
34 37 $ echo foobar > a
35 38 $ hg ci -Aqm "added a"
36 39 $ hg glog
37 40 @ 1:6cb0989601f1 added a
38 41 | draft
39 42 o 0:67145f466344 initialcommit
40 43 public
41 44
42 45 $ hg push
43 46 pushing to $TESTTMP/repo
44 47 searching for changes
45 48 storing changesets on the bundlestore
46 49 pushing 1 commit:
47 50 6cb0989601f1 added a
48 51
49 52 $ scratchnodes
50 53 6cb0989601f1fb5805238edfb16f3606713d9a0b a4c202c147a9c4bb91bbadb56321fc5f3950f7f2
51 54
52 55 Understanding how data is stored on the bundlestore in server
53 56 -------------------------------------------------------------
54 57
55 58 There are two things, filebundlestore and index
56 59 $ ls ../repo/.hg/scratchbranches
57 60 filebundlestore
58 61 index
59 62
60 63 filebundlestore stores the bundles
61 64 $ ls ../repo/.hg/scratchbranches/filebundlestore/a4/c2/
62 65 a4c202c147a9c4bb91bbadb56321fc5f3950f7f2
63 66
64 67 index/nodemap stores a map of node id and file in which bundle is stored in filebundlestore
65 68 $ ls ../repo/.hg/scratchbranches/index/
66 69 nodemap
67 70 $ ls ../repo/.hg/scratchbranches/index/nodemap/
68 71 6cb0989601f1fb5805238edfb16f3606713d9a0b
69 72
70 73 $ cd ../repo
71 74
72 75 Checking that the commit was not applied to revlog on the server
73 76 ------------------------------------------------------------------
74 77
75 78 $ hg glog
76 79 @ 0:67145f466344 initialcommit
77 80 public
78 81
79 82 Applying the changeset from the bundlestore
80 83 --------------------------------------------
81 84
82 85 $ hg unbundle .hg/scratchbranches/filebundlestore/a4/c2/a4c202c147a9c4bb91bbadb56321fc5f3950f7f2
83 86 adding changesets
84 87 adding manifests
85 88 adding file changes
86 89 added 1 changesets with 1 changes to 1 files
87 90 new changesets 6cb0989601f1
88 91 (run 'hg update' to get a working copy)
89 92
90 93 $ hg glog
91 94 o 1:6cb0989601f1 added a
92 95 | public
93 96 @ 0:67145f466344 initialcommit
94 97 public
95 98
96 99 Pushing more changesets from the local repo
97 100 --------------------------------------------
98 101
99 102 $ cd ../client
100 103 $ echo b > b
101 104 $ hg ci -Aqm "added b"
102 105 $ echo c > c
103 106 $ hg ci -Aqm "added c"
104 107 $ hg glog
105 108 @ 3:bf8a6e3011b3 added c
106 109 | draft
107 110 o 2:eaba929e866c added b
108 111 | draft
109 112 o 1:6cb0989601f1 added a
110 113 | public
111 114 o 0:67145f466344 initialcommit
112 115 public
113 116
114 117 $ hg push
115 118 pushing to $TESTTMP/repo
116 119 searching for changes
117 120 storing changesets on the bundlestore
118 121 pushing 2 commits:
119 122 eaba929e866c added b
120 123 bf8a6e3011b3 added c
121 124
122 125 Checking that changesets are not applied on the server
123 126 ------------------------------------------------------
124 127
125 128 $ hg glog -R ../repo
126 129 o 1:6cb0989601f1 added a
127 130 | public
128 131 @ 0:67145f466344 initialcommit
129 132 public
130 133
131 134 Both of the new changesets are stored in a single bundle-file
132 135 $ scratchnodes
133 136 6cb0989601f1fb5805238edfb16f3606713d9a0b a4c202c147a9c4bb91bbadb56321fc5f3950f7f2
134 137 bf8a6e3011b345146bbbedbcb1ebd4837571492a ee41a41cefb7817cbfb235b4f6e9f27dbad6ca1f
135 138 eaba929e866c59bc9a6aada5a9dd2f6990db83c0 ee41a41cefb7817cbfb235b4f6e9f27dbad6ca1f
136 139
137 140 Pushing more changesets to the server
138 141 -------------------------------------
139 142
140 143 $ echo d > d
141 144 $ hg ci -Aqm "added d"
142 145 $ echo e > e
143 146 $ hg ci -Aqm "added e"
144 147
145 148 XXX: we should have pushed only the parts which are not in bundlestore
146 149 $ hg push
147 150 pushing to $TESTTMP/repo
148 151 searching for changes
149 152 storing changesets on the bundlestore
150 153 pushing 4 commits:
151 154 eaba929e866c added b
152 155 bf8a6e3011b3 added c
153 156 1bb96358eda2 added d
154 157 b4e4bce66051 added e
155 158
156 159 Sneak peek into the bundlestore at the server
157 160 $ scratchnodes
158 161 1bb96358eda285b536c6d1c66846a7cdb2336cea 57e00c0d4f26e2a2a72b751b63d9abc4f3eb28e7
159 162 6cb0989601f1fb5805238edfb16f3606713d9a0b a4c202c147a9c4bb91bbadb56321fc5f3950f7f2
160 163 b4e4bce660512ad3e71189e14588a70ac8e31fef 57e00c0d4f26e2a2a72b751b63d9abc4f3eb28e7
161 164 bf8a6e3011b345146bbbedbcb1ebd4837571492a 57e00c0d4f26e2a2a72b751b63d9abc4f3eb28e7
162 165 eaba929e866c59bc9a6aada5a9dd2f6990db83c0 57e00c0d4f26e2a2a72b751b63d9abc4f3eb28e7
163 166
164 167 Checking if `hg pull` pulls something or `hg incoming` shows something
165 168 -----------------------------------------------------------------------
166 169
167 170 $ hg incoming
168 171 comparing with $TESTTMP/repo
169 172 searching for changes
170 173 no changes found
171 174 [1]
172 175
173 176 $ hg pull
174 177 pulling from $TESTTMP/repo
175 178 searching for changes
176 179 no changes found
177 180
178 Pulling from second client to test `hg pull -r <rev>`
179 ------------------------------------------------------
181 Pulling from second client which is a localpeer to test `hg pull -r <rev>`
182 --------------------------------------------------------------------------
180 183
181 184 Pulling the revision which is applied
182 185
183 186 $ cd ../client2
184 187 $ hg pull -r 6cb0989601f1
185 188 pulling from $TESTTMP/repo
186 189 searching for changes
187 190 adding changesets
188 191 adding manifests
189 192 adding file changes
190 193 added 1 changesets with 1 changes to 1 files
191 194 new changesets 6cb0989601f1
192 195 (run 'hg update' to get a working copy)
193 196 $ hg glog
194 197 o 1:6cb0989601f1 added a
195 198 | public
196 199 @ 0:67145f466344 initialcommit
197 200 public
198 201
199 202 Pulling the revision which is in bundlestore
200 XXX: we should support pulling revisions from bundlestore without client side
201 wrapping
203 XXX: we should support pulling revisions from a local peers bundlestore without
204 client side wrapping
202 205
203 206 $ hg pull -r b4e4bce660512ad3e71189e14588a70ac8e31fef
204 207 pulling from $TESTTMP/repo
205 208 abort: unknown revision 'b4e4bce660512ad3e71189e14588a70ac8e31fef'!
206 209 [255]
207 210 $ hg glog
208 211 o 1:6cb0989601f1 added a
209 212 | public
210 213 @ 0:67145f466344 initialcommit
211 214 public
212 215
213 216 $ cd ../client
214 217
218 Pulling from third client which is not a localpeer
219 ---------------------------------------------------
220
221 Pulling the revision which is applied
222
223 $ cd ../client3
224 $ hg pull -r 6cb0989601f1
225 pulling from ssh://user@dummy/repo
226 searching for changes
227 adding changesets
228 adding manifests
229 adding file changes
230 added 1 changesets with 1 changes to 1 files
231 new changesets 6cb0989601f1
232 (run 'hg update' to get a working copy)
233 $ hg glog
234 o 1:6cb0989601f1 added a
235 | public
236 @ 0:67145f466344 initialcommit
237 public
238
239 Pulling the revision which is in bundlestore
240
241 Trying to specify short hash
242 XXX: we should support this
243 $ hg pull -r b4e4bce660512
244 pulling from ssh://user@dummy/repo
245 abort: unknown revision 'b4e4bce660512'!
246 [255]
247
248 XXX: we should show better message when the pull is happening from bundlestore
249 $ hg pull -r b4e4bce660512ad3e71189e14588a70ac8e31fef
250 pulling from ssh://user@dummy/repo
251 searching for changes
252 no changes found
253 adding changesets
254 adding manifests
255 adding file changes
256 added 4 changesets with 4 changes to 4 files
257 new changesets eaba929e866c:b4e4bce66051
258 $ hg glog
259 o 5:b4e4bce66051 added e
260 | public
261 o 4:1bb96358eda2 added d
262 | public
263 o 3:bf8a6e3011b3 added c
264 | public
265 o 2:eaba929e866c added b
266 | public
267 o 1:6cb0989601f1 added a
268 | public
269 @ 0:67145f466344 initialcommit
270 public
271
272 $ cd ../client
273
215 274 Checking storage of phase information with the bundle on bundlestore
216 275 ---------------------------------------------------------------------
217 276
218 277 creating a draft commit
219 278 $ cat >> $HGRCPATH <<EOF
220 279 > [phases]
221 280 > publish = False
222 281 > EOF
223 282 $ echo f > f
224 283 $ hg ci -Aqm "added f"
225 284 $ hg glog -r '.^::'
226 285 @ 6:9b42578d4447 added f
227 286 | draft
228 287 o 5:b4e4bce66051 added e
229 288 | public
230 289 ~
231 290
232 291 $ hg push
233 292 pushing to $TESTTMP/repo
234 293 searching for changes
235 294 storing changesets on the bundlestore
236 295 pushing 5 commits:
237 296 eaba929e866c added b
238 297 bf8a6e3011b3 added c
239 298 1bb96358eda2 added d
240 299 b4e4bce66051 added e
241 300 9b42578d4447 added f
242 301
243 302 XXX: the phase of 9b42578d4447 should not be changed here
244 303 $ hg glog -r .
245 304 @ 6:9b42578d4447 added f
246 305 | public
247 306 ~
248 307
249 308 applying the bundle on the server to check preservation of phase-information
250 309
251 310 $ cd ../repo
252 311 $ scratchnodes
253 312 1bb96358eda285b536c6d1c66846a7cdb2336cea 0a6e70ecd5b98d22382f69b93909f557ac6a9927
254 313 6cb0989601f1fb5805238edfb16f3606713d9a0b a4c202c147a9c4bb91bbadb56321fc5f3950f7f2
255 314 9b42578d44473575994109161430d65dd147d16d 0a6e70ecd5b98d22382f69b93909f557ac6a9927
256 315 b4e4bce660512ad3e71189e14588a70ac8e31fef 0a6e70ecd5b98d22382f69b93909f557ac6a9927
257 316 bf8a6e3011b345146bbbedbcb1ebd4837571492a 0a6e70ecd5b98d22382f69b93909f557ac6a9927
258 317 eaba929e866c59bc9a6aada5a9dd2f6990db83c0 0a6e70ecd5b98d22382f69b93909f557ac6a9927
259 318
260 319 $ hg unbundle .hg/scratchbranches/filebundlestore/0a/6e/0a6e70ecd5b98d22382f69b93909f557ac6a9927
261 320 adding changesets
262 321 adding manifests
263 322 adding file changes
264 323 added 5 changesets with 5 changes to 5 files
265 324 new changesets eaba929e866c:9b42578d4447
266 325 (run 'hg update' to get a working copy)
267 326
268 327 $ hg glog
269 328 o 6:9b42578d4447 added f
270 329 | draft
271 330 o 5:b4e4bce66051 added e
272 331 | public
273 332 o 4:1bb96358eda2 added d
274 333 | public
275 334 o 3:bf8a6e3011b3 added c
276 335 | public
277 336 o 2:eaba929e866c added b
278 337 | public
279 338 o 1:6cb0989601f1 added a
280 339 | public
281 340 @ 0:67145f466344 initialcommit
282 341 public
283 342
284 343 Checking storage of obsmarkers in the bundlestore
285 344 --------------------------------------------------
286 345
287 346 enabling obsmarkers and rebase extension
288 347
289 348 $ cat >> $HGRCPATH << EOF
290 349 > [experimental]
291 350 > evolution = all
292 351 > [extensions]
293 352 > rebase =
294 353 > EOF
295 354
296 355 $ cd ../client
297 356
298 357 $ hg phase -r . --draft --force
299 358 $ hg rebase -r 6 -d 3
300 359 rebasing 6:9b42578d4447 "added f" (tip)
301 360
302 361 $ hg glog
303 362 @ 7:99949238d9ac added f
304 363 | draft
305 364 | o 5:b4e4bce66051 added e
306 365 | | public
307 366 | o 4:1bb96358eda2 added d
308 367 |/ public
309 368 o 3:bf8a6e3011b3 added c
310 369 | public
311 370 o 2:eaba929e866c added b
312 371 | public
313 372 o 1:6cb0989601f1 added a
314 373 | public
315 374 o 0:67145f466344 initialcommit
316 375 public
317 376
318 377 $ hg push -f
319 378 pushing to $TESTTMP/repo
320 379 searching for changes
321 380 storing changesets on the bundlestore
322 381 pushing 1 commit:
323 382 99949238d9ac added f
324 383
325 384 XXX: the phase should not have changed here
326 385 $ hg glog -r .
327 386 @ 7:99949238d9ac added f
328 387 | public
329 388 ~
330 389
331 390 Unbundling on server to see obsmarkers being applied
332 391
333 392 $ cd ../repo
334 393
335 394 $ scratchnodes
336 395 1bb96358eda285b536c6d1c66846a7cdb2336cea 0a6e70ecd5b98d22382f69b93909f557ac6a9927
337 396 6cb0989601f1fb5805238edfb16f3606713d9a0b a4c202c147a9c4bb91bbadb56321fc5f3950f7f2
338 397 99949238d9ac7f2424a33a46dface6f866afd059 090a24fe63f31d3b4bee714447f835c8c362ff57
339 398 9b42578d44473575994109161430d65dd147d16d 0a6e70ecd5b98d22382f69b93909f557ac6a9927
340 399 b4e4bce660512ad3e71189e14588a70ac8e31fef 0a6e70ecd5b98d22382f69b93909f557ac6a9927
341 400 bf8a6e3011b345146bbbedbcb1ebd4837571492a 0a6e70ecd5b98d22382f69b93909f557ac6a9927
342 401 eaba929e866c59bc9a6aada5a9dd2f6990db83c0 0a6e70ecd5b98d22382f69b93909f557ac6a9927
343 402
344 403 $ hg glog
345 404 o 6:9b42578d4447 added f
346 405 | draft
347 406 o 5:b4e4bce66051 added e
348 407 | public
349 408 o 4:1bb96358eda2 added d
350 409 | public
351 410 o 3:bf8a6e3011b3 added c
352 411 | public
353 412 o 2:eaba929e866c added b
354 413 | public
355 414 o 1:6cb0989601f1 added a
356 415 | public
357 416 @ 0:67145f466344 initialcommit
358 417 public
359 418
360 419 $ hg unbundle .hg/scratchbranches/filebundlestore/09/0a/090a24fe63f31d3b4bee714447f835c8c362ff57
361 420 adding changesets
362 421 adding manifests
363 422 adding file changes
364 423 added 1 changesets with 0 changes to 1 files (+1 heads)
365 424 1 new obsolescence markers
366 425 obsoleted 1 changesets
367 426 new changesets 99949238d9ac
368 427 (run 'hg heads' to see heads, 'hg merge' to merge)
369 428
370 429 $ hg glog
371 430 o 7:99949238d9ac added f
372 431 | draft
373 432 | o 5:b4e4bce66051 added e
374 433 | | public
375 434 | o 4:1bb96358eda2 added d
376 435 |/ public
377 436 o 3:bf8a6e3011b3 added c
378 437 | public
379 438 o 2:eaba929e866c added b
380 439 | public
381 440 o 1:6cb0989601f1 added a
382 441 | public
383 442 @ 0:67145f466344 initialcommit
384 443 public
General Comments 0
You need to be logged in to leave comments. Login now