|
1 ===================== |
|
2 Test workflow options |
|
3 ===================== |
|
4 |
|
5 $ . "$TESTDIR/testlib/topic_setup.sh" |
|
6 $ . "$TESTDIR/testlib/common.sh" |
|
7 |
|
8 Test single head enforcing - Setup |
|
9 ============================================= |
|
10 |
|
11 $ hg init single-head-server |
|
12 $ cd single-head-server |
|
13 $ cat <<EOF >> .hg/hgrc |
|
14 > [phases] |
|
15 > publish = no |
|
16 > [experimental] |
|
17 > enforce-single-head = yes |
|
18 > evolution = all |
|
19 > EOF |
|
20 $ mkcommit ROOT |
|
21 $ mkcommit c_dA0 |
|
22 $ cd .. |
|
23 |
|
24 $ hg clone single-head-server client |
|
25 updating to branch default |
|
26 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
27 |
|
28 Test single head enforcing - with branch only |
|
29 --------------------------------------------- |
|
30 |
|
31 $ cd client |
|
32 |
|
33 continuing the current defaultbranch |
|
34 |
|
35 $ mkcommit c_dB0 |
|
36 $ hg push |
|
37 pushing to $TESTTMP/single-head-server |
|
38 searching for changes |
|
39 adding changesets |
|
40 adding manifests |
|
41 adding file changes |
|
42 added 1 changesets with 1 changes to 1 files |
|
43 |
|
44 creating a new branch |
|
45 |
|
46 $ hg up 'desc("ROOT")' |
|
47 0 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
48 $ hg branch branch_A |
|
49 marked working directory as branch branch_A |
|
50 (branches are permanent and global, did you want a bookmark?) |
|
51 $ mkcommit c_aC0 |
|
52 $ hg push --new-branch |
|
53 pushing to $TESTTMP/single-head-server |
|
54 searching for changes |
|
55 adding changesets |
|
56 adding manifests |
|
57 adding file changes |
|
58 added 1 changesets with 1 changes to 1 files (+1 heads) |
|
59 |
|
60 Create a new head on the default branch |
|
61 |
|
62 $ hg up 'desc("c_dA0")' |
|
63 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
64 $ mkcommit c_dD0 |
|
65 created new head |
|
66 $ hg push -f |
|
67 pushing to $TESTTMP/single-head-server |
|
68 searching for changes |
|
69 adding changesets |
|
70 adding manifests |
|
71 adding file changes |
|
72 added 1 changesets with 1 changes to 1 files (+1 heads) |
|
73 transaction abort! |
|
74 rollback completed |
|
75 abort: 2 heads on "default" |
|
76 (286d02a6e2a2, 9bf953aa81f6) |
|
77 [255] |
|
78 |
|
79 remerge them |
|
80 |
|
81 $ hg merge |
|
82 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
83 (branch merge, don't forget to commit) |
|
84 $ mkcommit c_dE0 |
|
85 $ hg push |
|
86 pushing to $TESTTMP/single-head-server |
|
87 searching for changes |
|
88 adding changesets |
|
89 adding manifests |
|
90 adding file changes |
|
91 added 2 changesets with 2 changes to 2 files |
|
92 |
|
93 Test single head enforcing - with topic |
|
94 --------------------------------------- |
|
95 |
|
96 pushing a new topic |
|
97 |
|
98 $ hg topic foo |
|
99 marked working directory as topic: foo |
|
100 $ mkcommit c_dF0 |
|
101 active topic 'foo' grew its first changeset |
|
102 $ hg push |
|
103 pushing to $TESTTMP/single-head-server |
|
104 searching for changes |
|
105 adding changesets |
|
106 adding manifests |
|
107 adding file changes |
|
108 added 1 changesets with 1 changes to 1 files |
|
109 |
|
110 pushing a new topo branch (with a topic) |
|
111 |
|
112 $ hg up 'desc("c_dD0")' |
|
113 0 files updated, 0 files merged, 3 files removed, 0 files unresolved |
|
114 $ hg topic bar |
|
115 marked working directory as topic: bar |
|
116 $ mkcommit c_dG0 |
|
117 active topic 'bar' grew its first changeset |
|
118 $ hg push |
|
119 pushing to $TESTTMP/single-head-server |
|
120 searching for changes |
|
121 adding changesets |
|
122 adding manifests |
|
123 adding file changes |
|
124 added 1 changesets with 1 changes to 1 files (+1 heads) |
|
125 |
|
126 detect multiple heads on the topic |
|
127 |
|
128 $ mkcommit c_dH0 |
|
129 $ hg push |
|
130 pushing to $TESTTMP/single-head-server |
|
131 searching for changes |
|
132 adding changesets |
|
133 adding manifests |
|
134 adding file changes |
|
135 added 1 changesets with 1 changes to 1 files |
|
136 $ hg up 'desc("c_dG0")' |
|
137 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
138 $ mkcommit c_dI0 |
|
139 $ hg push -f |
|
140 pushing to $TESTTMP/single-head-server |
|
141 searching for changes |
|
142 adding changesets |
|
143 adding manifests |
|
144 adding file changes |
|
145 added 1 changesets with 1 changes to 1 files (+1 heads) |
|
146 transaction abort! |
|
147 rollback completed |
|
148 abort: 2 heads on "default:bar" |
|
149 (5194f5dcd542, 48a01453c1c5) |
|
150 [255] |
|
151 |
|
152 merge works fine |
|
153 |
|
154 $ hg merge |
|
155 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
156 (branch merge, don't forget to commit) |
|
157 $ mkcommit c_dJ0 |
|
158 $ hg push |
|
159 pushing to $TESTTMP/single-head-server |
|
160 searching for changes |
|
161 adding changesets |
|
162 adding manifests |
|
163 adding file changes |
|
164 added 2 changesets with 2 changes to 2 files |
|
165 |
|
166 Test single head enforcing - by phase move |
|
167 ------------------------------------------ |
|
168 |
|
169 $ hg -R ../single-head-server phase --public 'desc("c_dJ0")' |
|
170 abort: 2 heads on "default" |
|
171 (6ed1df20edb1, 678bca4de98c) |
|
172 [255] |
|
173 |
|
174 Test single head enforcing - after rewrite |
|
175 ------------------------------------------ |
|
176 |
|
177 $ hg up foo |
|
178 switching to topic foo |
|
179 3 files updated, 0 files merged, 4 files removed, 0 files unresolved |
|
180 $ hg commit --amend -m c_dF1 |
|
181 $ hg push |
|
182 pushing to $TESTTMP/single-head-server |
|
183 searching for changes |
|
184 adding changesets |
|
185 adding manifests |
|
186 adding file changes |
|
187 added 1 changesets with 0 changes to 1 files (+1 heads) |
|
188 1 new obsolescence markers |
|
189 obsoleted 1 changesets |