Debian Codegraph @

tests/test-push-checkheads-unpushed-D4.t

raw
1 ====================================
2 Testing head checking code: Case D-4
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 D: remote head is "obs-affected" locally, but result is not part of the push
12 TestCase 4: multi-changeset branch, split on multiple other, (base on its own new branch)
13
14 .. old-state:
15 ..
16 .. * 2 branch (1 changeset, and 2 changesets)
17 ..
18 .. new-state:
19 ..
20 .. * 1 new branch superseding the base of the old-2-changesets-branch,
21 .. * 1 new changesets on the old-1-changeset-branch superseding the head of the other
22 ..
23 .. expected-result:
24 ..
25 .. * push the new branch only -> push denied (variant a)
26 .. * push the existing branch only -> push allowed (variant b)
27 .. (pushing all is tested as case A-7)
28 ..
29 .. graph-summary:
30 ..
31 .. (variant a)
32 ..
33 .. B'○⇢ø B
34 .. | |
35 .. A | ø⇠◔ A'
36 .. | |/
37 .. C ● |
38 .. \|
39 .. ●
40 ..
41 .. or (variant b)
42 ..
43 .. B'◔⇢ø B
44 .. | |
45 .. A | ø⇠○ A'
46 .. | |/
47 .. C ● |
48 .. \|
49 .. ●
50
51 $ . $TESTDIR/testlib/push-checkheads-util.sh
52
53 Test setup
54 ----------
55
56 $ mkdir D4
57 $ cd D4
58 $ setuprepos
59 creating basic server and client repo
60 updating to branch default
61 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
62 $ cd server
63 $ mkcommit B0
64 $ hg up 0
65 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
66 $ mkcommit C0
67 created new head
68 $ cd ../client
69 $ hg pull
70 pulling from $TESTTMP/D4/server
71 searching for changes
72 adding changesets
73 adding manifests
74 adding file changes
75 added 2 changesets with 2 changes to 2 files (+1 heads)
76 new changesets d73caddc5533:0f88766e02d6 (2 drafts)
77 (run 'hg heads' to see heads, 'hg merge' to merge)
78 $ hg up 0
79 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
80 $ mkcommit A1
81 created new head
82 $ hg up 'desc(C0)'
83 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
84 $ mkcommit B1
85 $ hg debugobsolete `getid "desc(A0)" ` `getid "desc(A1)"`
86 1 new obsolescence markers
87 obsoleted 1 changesets
88 1 new orphan changesets
89 $ hg debugobsolete `getid "desc(B0)" ` `getid "desc(B1)"`
90 1 new obsolescence markers
91 obsoleted 1 changesets
92 $ hg log -G --hidden
93 @ d70a1f75a020 (draft): B1
94 |
95 | o f6082bc4ffef (draft): A1
96 | |
97 o | 0f88766e02d6 (draft): C0
98 |/
99 | x d73caddc5533 (draft): B0
100 | |
101 | x 8aaa48160adc (draft): A0
102 |/
103 o 1e4be0697311 (public): root
104
105
106 Actual testing (new branch only)
107 --------------------------------
108
109 $ hg push --rev 'desc(A1)'
110 pushing to $TESTTMP/D4/server
111 searching for changes
112 abort: push creates new remote head f6082bc4ffef
113 (merge or see 'hg help push' for details about pushing new heads)
114 [20]
115
116 Actual testing (existing branch only)
117 ------------------------------------
118
119 $ hg push --rev 'desc(B1)'
120 pushing to $TESTTMP/D4/server
121 searching for changes
122 adding changesets
123 adding manifests
124 adding file changes
125 added 1 changesets with 1 changes to 1 files
126 1 new obsolescence markers
127 obsoleted 1 changesets
128
129 $ cd ../..