Debian Codegraph @

tests/test-push-checkheads-unpushed-D2.t

raw
1 ====================================
2 Testing head checking code: Case D-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 D: remote head is "obs-affected" locally, but result is not part of the push
12 TestCase 1: remote branch has 2 changes, head is pruned, other is rewritten but result is not pushed
13
14 .. old-state:
15 ..
16 .. * 1 changeset branch
17 ..
18 .. new-state:
19 ..
20 .. * old head is pruned
21 .. * 1 new branch succeeding to the other changeset in the old branch
22 .. * 1 new unrelated branch
23 ..
24 .. expected-result:
25 ..
26 .. * push allowed
27 .. * pushing only the unrelated branch: denied
28 ..
29 .. graph-summary:
30 ..
31 .. B ⊗
32 .. |
33 .. A ø⇠○ A'
34 .. |/
35 .. | ◔ C
36 .. |/
37 .. ●
38
39 $ . $TESTDIR/testlib/push-checkheads-util.sh
40
41 Test setup
42 ----------
43
44 $ mkdir D2
45 $ cd D2
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 server
51 $ mkcommit B0
52 $ cd ../client
53 $ hg pull
54 pulling from $TESTTMP/D2/server
55 searching for changes
56 adding changesets
57 adding manifests
58 adding file changes
59 added 1 changesets with 1 changes to 1 files
60 new changesets d73caddc5533 (1 drafts)
61 (run 'hg update' to get a working copy)
62 $ hg up 0
63 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
64 $ mkcommit A1
65 created new head
66 $ hg debugobsolete `getid "desc(A0)" ` `getid "desc(A1)"`
67 1 new obsolescence markers
68 obsoleted 1 changesets
69 1 new orphan changesets
70 $ hg debugobsolete --record-parents `getid "desc(B0)"`
71 1 new obsolescence markers
72 obsoleted 1 changesets
73 $ hg up 0
74 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
75 $ mkcommit C0
76 created new head
77 $ hg log -G --hidden
78 @ 0f88766e02d6 (draft): C0
79 |
80 | o f6082bc4ffef (draft): A1
81 |/
82 | x d73caddc5533 (draft): B0
83 | |
84 | x 8aaa48160adc (draft): A0
85 |/
86 o 1e4be0697311 (public): root
87
88
89 Actual testing
90 --------------
91
92 $ hg push --rev 'desc(C0)'
93 pushing to $TESTTMP/D2/server
94 searching for changes
95 abort: push creates new remote head 0f88766e02d6
96 (merge or see 'hg help push' for details about pushing new heads)
97 [20]
98
99 $ cd ../..