comparison tests/test-push-checkheads-pruned-B6.t @ 32013:0cf4d6763735

obsolescence: add test for the "branch replacement" logic during push, case B6 Mercurial checks for the introduction of new heads on push. Evolution comes into play to detect if existing branches on the server are being replaced by some of the new one we push. This changeset adds test for the improved "branch replacement" logic introduce in an earlier commits. This tests initially lived in the evolve extensions. Since we now have the code handling this logic in core, it make sense to have the tests in core too. See inline documentation for details about the test case added in this changeset.
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Sat, 15 Apr 2017 02:53:42 +0200
parents
children 53b3a1968aa6
comparison
equal deleted inserted replaced
32012:413c731f5475 32013:0cf4d6763735
1 ====================================
2 Testing head checking code: Case B-6
3 ====================================
4
5 Mercurial checks for the introduction of new heads on push. Evolution comes
6 into play to detect if existing branches on the server are being replaced by
7 some of the new one we push.
8
9 This case is part of a series of tests checking this behavior.
10
11 Category B: simple case involving pruned changesets
12 TestCase 6: single changesets, pruned then superseeded (on a new changeset)
13
14 .. old-state:
15 ..
16 .. * 1 changeset branch
17 ..
18 .. new-state:
19 ..
20 .. * old branch is rewritten onto another one,
21 .. * the new version is then pruned.
22 ..
23 .. expected-result:
24 ..
25 .. * push allowed
26 ..
27 .. graph-summary:
28 ..
29 .. A ø⇠⊗ A'
30 .. | |
31 .. | ◔ B
32 .. |/
33 .. ●
34
35 $ . $TESTDIR/testlib/push-checkheads-util.sh
36
37 Test setup
38 ----------
39
40 $ mkdir B6
41 $ cd B6
42 $ setuprepos
43 creating basic server and client repo
44 updating to branch default
45 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
46 $ cd client
47 $ hg up 0
48 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
49 $ mkcommit B0
50 created new head
51 $ mkcommit A1
52 $ hg up 'desc(B0)'
53 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
54 $ hg debugobsolete `getid "desc(A0)"` `getid "desc(A1)"`
55 $ hg debugobsolete --record-parents `getid "desc(A1)"`
56 $ hg log -G --hidden
57 x ba93660aff8d (draft): A1
58 |
59 @ 74ff5441d343 (draft): B0
60 |
61 | x 8aaa48160adc (draft): A0
62 |/
63 o 1e4be0697311 (public): root
64
65
66 Actual testing
67 --------------
68
69 $ hg push
70 pushing to $TESTTMP/B6/server (glob)
71 searching for changes
72 adding changesets
73 adding manifests
74 adding file changes
75 added 1 changesets with 1 changes to 1 files (+1 heads)
76 2 new obsolescence markers
77
78 $ cd ../..