##// END OF EJS Templates
test: add an extra case for obsolescence distributed case...
Boris Feld -
r34652:e88dbbcf default
parent child Browse files
Show More
@@ -10,6 +10,8 b' to happen in the local case but can easi'
10 $ unset EMAIL
10 $ unset EMAIL
11 $ . $TESTDIR/testlib/obsmarker-common.sh
11 $ . $TESTDIR/testlib/obsmarker-common.sh
12 $ cat >> $HGRCPATH << EOF
12 $ cat >> $HGRCPATH << EOF
13 > [extensions]
14 > rebase =
13 > [experimental]
15 > [experimental]
14 > evolution = all
16 > evolution = all
15 > [phases]
17 > [phases]
@@ -205,3 +207,284 b' obsolete on the server side but the mark'
205 $ hg debugobsolete
207 $ hg debugobsolete
206 e1b46f0f979f52748347ff8729c59f2ef56e6fe2 7f6b0a6f5c25345a83870963efd827c1798a5959 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'server'}
208 e1b46f0f979f52748347ff8729c59f2ef56e6fe2 7f6b0a6f5c25345a83870963efd827c1798a5959 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'server'}
207 7f6b0a6f5c25345a83870963efd827c1798a5959 e5d7dda7cd28e6b3f79437e5b8122a38ece0255c 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'client'}
209 7f6b0a6f5c25345a83870963efd827c1798a5959 e5d7dda7cd28e6b3f79437e5b8122a38ece0255c 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'client'}
210 $ cd ..
211
212 Check getting changesets after getting the markers
213 =================================================
214
215 This test case covers the scenario where commits are received -after- we
216 received some obsolescence markers turning them obsolete.
217
218 For example, we pull some successors from a repository (with associated
219 predecessors marker chain) and then later we pull some intermediate
220 precedessors changeset from another repository. Obsolescence markers must
221 apply to the intermediate changeset. They have to be obsolete (and hidden).
222
223 Avoiding pulling the changeset in the first place is a tricky decision because
224 there could be non-obsolete ancestors that need to be pulled, but the
225 discovery cannot currently find these (this is not the case in this tests). In
226 addition, we could also have to pull the changeset because they have children.
227 In this case, they would not be hidden (yet) because of the orphan descendant,
228 but they would still have to be obsolete. (This is not tested in this case
229 either).
230
231 $ mkdir distributed-chain-building
232 $ cd distributed-chain-building
233 $ hg init server
234 $ cd server
235 $ cat << EOF >> .hg/hgrc
236 > [ui]
237 > username = server
238 > EOF
239 $ mkcommit ROOT
240 $ cd ..
241 $ hg clone server repo-Alice
242 updating to branch default
243 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
244 $ cat << EOF >> repo-Alice/.hg/hgrc
245 > [ui]
246 > username = alice
247 > EOF
248 $ hg clone server repo-Bob
249 updating to branch default
250 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
251 $ cat << EOF >> repo-Bob/.hg/hgrc
252 > [ui]
253 > username = bob
254 > EOF
255 $ hg clone server repo-Celeste
256 updating to branch default
257 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
258 $ cat << EOF >> repo-Celeste/.hg/hgrc
259 > [ui]
260 > username = celeste
261 > EOF
262
263 Create some changesets locally
264
265 $ cd repo-Alice
266 $ mkcommit c_A0
267 $ mkcommit c_B0
268 $ cd ..
269
270 Bob pulls from Alice and rewrites them
271
272 $ cd repo-Bob
273 $ hg pull ../repo-Alice
274 pulling from ../repo-Alice
275 searching for changes
276 adding changesets
277 adding manifests
278 adding file changes
279 added 2 changesets with 2 changes to 2 files
280 (run 'hg update' to get a working copy)
281 $ hg up 'desc("c_A")'
282 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
283 $ hg commit --amend -m 'c_A1'
284 $ hg rebase -r 'desc("c_B0")' -d . # no easy way to rewrite the message with the rebase
285 rebasing 2:ef908e42ce65 "c_B0"
286 $ hg up
287 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
288 $ hg commit --amend -m 'c_B1'
289 $ hg log -G
290 @ 5:956063ac4557 c_B1
291 |
292 o 3:5b5708a437f2 c_A1
293 |
294 o 0:e82fb8d02bbf ROOT
295
296 $ hg log -G --hidden
297 @ 5:956063ac4557 c_B1
298 |
299 | x 4:5ffb9e311b35 c_B0 [rewritten using amend as 5:956063ac4557 by bob (at 1970-01-01 00:00 +0000); ]
300 |/
301 o 3:5b5708a437f2 c_A1
302 |
303 | x 2:ef908e42ce65 c_B0 [rewritten using rebase as 4:5ffb9e311b35 by bob (at 1970-01-01 00:00 +0000); ]
304 | |
305 | x 1:d33b0a3a6464 c_A0 [rewritten using amend as 3:5b5708a437f2 by bob (at 1970-01-01 00:00 +0000); ]
306 |/
307 o 0:e82fb8d02bbf ROOT
308
309 $ hg debugobsolete
310 d33b0a3a64647d79583526be8107802b1f9fedfa 5b5708a437f27665db42c5a261a539a1bcb2a8c2 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'amend', 'user': 'bob'}
311 ef908e42ce65ef57f970d799acaddde26f58a4cc 5ffb9e311b35f6ab6f76f667ca5d6e595645481b 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'rebase', 'user': 'bob'}
312 5ffb9e311b35f6ab6f76f667ca5d6e595645481b 956063ac4557828781733b2d5677a351ce856f59 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'amend', 'user': 'bob'}
313 $ cd ..
314
315 Celeste pulls from Bob and rewrites them again
316
317 $ cd repo-Celeste
318 $ hg pull ../repo-Bob
319 pulling from ../repo-Bob
320 searching for changes
321 adding changesets
322 adding manifests
323 adding file changes
324 added 2 changesets with 2 changes to 2 files
325 3 new obsolescence markers
326 (run 'hg update' to get a working copy)
327 $ hg up 'desc("c_A")'
328 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
329 $ hg commit --amend -m 'c_A2'
330 $ hg rebase -r 'desc("c_B1")' -d . # no easy way to rewrite the message with the rebase
331 rebasing 2:956063ac4557 "c_B1"
332 $ hg up
333 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
334 $ hg commit --amend -m 'c_B2'
335 $ hg log -G
336 @ 5:77ae25d99ff0 c_B2
337 |
338 o 3:9866d64649a5 c_A2
339 |
340 o 0:e82fb8d02bbf ROOT
341
342 $ hg log -G --hidden
343 @ 5:77ae25d99ff0 c_B2
344 |
345 | x 4:3cf8de21cc22 c_B1 [rewritten using amend as 5:77ae25d99ff0 by celeste (at 1970-01-01 00:00 +0000); ]
346 |/
347 o 3:9866d64649a5 c_A2
348 |
349 | x 2:956063ac4557 c_B1 [rewritten using rebase as 4:3cf8de21cc22 by celeste (at 1970-01-01 00:00 +0000); ]
350 | |
351 | x 1:5b5708a437f2 c_A1 [rewritten using amend as 3:9866d64649a5 by celeste (at 1970-01-01 00:00 +0000); ]
352 |/
353 o 0:e82fb8d02bbf ROOT
354
355 $ hg debugobsolete
356 5ffb9e311b35f6ab6f76f667ca5d6e595645481b 956063ac4557828781733b2d5677a351ce856f59 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'amend', 'user': 'bob'}
357 d33b0a3a64647d79583526be8107802b1f9fedfa 5b5708a437f27665db42c5a261a539a1bcb2a8c2 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'amend', 'user': 'bob'}
358 ef908e42ce65ef57f970d799acaddde26f58a4cc 5ffb9e311b35f6ab6f76f667ca5d6e595645481b 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'rebase', 'user': 'bob'}
359 5b5708a437f27665db42c5a261a539a1bcb2a8c2 9866d64649a5d9c5991fe119c7b2c33898114e10 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'amend', 'user': 'celeste'}
360 956063ac4557828781733b2d5677a351ce856f59 3cf8de21cc2282186857d2266eb6b1f9cb85ecf3 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'rebase', 'user': 'celeste'}
361 3cf8de21cc2282186857d2266eb6b1f9cb85ecf3 77ae25d99ff07889e181126b1171b94bec8e5227 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'amend', 'user': 'celeste'}
362
363 Celeste now pushes to the server
364
365 (note: it would be enough to just have direct Celeste -> Alice exchange here.
366 However using a central server seems more common)
367
368 $ hg push
369 pushing to $TESTTMP/distributed-chain-building/distributed-chain-building/server (glob)
370 searching for changes
371 adding changesets
372 adding manifests
373 adding file changes
374 added 2 changesets with 2 changes to 2 files
375 6 new obsolescence markers
376 $ cd ..
377
378 Now Alice pulls from the server, then from Bob
379
380 Alice first retrieves the new evolution of its changesets and associated markers
381 from the server (note: could be from Celeste directly)
382
383 $ cd repo-Alice
384 $ hg up 'desc(ROOT)'
385 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
386 $ hg pull
387 pulling from $TESTTMP/distributed-chain-building/distributed-chain-building/server (glob)
388 searching for changes
389 adding changesets
390 adding manifests
391 adding file changes
392 added 2 changesets with 0 changes to 2 files (+1 heads)
393 6 new obsolescence markers
394 obsoleted 2 changesets
395 (run 'hg heads' to see heads)
396 $ hg debugobsolete
397 3cf8de21cc2282186857d2266eb6b1f9cb85ecf3 77ae25d99ff07889e181126b1171b94bec8e5227 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'amend', 'user': 'celeste'}
398 5b5708a437f27665db42c5a261a539a1bcb2a8c2 9866d64649a5d9c5991fe119c7b2c33898114e10 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'amend', 'user': 'celeste'}
399 5ffb9e311b35f6ab6f76f667ca5d6e595645481b 956063ac4557828781733b2d5677a351ce856f59 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'amend', 'user': 'bob'}
400 956063ac4557828781733b2d5677a351ce856f59 3cf8de21cc2282186857d2266eb6b1f9cb85ecf3 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'rebase', 'user': 'celeste'}
401 d33b0a3a64647d79583526be8107802b1f9fedfa 5b5708a437f27665db42c5a261a539a1bcb2a8c2 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'amend', 'user': 'bob'}
402 ef908e42ce65ef57f970d799acaddde26f58a4cc 5ffb9e311b35f6ab6f76f667ca5d6e595645481b 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'rebase', 'user': 'bob'}
403
404 Then, she pulls from Bob, pulling predecessors of the changeset she has
405 already pulled. The changesets are not obsoleted in the Bob repo yet. Their
406 successors do not exist in Bob repository yet.
407
408 $ hg pull ../repo-Bob
409 pulling from ../repo-Bob
410 searching for changes
411 adding changesets
412 adding manifests
413 adding file changes
414 added 2 changesets with 0 changes to 2 files (+1 heads)
415 (run 'hg heads' to see heads)
416 $ hg log -G
417 o 4:77ae25d99ff0 c_B2
418 |
419 o 3:9866d64649a5 c_A2
420 |
421 @ 0:e82fb8d02bbf ROOT
422
423 $ hg debugobsolete
424 3cf8de21cc2282186857d2266eb6b1f9cb85ecf3 77ae25d99ff07889e181126b1171b94bec8e5227 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'amend', 'user': 'celeste'}
425 5b5708a437f27665db42c5a261a539a1bcb2a8c2 9866d64649a5d9c5991fe119c7b2c33898114e10 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'amend', 'user': 'celeste'}
426 5ffb9e311b35f6ab6f76f667ca5d6e595645481b 956063ac4557828781733b2d5677a351ce856f59 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'amend', 'user': 'bob'}
427 956063ac4557828781733b2d5677a351ce856f59 3cf8de21cc2282186857d2266eb6b1f9cb85ecf3 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'rebase', 'user': 'celeste'}
428 d33b0a3a64647d79583526be8107802b1f9fedfa 5b5708a437f27665db42c5a261a539a1bcb2a8c2 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'amend', 'user': 'bob'}
429 ef908e42ce65ef57f970d799acaddde26f58a4cc 5ffb9e311b35f6ab6f76f667ca5d6e595645481b 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'rebase', 'user': 'bob'}
430
431 Same tests, but change coming from a bundle
432 (testing with a bundle is interesting because absolutely no discovery or
433 decision is made in that case, so receiving the changesets are not an option).
434
435 $ hg rollback
436 repository tip rolled back to revision 4 (undo pull)
437 $ hg log -G
438 o 4:77ae25d99ff0 c_B2
439 |
440 o 3:9866d64649a5 c_A2
441 |
442 @ 0:e82fb8d02bbf ROOT
443
444 $ hg debugobsolete
445 3cf8de21cc2282186857d2266eb6b1f9cb85ecf3 77ae25d99ff07889e181126b1171b94bec8e5227 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'amend', 'user': 'celeste'}
446 5b5708a437f27665db42c5a261a539a1bcb2a8c2 9866d64649a5d9c5991fe119c7b2c33898114e10 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'amend', 'user': 'celeste'}
447 5ffb9e311b35f6ab6f76f667ca5d6e595645481b 956063ac4557828781733b2d5677a351ce856f59 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'amend', 'user': 'bob'}
448 956063ac4557828781733b2d5677a351ce856f59 3cf8de21cc2282186857d2266eb6b1f9cb85ecf3 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'rebase', 'user': 'celeste'}
449 d33b0a3a64647d79583526be8107802b1f9fedfa 5b5708a437f27665db42c5a261a539a1bcb2a8c2 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'amend', 'user': 'bob'}
450 ef908e42ce65ef57f970d799acaddde26f58a4cc 5ffb9e311b35f6ab6f76f667ca5d6e595645481b 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'rebase', 'user': 'bob'}
451 $ hg -R ../repo-Bob bundle ../step-1.hg
452 searching for changes
453 2 changesets found
454 $ hg unbundle ../step-1.hg
455 adding changesets
456 adding manifests
457 adding file changes
458 added 2 changesets with 0 changes to 2 files (+1 heads)
459 (run 'hg heads' to see heads)
460 $ hg log -G
461 o 4:77ae25d99ff0 c_B2
462 |
463 o 3:9866d64649a5 c_A2
464 |
465 @ 0:e82fb8d02bbf ROOT
466
467 $ hg log -G --hidden
468 x 6:956063ac4557 c_B1 [rewritten using amend, rebase as 4:77ae25d99ff0 by celeste (at 1970-01-01 00:00 +0000); ]
469 |
470 x 5:5b5708a437f2 c_A1 [rewritten using amend as 3:9866d64649a5 by celeste (at 1970-01-01 00:00 +0000); ]
471 |
472 | o 4:77ae25d99ff0 c_B2
473 | |
474 | o 3:9866d64649a5 c_A2
475 |/
476 | x 2:ef908e42ce65 c_B0 [rewritten using amend, rebase as 6:956063ac4557 by bob (at 1970-01-01 00:00 +0000); ]
477 | |
478 | x 1:d33b0a3a6464 c_A0 [rewritten using amend as 5:5b5708a437f2 by bob (at 1970-01-01 00:00 +0000); ]
479 |/
480 @ 0:e82fb8d02bbf ROOT
481
482 $ hg debugobsolete
483 3cf8de21cc2282186857d2266eb6b1f9cb85ecf3 77ae25d99ff07889e181126b1171b94bec8e5227 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'amend', 'user': 'celeste'}
484 5b5708a437f27665db42c5a261a539a1bcb2a8c2 9866d64649a5d9c5991fe119c7b2c33898114e10 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'amend', 'user': 'celeste'}
485 5ffb9e311b35f6ab6f76f667ca5d6e595645481b 956063ac4557828781733b2d5677a351ce856f59 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'amend', 'user': 'bob'}
486 956063ac4557828781733b2d5677a351ce856f59 3cf8de21cc2282186857d2266eb6b1f9cb85ecf3 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'rebase', 'user': 'celeste'}
487 d33b0a3a64647d79583526be8107802b1f9fedfa 5b5708a437f27665db42c5a261a539a1bcb2a8c2 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'amend', 'user': 'bob'}
488 ef908e42ce65ef57f970d799acaddde26f58a4cc 5ffb9e311b35f6ab6f76f667ca5d6e595645481b 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'rebase', 'user': 'bob'}
489
490 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now