comparison tests/test-single-head-obsolescence-topic-B4.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-A4.t@b20d04641c0f
children 35e769c9604f 8cc7732a29bf
comparison
equal deleted inserted replaced
5228:f560d23639e1 5229:fa1324e58fcf
1 =========================================
2 Testing single head enforcement: Case A-4
3 =========================================
4
5 A repository is set to only accept a single head per name (typically named
6 branch). However, obsolete changesets can make this enforcement more
7 complicated, because they can be kept visible by other changeset on other
8 branch.
9
10 This case is part of a series of tests checking this behavior.
11
12 Category A: Involving obsolescence
13 TestCase 4: Partial rewrite of a branch to dis-interleave it
14
15 .. old-state:
16 ..
17 .. * 2 changeset changeset on topic X
18 .. * 2 changeset changeset on topic Y interleaved with the other one
19 ..
20 .. new-state:
21 ..
22 .. * 2 changeset changeset on topic Y at the same location
23 .. * 1 changeset on topic X untouched (the lower one)
24 .. * 1 changeset on topic X moved on the other one
25 ..
26 .. expected-result:
27 ..
28 .. * only one head detected
29 ..
30 .. graph-summary:
31 ..
32 .. D ● (topic-Y)
33 .. |
34 .. C ø⇠◔ C' (topic-X)
35 .. | |
36 .. B ● | (topic-Y)
37 .. |/
38 .. A ● (topic-X)
39 .. |
40 .. ●
41
42 $ . $TESTDIR/testlib/topic_setup.sh
43 $ . $TESTDIR/testlib/push-checkheads-util.sh
44
45 Test setup
46 ----------
47
48 $ mkdir B4
49 $ cd B4
50 $ setuprepos single-head
51 creating basic server and client repo
52 updating to branch default
53 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
54 $ cd client
55 $ hg topic -r . topic-X
56 switching to topic topic-X
57 changed topic on 1 changesets to "topic-X"
58 $ hg strip --config extensions.strip= --hidden 'hidden()' --no-backup # clean old A0
59 $ hg topic topic-Y
60 $ mkcommit B0
61 active topic 'topic-Y' grew its first changeset
62 (see 'hg help topics' for more information)
63 $ hg topic topic-X
64 $ mkcommit C0
65 $ hg topic topic-Y
66 $ mkcommit D0
67 $ hg push --new-branch
68 pushing to $TESTTMP/B4/server
69 searching for changes
70 adding changesets
71 adding manifests
72 adding file changes
73 added 4 changesets with 3 changes to 4 files (+1 heads)
74 1 new obsolescence markers
75 obsoleted 1 changesets
76 $ hg up 'desc("A0")'
77 switching to topic topic-X
78 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
79 $ hg topic topic-X
80 $ mkcommit C1
81 $ hg debugobsolete `getid "desc(C0)" ` `getid "desc(C1)"`
82 1 new obsolescence markers
83 obsoleted 1 changesets
84 1 new orphan changesets
85 $ hg log -G --hidden
86 @ b98a8bd4ca39 [default:topic-X] (draft): C1
87 |
88 | * 850d57e10bfe [default:topic-Y] (draft): D0
89 | |
90 | x fcdd583577e8 [default:topic-X] (draft): C0
91 | |
92 | o 030eec7a0fe2 [default:topic-Y] (draft): B0
93 |/
94 o 5a47a98cd8e5 [default:topic-X] (draft): A0
95 |
96 o 1e4be0697311 [default] (public): root
97
98
99 Actual testing
100 --------------
101
102 (force push to make sure we get the changeset on the remote)
103
104 $ hg push -r 'desc("C1")' --force
105 pushing to $TESTTMP/B4/server
106 searching for changes
107 adding changesets
108 adding manifests
109 adding file changes
110 added 1 changesets with 1 changes to 1 files (+1 heads)
111 1 new obsolescence markers
112 obsoleted 1 changesets
113 1 new orphan changesets