comparison tests/test-single-head-obsolescence-topic-B2.t @ 5229:fa1324e58fcf stable

head-checking: also test single head enforcement with topic They are an important part of why we want this.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Thu, 12 Mar 2020 02:08:39 +0100
parents tests/test-single-head-obsolescence-named-branch-A2.t@b20d04641c0f
children 35e769c9604f 144d10e74757
comparison
equal deleted inserted replaced
5228:f560d23639e1 5229:fa1324e58fcf
1
2 =========================================
3 Testing single head enforcement: Case A-2
4 =========================================
5
6 A repository is set to only accept a single head per name (typically named
7 branch). However, obsolete changesets can make this enforcement more
8 complicated, because they can be kept visible by other changeset on other
9 branch.
10
11 This case is part of a series of tests checking this behavior.
12
13 Category B: Involving obsolescence with topic
14 TestCase 2: A branch is split in two, effectively creating two heads
15
16 .. old-state:
17 ..
18 .. * 2 changeset changeset on topic X
19 .. * 2 changeset changeset on topic Y on top of them.
20 ..
21 .. new-state:
22 ..
23 .. * 2 changeset changeset on topic Y at the same location
24 .. * 1 changeset changeset on topic X unchanged
25 .. * 1 changeset changeset on topic X superceeding the other ones
26 ..
27 .. expected-result:
28 ..
29 .. * two heads detected
30 ..
31 .. graph-summary:
32 ..
33 .. D ● (topic-Y)
34 .. |
35 .. C ● (topic-Y)
36 .. |
37 .. B ø⇠◔ B' (topic-X)
38 .. | |
39 .. A ● | (topic-X)
40 .. |/
41 .. ●
42
43 $ . $TESTDIR/testlib/topic_setup.sh
44 $ . $TESTDIR/testlib/push-checkheads-util.sh
45
46 Test setup
47 ----------
48
49 $ mkdir B2
50 $ cd B2
51 $ setuprepos single-head
52 creating basic server and client repo
53 updating to branch default
54 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
55 $ cd client
56 $ hg topic -r . topic-X
57 switching to topic topic-X
58 changed topic on 1 changesets to "topic-X"
59 $ hg strip --config extensions.strip= --hidden 'hidden()' --no-backup # clean old A0
60 $ mkcommit B0
61 $ hg branch Z
62 marked working directory as branch Z
63 $ hg topic topic-Y
64 $ mkcommit C0
65 active topic 'topic-Y' grew its first changeset
66 (see 'hg help topics' for more information)
67 $ mkcommit D0
68 $ hg push --new-branch
69 pushing to $TESTTMP/B2/server
70 searching for changes
71 adding changesets
72 adding manifests
73 adding file changes
74 added 4 changesets with 3 changes to 4 files (+1 heads)
75 1 new obsolescence markers
76 obsoleted 1 changesets
77 $ hg up 0
78 0 files updated, 0 files merged, 4 files removed, 0 files unresolved
79 $ hg topic topic-X
80 marked working directory as topic: topic-X
81 $ mkcommit B1
82 $ hg debugobsolete `getid "desc(B0)" ` `getid "desc(B1)"`
83 1 new obsolescence markers
84 obsoleted 1 changesets
85 2 new orphan changesets
86 $ hg log -G --hidden
87 @ 5a4735b75167 [default:topic-X] (draft): B1
88 |
89 | * 02490b2dd1c5 [Z:topic-Y] (draft): D0
90 | |
91 | * 447ad8382abc [Z:topic-Y] (draft): C0
92 | |
93 | x 1c1f62b56685 [default:topic-X] (draft): B0
94 | |
95 | o 5a47a98cd8e5 [default:topic-X] (draft): A0
96 |/
97 o 1e4be0697311 [default] (public): root
98
99
100 Actual testing
101 --------------
102
103 (force push to make sure we get the changeset on the remote)
104
105 $ hg push -r 'desc("B1")' --force
106 pushing to $TESTTMP/B2/server
107 searching for changes
108 adding changesets
109 adding manifests
110 adding file changes
111 transaction abort!
112 rollback completed
113 abort: rejecting multiple heads on branch "default:topic-X"
114 (2 heads: 5a47a98cd8e5 5a4735b75167)
115 [255]