|
1 ==================================== |
|
2 Testing head checking code: Case E-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 E: case involving changeset on multiple branch |
|
12 TestCase 8: moving only part of the interleaved branch away, creating 2 heads |
|
13 |
|
14 .. old-state: |
|
15 .. |
|
16 .. * 2-changeset on branch default |
|
17 .. * 1-changeset on topic Z (between the two other) |
|
18 .. |
|
19 .. new-state: |
|
20 .. |
|
21 .. * 2-changeset on branch default, on untouched, the other moved |
|
22 .. * 1-changeset on topic Z (at the same location) |
|
23 .. |
|
24 .. expected-result: |
|
25 .. |
|
26 .. * push rejected |
|
27 .. |
|
28 .. graph-summary: |
|
29 .. |
|
30 .. C ø⇠◔ C' branch default |
|
31 .. | | |
|
32 .. B ◔ | topic Z |
|
33 .. | | |
|
34 .. A ◔ | branch default |
|
35 .. |/ |
|
36 .. ● |
|
37 |
|
38 $ . $TESTDIR/testlib/topic_setup.sh |
|
39 $ . $TESTDIR/testlib/push-checkheads-util.sh |
|
40 |
|
41 Test setup |
|
42 ---------- |
|
43 |
|
44 $ mkdir E1 |
|
45 $ cd E1 |
|
46 $ setuprepos |
|
47 creating basic server and client repo |
|
48 updating to branch default |
|
49 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
50 $ cd client |
|
51 $ hg topic Z |
|
52 marked working directory as topic: Z |
|
53 $ mkcommit B0 |
|
54 active topic 'Z' grew its first changeset |
|
55 (see 'hg help topics' for more information) |
|
56 $ hg topic --clear |
|
57 $ mkcommit C0 |
|
58 created new head |
|
59 (consider using topic for lightweight branches. See 'hg help topic') |
|
60 $ hg push |
|
61 pushing to $TESTTMP/E1/server |
|
62 searching for changes |
|
63 adding changesets |
|
64 adding manifests |
|
65 adding file changes |
|
66 added 2 changesets with 2 changes to 2 files |
|
67 $ hg up 0 |
|
68 0 files updated, 0 files merged, 3 files removed, 0 files unresolved |
|
69 $ mkcommit C1 |
|
70 created new head |
|
71 (consider using topic for lightweight branches. See 'hg help topic') |
|
72 $ hg debugobsolete `getid "desc(C0)" ` `getid "desc(C1)"` |
|
73 1 new obsolescence markers |
|
74 obsoleted 1 changesets |
|
75 $ hg log -G --hidden |
|
76 @ dc44c53142f0 (draft): C1 |
|
77 | |
|
78 | x 44759c6d327d (draft): C0 |
|
79 | | |
|
80 | o 35d2f30a8ba4 (draft)[Z]: B0 |
|
81 | | |
|
82 | o 8aaa48160adc (draft): A0 |
|
83 |/ |
|
84 o 1e4be0697311 (public): root |
|
85 |
|
86 |
|
87 Actual testing |
|
88 -------------- |
|
89 |
|
90 $ hg push -r 'desc("C1")' |
|
91 pushing to $TESTTMP/E1/server |
|
92 searching for changes |
|
93 abort: push creates new remote head dc44c53142f0! |
|
94 (merge or see 'hg help push' for details about pushing new heads) |
|
95 [255] |
|
96 |
|
97 $ cd ../.. |