|
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 A: Involving obsolescence |
|
13 TestCase 1: A fully obsolete branch kept visible by another one. |
|
14 |
|
15 .. old-state: |
|
16 .. |
|
17 .. * 2 changeset changeset on branch default |
|
18 .. * 2 changeset changeset on branch Z on top of them. |
|
19 .. |
|
20 .. new-state: |
|
21 .. |
|
22 .. * 2 changeset changeset on branch Z at the same location |
|
23 .. * 2 changeset changeset on branch default superceeding the other ones |
|
24 .. |
|
25 .. expected-result: |
|
26 .. |
|
27 .. * only one head detected |
|
28 .. |
|
29 .. graph-summary: |
|
30 .. |
|
31 .. D ● (branch Z) |
|
32 .. | |
|
33 .. C ● (branch Z) |
|
34 .. | |
|
35 .. B ø⇠◔ B' |
|
36 .. | | |
|
37 .. A ø⇠◔ A' |
|
38 .. |/ |
|
39 .. ● |
|
40 |
|
41 $ . $TESTDIR/testlib/topic_setup.sh |
|
42 $ . $TESTDIR/testlib/push-checkheads-util.sh |
|
43 |
|
44 Test setup |
|
45 ---------- |
|
46 |
|
47 $ mkdir A1 |
|
48 $ cd A1 |
|
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 $ mkcommit B0 |
|
55 $ hg branch Z |
|
56 marked working directory as branch Z |
|
57 (branches are permanent and global, did you want a bookmark?) |
|
58 $ mkcommit C0 |
|
59 $ mkcommit D0 |
|
60 $ hg push --new-branch |
|
61 pushing to $TESTTMP/A1/server |
|
62 searching for changes |
|
63 adding changesets |
|
64 adding manifests |
|
65 adding file changes |
|
66 added 3 changesets with 3 changes to 3 files |
|
67 $ hg up 0 |
|
68 0 files updated, 0 files merged, 4 files removed, 0 files unresolved |
|
69 $ mkcommit A1 |
|
70 created new head |
|
71 (consider using topic for lightweight branches. See 'hg help topic') |
|
72 $ mkcommit B1 |
|
73 $ hg debugobsolete `getid "desc(A0)" ` `getid "desc(A1)"` |
|
74 1 new obsolescence markers |
|
75 obsoleted 1 changesets |
|
76 3 new orphan changesets |
|
77 $ hg debugobsolete `getid "desc(B0)" ` `getid "desc(B1)"` |
|
78 1 new obsolescence markers |
|
79 obsoleted 1 changesets |
|
80 $ hg log -G --hidden |
|
81 @ 262c8c798096 [default] (draft): B1 |
|
82 | |
|
83 o f6082bc4ffef [default] (draft): A1 |
|
84 | |
|
85 | * cdf1dbb37a67 [Z] (draft): D0 |
|
86 | | |
|
87 | * 3213e3e16c67 [Z] (draft): C0 |
|
88 | | |
|
89 | x d73caddc5533 [default] (draft): B0 |
|
90 | | |
|
91 | x 8aaa48160adc [default] (draft): A0 |
|
92 |/ |
|
93 o 1e4be0697311 [default] (public): root |
|
94 |
|
95 |
|
96 Actual testing |
|
97 -------------- |
|
98 |
|
99 (force push to make sure we get the changeset on the remote) |
|
100 |
|
101 $ hg push -r 'desc("B1")' --force |
|
102 pushing to $TESTTMP/A1/server |
|
103 searching for changes |
|
104 adding changesets |
|
105 adding manifests |
|
106 adding file changes |
|
107 added 2 changesets with 2 changes to 2 files (+1 heads) |
|
108 2 new obsolescence markers |
|
109 obsoleted 2 changesets |
|
110 2 new orphan changesets |