|
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 branch 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 branch Z (at the same location) |
|
23 .. |
|
24 .. expected-result: |
|
25 .. |
|
26 .. * push rejected |
|
27 .. |
|
28 .. graph-summary: |
|
29 .. |
|
30 .. C ø⇠◔ C' |
|
31 .. | | |
|
32 .. B ◔ | |
|
33 .. | | |
|
34 .. A ◔ | |
|
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 branch Z |
|
52 marked working directory as branch Z |
|
53 (branches are permanent and global, did you want a bookmark?) |
|
54 $ mkcommit B0 |
|
55 $ hg branch default --force |
|
56 marked working directory as branch default |
|
57 $ mkcommit C0 |
|
58 created new head |
|
59 (consider using topic for lightweight branches. See 'hg help topic') |
|
60 $ hg push --new-branch |
|
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 afc55ba2ce61 (draft): C0 |
|
79 | | |
|
80 | o 93e5c1321ece (draft): 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 ../.. |