comparison tests/test-push-checkheads-pruned-B8.t @ 32015:605c38105950

obsolescence: add test for the "branch replacement" logic during push, case B8 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:57 +0200
parents
children 53b3a1968aa6
comparison
equal deleted inserted replaced
32014:818cc18a7574 32015:605c38105950
1 ====================================
2 Testing head checking code: Case B-2
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 2: multi-changeset branch, head is pruned, rest is superceeded, through other
13
14 .. old-state:
15 ..
16 .. * 2 changeset branch
17 ..
18 .. new-state:
19 ..
20 .. * old head is rewritten then pruned
21 .. * 1 new branch succeeding to the other changeset in the old branch (through another obsolete branch)
22 ..
23 .. expected-result:
24 ..
25 .. * push allowed
26 ..
27 .. graph-summary:
28 ..
29 .. B ø⇠⊗ B'
30 .. | | A'
31 .. A ø⇠ø⇠◔ A''
32 .. |/ /
33 .. | /
34 .. |/
35 .. ●
36
37 $ . $TESTDIR/testlib/push-checkheads-util.sh
38
39 Test setup
40 ----------
41
42 $ mkdir B8
43 $ cd B8
44 $ setuprepos
45 creating basic server and client repo
46 updating to branch default
47 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
48 $ cd server
49 $ mkcommit B0
50 $ cd ../client
51 $ hg pull
52 pulling from $TESTTMP/B8/server (glob)
53 searching for changes
54 adding changesets
55 adding manifests
56 adding file changes
57 added 1 changesets with 1 changes to 1 files
58 (run 'hg update' to get a working copy)
59 $ hg up 0
60 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
61 $ mkcommit A1
62 created new head
63 $ mkcommit B1
64 $ hg up 0
65 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
66 $ mkcommit A2
67 created new head
68 $ hg debugobsolete `getid "desc(A0)" ` `getid "desc(A1)"`
69 $ hg debugobsolete `getid "desc(B0)" ` `getid "desc(B1)"`
70 $ hg debugobsolete --record-parents `getid "desc(B1)"`
71 $ hg debugobsolete `getid "desc(A1)" ` `getid "desc(A2)"`
72 $ hg log -G --hidden
73 @ c1f8d089020f (draft): A2
74 |
75 | x 262c8c798096 (draft): B1
76 | |
77 | x f6082bc4ffef (draft): A1
78 |/
79 | x d73caddc5533 (draft): B0
80 | |
81 | x 8aaa48160adc (draft): A0
82 |/
83 o 1e4be0697311 (public): root
84
85
86 Actual testing
87 --------------
88
89 $ hg push
90 pushing to $TESTTMP/B8/server (glob)
91 searching for changes
92 adding changesets
93 adding manifests
94 adding file changes
95 added 1 changesets with 1 changes to 1 files (+1 heads)
96 4 new obsolescence markers
97
98 $ cd ../..