|
1 ========================================= |
|
2 Testing single head enforcement: Case A-1 |
|
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 B: Involving obsolescence and topic |
|
13 TestCase 1: A fully obsolete topic kept visible by another one. |
|
14 |
|
15 .. old-state: |
|
16 .. |
|
17 .. * 2 changeset changeset on topic X |
|
18 .. * 2 changeset changeset on topic Y on top of them. |
|
19 .. |
|
20 .. new-state: |
|
21 .. |
|
22 .. * 2 changeset changeset on topic Y at the same location |
|
23 .. * 2 changeset changeset on topic X superceeding the other ones |
|
24 .. |
|
25 .. expected-result: |
|
26 .. |
|
27 .. * only one head detected |
|
28 .. |
|
29 .. graph-summary: |
|
30 .. |
|
31 .. D ● (topic-Y) |
|
32 .. | |
|
33 .. C ● (topic-Y) |
|
34 .. | |
|
35 .. B ø⇠◔ B' (topic-X) |
|
36 .. | | |
|
37 .. A ø⇠◔ A' (topic-X) |
|
38 .. |/ |
|
39 .. ● |
|
40 |
|
41 $ . $TESTDIR/testlib/topic_setup.sh |
|
42 $ . $TESTDIR/testlib/push-checkheads-util.sh |
|
43 |
|
44 Test setup |
|
45 ---------- |
|
46 |
|
47 $ mkdir B1 |
|
48 $ cd B1 |
|
49 $ setuprepos single-head |
|
50 creating basic server and client repo |
|
51 updating to branch default |
|
52 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
53 $ cd client |
|
54 $ hg topic -r . topic-X |
|
55 switching to topic topic-X |
|
56 changed topic on 1 changesets to "topic-X" |
|
57 $ hg strip --config extensions.strip= --hidden 'hidden()' --no-backup # clean old A0 |
|
58 $ mkcommit B0 |
|
59 $ hg topic topic-Y |
|
60 $ mkcommit C0 |
|
61 active topic 'topic-Y' grew its first changeset |
|
62 (see 'hg help topics' for more information) |
|
63 $ mkcommit D0 |
|
64 $ hg push --new-branch |
|
65 pushing to $TESTTMP/B1/server |
|
66 searching for changes |
|
67 adding changesets |
|
68 adding manifests |
|
69 adding file changes |
|
70 added 4 changesets with 3 changes to 4 files (+1 heads) |
|
71 1 new obsolescence markers |
|
72 obsoleted 1 changesets |
|
73 $ hg up 0 |
|
74 0 files updated, 0 files merged, 4 files removed, 0 files unresolved |
|
75 $ hg topic topic-X |
|
76 marked working directory as topic: topic-X |
|
77 $ mkcommit A1 |
|
78 $ mkcommit B1 |
|
79 $ hg debugobsolete `getid "desc(A0)" ` `getid "desc(A1)"` |
|
80 1 new obsolescence markers |
|
81 obsoleted 1 changesets |
|
82 3 new orphan changesets |
|
83 $ hg debugobsolete `getid "desc(B0)" ` `getid "desc(B1)"` |
|
84 1 new obsolescence markers |
|
85 obsoleted 1 changesets |
|
86 $ hg log -G --hidden |
|
87 @ f4ed6717fb66 [default:topic-X] (draft): B1 |
|
88 | |
|
89 o c1340bef453e [default:topic-X] (draft): A1 |
|
90 | |
|
91 | * 618812b710f7 [default:topic-Y] (draft): D0 |
|
92 | | |
|
93 | * d1ad53773db2 [default:topic-Y] (draft): C0 |
|
94 | | |
|
95 | x 1c1f62b56685 [default:topic-X] (draft): B0 |
|
96 | | |
|
97 | x 5a47a98cd8e5 [default:topic-X] (draft): A0 |
|
98 |/ |
|
99 o 1e4be0697311 [default] (public): root |
|
100 |
|
101 |
|
102 Actual testing |
|
103 -------------- |
|
104 |
|
105 $ hg push -r 'desc("B1")' |
|
106 pushing to $TESTTMP/B1/server |
|
107 searching for changes |
|
108 adding changesets |
|
109 adding manifests |
|
110 adding file changes |
|
111 added 2 changesets with 2 changes to 2 files (+1 heads) |
|
112 2 new obsolescence markers |
|
113 obsoleted 2 changesets |
|
114 2 new orphan changesets |