1 ==================================== |
|
2 Testing head checking code: Case D-5 |
|
3 ==================================== |
|
4 |
|
5 Mercurial checks for the introduction of multiple heads on push. Evolution |
|
6 comes into play to detect if existing heads on the server are being replaced by |
|
7 some of the new heads we push. |
|
8 |
|
9 This test file 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 5: multi-changeset branch, split on multiple other, (head 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 superceeding the head of the old-2-changesets-branch, |
|
21 .. * 1 new changesets on the old-1-changeset-branch superceeding the base of the other |
|
22 .. |
|
23 .. expected-result: |
|
24 .. |
|
25 .. * push the new branch only -> push denied |
|
26 .. * push the existing branch only -> push allowed |
|
27 .. /!\ This push create unstability/orphaning on the other hand and we should |
|
28 .. probably detect/warn agains that. |
|
29 .. |
|
30 .. graph-summary: |
|
31 .. |
|
32 .. B ø⇠◔ B' |
|
33 .. | | |
|
34 .. A'◔⇢ø | |
|
35 .. | |/ |
|
36 .. C ● | |
|
37 .. \| |
|
38 .. ● |
|
39 |
|
40 $ . $TESTDIR/testlib/checkheads-util.sh |
|
41 |
|
42 Test setup |
|
43 ---------- |
|
44 |
|
45 $ setuprepos |
|
46 creating basic server and client repo |
|
47 updating to branch default |
|
48 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
49 $ cd server |
|
50 $ mkcommit B0 |
|
51 $ hg up 0 |
|
52 0 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
53 $ mkcommit C0 |
|
54 created new head |
|
55 $ cd ../client |
|
56 $ hg pull |
|
57 pulling from $TESTTMP/server |
|
58 searching for changes |
|
59 adding changesets |
|
60 adding manifests |
|
61 adding file changes |
|
62 added 2 changesets with 2 changes to 2 files (+1 heads) |
|
63 (run 'hg heads' to see heads, 'hg merge' to merge) |
|
64 $ hg up 'desc(C0)' |
|
65 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
66 $ mkcommit A1 |
|
67 $ hg up 0 |
|
68 0 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
69 $ mkcommit B1 |
|
70 created new head |
|
71 $ hg debugobsolete `getid "desc(A0)" ` `getid "desc(A1)"` |
|
72 $ hg debugobsolete `getid "desc(B0)" ` `getid "desc(B1)"` |
|
73 $ hg log -G --hidden |
|
74 @ 25c56d33e4c4 (draft): B1 |
|
75 | |
|
76 | o a0802eb7fc1b (draft): A1 |
|
77 | | |
|
78 | o 0f88766e02d6 (draft): C0 |
|
79 |/ |
|
80 | x d73caddc5533 (draft): B0 |
|
81 | | |
|
82 | x 8aaa48160adc (draft): A0 |
|
83 |/ |
|
84 o 1e4be0697311 (public): root |
|
85 |
|
86 |
|
87 |
|
88 Actual testing |
|
89 -------------- |
|
90 |
|
91 $ hg push --rev 'desc(B1)' |
|
92 pushing to $TESTTMP/server |
|
93 searching for changes |
|
94 abort: push creates new remote head 25c56d33e4c4! |
|
95 (merge or see 'hg help push' for details about pushing new heads) |
|
96 [255] |
|
97 $ hg push --rev 'desc(A1)' |
|
98 pushing to $TESTTMP/server |
|
99 searching for changes |
|
100 adding changesets |
|
101 adding manifests |
|
102 adding file changes |
|
103 added 1 changesets with 1 changes to 1 files |
|
104 1 new obsolescence markers |
|