Mercurial > evolve
annotate tests/test-single-head-obsolescence-topic-B5.t @ 6073:6b67f26f4667 mercurial-4.8
test-compat: merge mercurial-4.9 into mercurial-4.8
# no-check-commit
author | Anton Shestakov <av6@dwimlabs.net> |
---|---|
date | Tue, 12 Oct 2021 13:46:30 +0300 |
parents | 35e769c9604f |
children | c915d9441654 |
rev | line source |
---|---|
5227
b20d04641c0f
head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
1 ========================================= |
b20d04641c0f
head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
2 Testing single head enforcement: Case A-1 |
b20d04641c0f
head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
3 ========================================= |
b20d04641c0f
head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
4 |
b20d04641c0f
head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
5 A repository is set to only accept a single head per name (typically named |
b20d04641c0f
head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
6 branch). However, obsolete changesets can make this enforcement more |
b20d04641c0f
head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
7 complicated, because they can be kept visible by other changeset on other |
b20d04641c0f
head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
8 branch. |
b20d04641c0f
head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
9 |
b20d04641c0f
head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
10 This case is part of a series of tests checking this behavior. |
b20d04641c0f
head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
11 |
b20d04641c0f
head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
12 Category A: Involving obsolescence |
b20d04641c0f
head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
13 TestCase 1: obsoleting a merge reveal two heads |
b20d04641c0f
head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
14 |
b20d04641c0f
head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
15 .. old-state: |
b20d04641c0f
head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
16 .. |
5229
fa1324e58fcf
head-checking: also test single head enforcement with topic
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
5227
diff
changeset
|
17 .. * 3 changeset changeset on topic X (2 on their own branch + 1 merge) |
fa1324e58fcf
head-checking: also test single head enforcement with topic
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
5227
diff
changeset
|
18 .. * 1 changeset on topic Y (children of the merge) |
5227
b20d04641c0f
head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
19 .. |
b20d04641c0f
head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
20 .. new-state: |
b20d04641c0f
head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
21 .. |
5229
fa1324e58fcf
head-checking: also test single head enforcement with topic
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
5227
diff
changeset
|
22 .. * 2 changeset changeset on topic X (merge is obsolete) each a head |
fa1324e58fcf
head-checking: also test single head enforcement with topic
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
5227
diff
changeset
|
23 .. * 1 changeset on topic Y keeping the merge visible |
5227
b20d04641c0f
head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
24 .. |
b20d04641c0f
head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
25 .. expected-result: |
b20d04641c0f
head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
26 .. |
b20d04641c0f
head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
27 .. * 2 heads detected (because we skip the merge). |
b20d04641c0f
head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
28 .. |
b20d04641c0f
head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
29 .. graph-summary: |
b20d04641c0f
head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
30 .. |
5229
fa1324e58fcf
head-checking: also test single head enforcement with topic
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
5227
diff
changeset
|
31 .. D ● (topic-Y) |
5227
b20d04641c0f
head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
32 .. | |
5229
fa1324e58fcf
head-checking: also test single head enforcement with topic
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
5227
diff
changeset
|
33 .. C ● (topic-Y) |
5227
b20d04641c0f
head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
34 .. | |
5229
fa1324e58fcf
head-checking: also test single head enforcement with topic
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
5227
diff
changeset
|
35 .. M ⊗ (topic-X) |
5227
b20d04641c0f
head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
36 .. |\ |
5229
fa1324e58fcf
head-checking: also test single head enforcement with topic
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
5227
diff
changeset
|
37 .. A ● ● B (topic-X) |
5227
b20d04641c0f
head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
38 .. |/ |
b20d04641c0f
head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
39 .. ● |
b20d04641c0f
head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
40 |
b20d04641c0f
head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
41 $ . $TESTDIR/testlib/topic_setup.sh |
b20d04641c0f
head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
42 $ . $TESTDIR/testlib/push-checkheads-util.sh |
b20d04641c0f
head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
43 |
b20d04641c0f
head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
44 Test setup |
b20d04641c0f
head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
45 ---------- |
b20d04641c0f
head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
46 |
5229
fa1324e58fcf
head-checking: also test single head enforcement with topic
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
5227
diff
changeset
|
47 $ mkdir B5 |
fa1324e58fcf
head-checking: also test single head enforcement with topic
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
5227
diff
changeset
|
48 $ cd B5 |
5227
b20d04641c0f
head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
49 $ setuprepos single-head |
b20d04641c0f
head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
50 creating basic server and client repo |
b20d04641c0f
head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
51 updating to branch default |
b20d04641c0f
head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
52 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
b20d04641c0f
head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
53 $ cd client |
5229
fa1324e58fcf
head-checking: also test single head enforcement with topic
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
5227
diff
changeset
|
54 $ hg topic -r . topic-X |
fa1324e58fcf
head-checking: also test single head enforcement with topic
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
5227
diff
changeset
|
55 switching to topic topic-X |
fa1324e58fcf
head-checking: also test single head enforcement with topic
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
5227
diff
changeset
|
56 changed topic on 1 changesets to "topic-X" |
fa1324e58fcf
head-checking: also test single head enforcement with topic
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
5227
diff
changeset
|
57 $ hg strip --config extensions.strip= --hidden 'hidden()' --no-backup # clean old A0 |
5227
b20d04641c0f
head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
58 $ hg up 0 |
b20d04641c0f
head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
59 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
5229
fa1324e58fcf
head-checking: also test single head enforcement with topic
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
5227
diff
changeset
|
60 $ hg topic topic-X |
fa1324e58fcf
head-checking: also test single head enforcement with topic
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
5227
diff
changeset
|
61 marked working directory as topic: topic-X |
5227
b20d04641c0f
head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
62 $ mkcommit B0 |
b20d04641c0f
head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
63 $ hg merge |
b20d04641c0f
head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
64 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
b20d04641c0f
head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
65 (branch merge, don't forget to commit) |
b20d04641c0f
head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
66 $ hg ci -m 'M0' |
5229
fa1324e58fcf
head-checking: also test single head enforcement with topic
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
5227
diff
changeset
|
67 $ hg topic topic-Y |
5227
b20d04641c0f
head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
68 $ mkcommit C0 |
5229
fa1324e58fcf
head-checking: also test single head enforcement with topic
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
5227
diff
changeset
|
69 active topic 'topic-Y' grew its first changeset |
fa1324e58fcf
head-checking: also test single head enforcement with topic
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
5227
diff
changeset
|
70 (see 'hg help topics' for more information) |
5227
b20d04641c0f
head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
71 $ hg push --new-branch |
5229
fa1324e58fcf
head-checking: also test single head enforcement with topic
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
5227
diff
changeset
|
72 pushing to $TESTTMP/B5/server |
5227
b20d04641c0f
head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
73 searching for changes |
b20d04641c0f
head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
74 adding changesets |
b20d04641c0f
head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
75 adding manifests |
b20d04641c0f
head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
76 adding file changes |
5229
fa1324e58fcf
head-checking: also test single head enforcement with topic
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
5227
diff
changeset
|
77 added 4 changesets with 2 changes to 3 files (+1 heads) |
fa1324e58fcf
head-checking: also test single head enforcement with topic
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
5227
diff
changeset
|
78 1 new obsolescence markers |
fa1324e58fcf
head-checking: also test single head enforcement with topic
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
5227
diff
changeset
|
79 obsoleted 1 changesets |
5227
b20d04641c0f
head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
80 $ hg up 0 |
b20d04641c0f
head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
81 0 files updated, 0 files merged, 3 files removed, 0 files unresolved |
b20d04641c0f
head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
82 $ mkcommit A1 |
b20d04641c0f
head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
83 $ mkcommit B1 |
b20d04641c0f
head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
84 $ hg debugobsolete `getid "desc(M0)"` --record-parents |
b20d04641c0f
head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
85 obsoleted 1 changesets |
b20d04641c0f
head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
86 1 new orphan changesets |
b20d04641c0f
head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
87 $ hg log -G --hidden |
b20d04641c0f
head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
88 @ 262c8c798096 [default] (draft): B1 |
b20d04641c0f
head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
89 | |
b20d04641c0f
head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
90 o f6082bc4ffef [default] (draft): A1 |
b20d04641c0f
head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
91 | |
5229
fa1324e58fcf
head-checking: also test single head enforcement with topic
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
5227
diff
changeset
|
92 | * 339fd31549ed [default:topic-Y] (draft): C0 |
5227
b20d04641c0f
head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
93 | | |
5229
fa1324e58fcf
head-checking: also test single head enforcement with topic
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
5227
diff
changeset
|
94 | x 33b3d4185449 [default:topic-X] (draft): M0 |
5227
b20d04641c0f
head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
95 | |\ |
5229
fa1324e58fcf
head-checking: also test single head enforcement with topic
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
5227
diff
changeset
|
96 +---o d3826ff42cf7 [default:topic-X] (draft): B0 |
5227
b20d04641c0f
head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
97 | | |
5229
fa1324e58fcf
head-checking: also test single head enforcement with topic
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
5227
diff
changeset
|
98 | o 5a47a98cd8e5 [default:topic-X] (draft): A0 |
5227
b20d04641c0f
head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
99 |/ |
b20d04641c0f
head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
100 o 1e4be0697311 [default] (public): root |
b20d04641c0f
head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
101 |
b20d04641c0f
head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
102 |
b20d04641c0f
head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
103 Actual testing |
b20d04641c0f
head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
104 -------------- |
b20d04641c0f
head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
105 |
b20d04641c0f
head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
106 (force push to make sure we get the changeset on the remote) |
b20d04641c0f
head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
107 |
b20d04641c0f
head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
108 $ hg push -r 'desc("C0")' --force |
5229
fa1324e58fcf
head-checking: also test single head enforcement with topic
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
5227
diff
changeset
|
109 pushing to $TESTTMP/B5/server |
5227
b20d04641c0f
head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
110 searching for changes |
b20d04641c0f
head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
111 no changes found |
5234
35e769c9604f
test-compat: merge mercurial-5.2 into mercurial-5.1
Anton Shestakov <av6@dwimlabs.net>
parents:
5229
diff
changeset
|
112 1 new obsolescence markers |
5227
b20d04641c0f
head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
113 transaction abort! |
b20d04641c0f
head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
114 rollback completed |
5229
fa1324e58fcf
head-checking: also test single head enforcement with topic
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
5227
diff
changeset
|
115 abort: rejecting multiple heads on branch "default:topic-X" |
fa1324e58fcf
head-checking: also test single head enforcement with topic
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
5227
diff
changeset
|
116 (2 heads: 5a47a98cd8e5 d3826ff42cf7) |
5227
b20d04641c0f
head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
117 [255] |