|
1 ==================================== |
|
2 Testing head checking code: Case D-3 |
|
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 3: multi-changeset branch, split on multiple new others, only one of them is pushed |
|
13 |
|
14 .. old-state: |
|
15 .. |
|
16 .. * 2 changesets branch |
|
17 .. |
|
18 .. new-state: |
|
19 .. |
|
20 .. * 2 new branches, each superseding one changeset in the old one. |
|
21 .. |
|
22 .. expected-result: |
|
23 .. |
|
24 .. * pushing only one of the resulting branch (either of them) |
|
25 .. * push denied |
|
26 .. |
|
27 .. graph-summary: |
|
28 .. |
|
29 .. B'◔⇢ø B |
|
30 .. | | |
|
31 .. A | ø⇠◔ A' |
|
32 .. | |/ |
|
33 .. \| |
|
34 .. ● |
|
35 |
|
36 $ . $TESTDIR/testlib/push-checkheads-util.sh |
|
37 |
|
38 Test setup |
|
39 ---------- |
|
40 |
|
41 $ mkdir D3 |
|
42 $ cd D3 |
|
43 $ setuprepos |
|
44 creating basic server and client repo |
|
45 updating to branch default |
|
46 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
47 $ cd server |
|
48 $ mkcommit B0 |
|
49 $ hg up 0 |
|
50 0 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
51 $ cd ../client |
|
52 $ hg pull |
|
53 pulling from $TESTTMP/D3/server (glob) |
|
54 searching for changes |
|
55 adding changesets |
|
56 adding manifests |
|
57 adding file changes |
|
58 added 1 changesets with 1 changes to 1 files |
|
59 (run 'hg update' to get a working copy) |
|
60 $ hg up 0 |
|
61 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
62 $ mkcommit A1 |
|
63 created new head |
|
64 $ hg up '0' |
|
65 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
66 $ mkcommit B1 |
|
67 created new head |
|
68 $ hg debugobsolete `getid "desc(A0)" ` `getid "desc(A1)"` |
|
69 $ hg debugobsolete `getid "desc(B0)" ` `getid "desc(B1)"` |
|
70 $ hg log -G --hidden |
|
71 @ 25c56d33e4c4 (draft): B1 |
|
72 | |
|
73 | o f6082bc4ffef (draft): A1 |
|
74 |/ |
|
75 | x d73caddc5533 (draft): B0 |
|
76 | | |
|
77 | x 8aaa48160adc (draft): A0 |
|
78 |/ |
|
79 o 1e4be0697311 (public): root |
|
80 |
|
81 |
|
82 Actual testing |
|
83 -------------- |
|
84 |
|
85 $ hg push --rev 'desc(A1)' |
|
86 pushing to $TESTTMP/D3/server (glob) |
|
87 searching for changes |
|
88 abort: push creates new remote head f6082bc4ffef! |
|
89 (merge or see 'hg help push' for details about pushing new heads) |
|
90 [255] |
|
91 $ hg push --rev 'desc(B1)' |
|
92 pushing to $TESTTMP/D3/server (glob) |
|
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 |
|
98 Extra testing |
|
99 ------------- |
|
100 |
|
101 In this case, even a bare push is creating more heads |
|
102 |
|
103 $ hg push |
|
104 pushing to $TESTTMP/D3/server (glob) |
|
105 searching for changes |
|
106 abort: push creates new remote head 25c56d33e4c4! |
|
107 (merge or see 'hg help push' for details about pushing new heads) |
|
108 [255] |
|
109 |
|
110 $ cd ../.. |