Debian Codegraph @

tests/test-push-checkheads-multibranches-E2.t

raw
1 ====================================
2 Testing head checking code: Case E-2
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 interleaved branch away from each other
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, aligned
22 .. * 1-changeset on branch Z (at the same location)
23 ..
24 .. expected-result:
25 ..
26 .. * push allowed
27 ..
28 .. graph-summary:
29 ..
30 .. C ø⇠◔ C'
31 .. | |
32 .. B ◔ |
33 .. | |
34 .. A ø⇠◔ A'
35 .. |/
36 .. ●
37
38 $ . $TESTDIR/testlib/push-checkheads-util.sh
39
40 Test setup
41 ----------
42
43 $ mkdir E1
44 $ cd E1
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 client
50 $ hg branch Z
51 marked working directory as branch Z
52 (branches are permanent and global, did you want a bookmark?)
53 $ mkcommit B0
54 $ hg branch default --force
55 marked working directory as branch default
56 $ mkcommit C0
57 created new head
58 $ hg push --new-branch
59 pushing to $TESTTMP/E1/server
60 searching for changes
61 adding changesets
62 adding manifests
63 adding file changes
64 added 2 changesets with 2 changes to 2 files
65 $ hg up 0
66 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
67 $ mkcommit A1
68 created new head
69 $ mkcommit C1
70 $ hg debugobsolete `getid "desc(A0)" ` `getid "desc(A1)"`
71 1 new obsolescence markers
72 obsoleted 1 changesets
73 2 new orphan changesets
74 $ hg debugobsolete `getid "desc(C0)" ` `getid "desc(C1)"`
75 1 new obsolescence markers
76 obsoleted 1 changesets
77 $ hg log -G --hidden
78 @ 0c76bc104656 (draft): C1
79 |
80 o f6082bc4ffef (draft): A1
81 |
82 | x afc55ba2ce61 (draft): C0
83 | |
84 | * 93e5c1321ece (draft): B0
85 | |
86 | x 8aaa48160adc (draft): A0
87 |/
88 o 1e4be0697311 (public): root
89
90
91 Actual testing
92 --------------
93
94 $ hg push -r 'desc("C1")'
95 pushing to $TESTTMP/E1/server
96 searching for changes
97 adding changesets
98 adding manifests
99 adding file changes
100 added 2 changesets with 2 changes to 2 files (+1 heads)
101 2 new obsolescence markers
102 obsoleted 2 changesets
103 1 new orphan changesets
104
105 $ cd ../..