##// END OF EJS Templates
enforcesinglehead-test: add the expected node output next to the error...
marmoute -
r47813:54589bb9 default
parent child Browse files
Show More
@@ -1,388 +1,391 b''
1 1 =====================
2 2 Test workflow options
3 3 =====================
4 4
5 5 $ . "$TESTDIR/testlib/obsmarker-common.sh"
6 6
7 7 Test single head enforcing - Setup
8 8 =============================================
9 9
10 10 $ cat << EOF >> $HGRCPATH
11 11 > [experimental]
12 12 > evolution = all
13 13 > EOF
14 14 $ hg init single-head-server
15 15 $ cd single-head-server
16 16 $ cat <<EOF >> .hg/hgrc
17 17 > [phases]
18 18 > publish = no
19 19 > [experimental]
20 20 > single-head-per-branch = yes
21 21 > EOF
22 22 $ mkcommit ROOT
23 23 $ mkcommit c_dA0
24 24 $ cd ..
25 25
26 26 $ hg clone single-head-server client
27 27 updating to branch default
28 28 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
29 29
30 30 Test single head enforcing - with branch only
31 31 ---------------------------------------------
32 32
33 33 $ cd client
34 34
35 35 continuing the current defaultbranch
36 36
37 37 $ mkcommit c_dB0
38 38 $ hg push
39 39 pushing to $TESTTMP/single-head-server
40 40 searching for changes
41 41 adding changesets
42 42 adding manifests
43 43 adding file changes
44 44 added 1 changesets with 1 changes to 1 files
45 45
46 46 creating a new branch
47 47
48 48 $ hg up 'desc("ROOT")'
49 49 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
50 50 $ hg branch branch_A
51 51 marked working directory as branch branch_A
52 52 (branches are permanent and global, did you want a bookmark?)
53 53 $ mkcommit c_aC0
54 54 $ hg push --new-branch
55 55 pushing to $TESTTMP/single-head-server
56 56 searching for changes
57 57 adding changesets
58 58 adding manifests
59 59 adding file changes
60 60 added 1 changesets with 1 changes to 1 files (+1 heads)
61 61
62 62 Create a new head on the default branch
63 63
64 64 $ hg up 'desc("c_dA0")'
65 65 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
66 66 $ mkcommit c_dD0
67 67 created new head
68 $ hg log -r 'heads(::branch("default"))' -T '{node|short}\n'
69 286d02a6e2a2
70 9bf953aa81f6
68 71 $ hg push -f
69 72 pushing to $TESTTMP/single-head-server
70 73 searching for changes
71 74 adding changesets
72 75 adding manifests
73 76 adding file changes
74 77 transaction abort!
75 78 rollback completed
76 79 abort: rejecting multiple heads on branch "default"
77 80 (2 heads: 286d02a6e2a2 9bf953aa81f6)
78 81 [255]
79 82
80 83 remerge them
81 84
82 85 $ hg merge
83 86 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
84 87 (branch merge, don't forget to commit)
85 88 $ mkcommit c_dE0
86 89 $ hg push
87 90 pushing to $TESTTMP/single-head-server
88 91 searching for changes
89 92 adding changesets
90 93 adding manifests
91 94 adding file changes
92 95 added 2 changesets with 2 changes to 2 files
93 96
94 97 Test single head enforcing - after rewrite
95 98 ------------------------------------------
96 99
97 100 $ mkcommit c_dF0
98 101 $ hg push
99 102 pushing to $TESTTMP/single-head-server
100 103 searching for changes
101 104 adding changesets
102 105 adding manifests
103 106 adding file changes
104 107 added 1 changesets with 1 changes to 1 files
105 108 $ hg commit --amend -m c_dF1
106 109 $ hg push
107 110 pushing to $TESTTMP/single-head-server
108 111 searching for changes
109 112 adding changesets
110 113 adding manifests
111 114 adding file changes
112 115 added 1 changesets with 0 changes to 1 files (+1 heads)
113 116 1 new obsolescence markers
114 117 obsoleted 1 changesets
115 118
116 119 Check it does not interfer with strip
117 120 -------------------------------------
118 121
119 122 setup
120 123
121 124 $ hg branch branch_A --force
122 125 marked working directory as branch branch_A
123 126 $ mkcommit c_aG0
124 127 created new head
125 128 $ hg update 'desc("c_dF1")'
126 129 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
127 130 $ mkcommit c_dH0
128 131 $ hg update 'desc("c_aG0")'
129 132 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
130 133 $ hg merge
131 134 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
132 135 (branch merge, don't forget to commit)
133 136 $ mkcommit c_aI0
134 137 $ hg log -G
135 138 @ changeset: 10:49003e504178
136 139 |\ branch: branch_A
137 140 | | tag: tip
138 141 | | parent: 8:a33fb808fb4b
139 142 | | parent: 3:840af1c6bc88
140 143 | | user: test
141 144 | | date: Thu Jan 01 00:00:00 1970 +0000
142 145 | | summary: c_aI0
143 146 | |
144 147 | | o changeset: 9:fe47ea669cea
145 148 | | | parent: 7:99a2dc242c5d
146 149 | | | user: test
147 150 | | | date: Thu Jan 01 00:00:00 1970 +0000
148 151 | | | summary: c_dH0
149 152 | | |
150 153 | o | changeset: 8:a33fb808fb4b
151 154 | |/ branch: branch_A
152 155 | | user: test
153 156 | | date: Thu Jan 01 00:00:00 1970 +0000
154 157 | | summary: c_aG0
155 158 | |
156 159 | o changeset: 7:99a2dc242c5d
157 160 | | parent: 5:6ed1df20edb1
158 161 | | user: test
159 162 | | date: Thu Jan 01 00:00:00 1970 +0000
160 163 | | summary: c_dF1
161 164 | |
162 165 | o changeset: 5:6ed1df20edb1
163 166 | |\ parent: 4:9bf953aa81f6
164 167 | | | parent: 2:286d02a6e2a2
165 168 | | | user: test
166 169 | | | date: Thu Jan 01 00:00:00 1970 +0000
167 170 | | | summary: c_dE0
168 171 | | |
169 172 | | o changeset: 4:9bf953aa81f6
170 173 | | | parent: 1:134bc3852ad2
171 174 | | | user: test
172 175 | | | date: Thu Jan 01 00:00:00 1970 +0000
173 176 | | | summary: c_dD0
174 177 | | |
175 178 o | | changeset: 3:840af1c6bc88
176 179 | | | branch: branch_A
177 180 | | | parent: 0:ea207398892e
178 181 | | | user: test
179 182 | | | date: Thu Jan 01 00:00:00 1970 +0000
180 183 | | | summary: c_aC0
181 184 | | |
182 185 | o | changeset: 2:286d02a6e2a2
183 186 | |/ user: test
184 187 | | date: Thu Jan 01 00:00:00 1970 +0000
185 188 | | summary: c_dB0
186 189 | |
187 190 | o changeset: 1:134bc3852ad2
188 191 |/ user: test
189 192 | date: Thu Jan 01 00:00:00 1970 +0000
190 193 | summary: c_dA0
191 194 |
192 195 o changeset: 0:ea207398892e
193 196 user: test
194 197 date: Thu Jan 01 00:00:00 1970 +0000
195 198 summary: ROOT
196 199
197 200
198 201 actual stripping
199 202
200 203 $ hg strip --config extensions.strip= --rev 'desc("c_dH0")'
201 204 saved backup bundle to $TESTTMP/client/.hg/strip-backup/fe47ea669cea-a41bf5a9-backup.hg
202 205
203 206 Test that closing heads are ignored by default
204 207 -----------------------------------------------
205 208
206 209 $ hg up 'desc("c_aG0")'
207 210 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
208 211 $ mkcommit c_aJ0
209 212 created new head
210 213
211 214 pushing the new head should fails
212 215
213 216 $ hg push -f
214 217 pushing to $TESTTMP/single-head-server
215 218 searching for changes
216 219 adding changesets
217 220 adding manifests
218 221 adding file changes
219 222 transaction abort!
220 223 rollback completed
221 224 abort: rejecting multiple heads on branch "branch_A"
222 225 (2 heads: 49003e504178 468bd81ccc5d)
223 226 [255]
224 227
225 228
226 229 closing the head and pushing should succeed
227 230
228 231 $ mkcommit c_aK0 --close-branch
229 232 $ hg push -f
230 233 pushing to $TESTTMP/single-head-server
231 234 searching for changes
232 235 adding changesets
233 236 adding manifests
234 237 adding file changes
235 238 added 4 changesets with 4 changes to 4 files (-1 heads)
236 239
237 240
238 241 Test that closing heads can be explicitly accounted for
239 242 -------------------------------------------------------
240 243
241 244 $ cat <<EOF >> $TESTTMP/single-head-server/.hg/hgrc
242 245 > [experimental]
243 246 > single-head-per-branch:account-closed-heads = yes
244 247 > EOF
245 248
246 249 $ hg up 'desc("c_aG0")'
247 250 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
248 251 $ mkcommit c_aL0
249 252 created new head
250 253 $ mkcommit c_aM0 --close-branch
251 254 $ hg push -f
252 255 pushing to $TESTTMP/single-head-server
253 256 searching for changes
254 257 adding changesets
255 258 adding manifests
256 259 adding file changes
257 260 transaction abort!
258 261 rollback completed
259 262 abort: rejecting multiple heads on branch "branch_A"
260 263 (3 heads: 49003e504178 5254bcccab93 42b9fe70a3c1)
261 264 [255]
262 265
263 266
264 267 Test that config can be overriden as the boolean it is
265 268 ------------------------------------------------------
266 269
267 270 $ cat <<EOF >> $TESTTMP/single-head-server/.hg/hgrc
268 271 > [experimental]
269 272 > single-head-per-branch = no
270 273 > EOF
271 274
272 275 Because of previous test, we'll also push c_aL0 and c_aM0.
273 276
274 277 $ hg out -T "{desc}\n"
275 278 comparing with $TESTTMP/single-head-server
276 279 searching for changes
277 280 c_aL0
278 281 c_aM0
279 282
280 283 Let's make a new head and push everything. The server feedback will mention
281 284 exactly one new head because c_aM0 is closed.
282 285
283 286 $ hg up 'desc("c_aG0")'
284 287 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
285 288 $ mkcommit c_aN0
286 289 created new head
287 290 $ hg push -f
288 291 pushing to $TESTTMP/single-head-server
289 292 searching for changes
290 293 adding changesets
291 294 adding manifests
292 295 adding file changes
293 296 added 3 changesets with 3 changes to 3 files (+1 heads)
294 297 $ cd ..
295 298
296 299
297 300 Test that singe-head-per-branch can be restricted to public changes
298 301 -------------------------------------------------------------------
299 302
300 303 $ hg clone -r 49003e504178 single-head-server public-only
301 304 adding changesets
302 305 adding manifests
303 306 adding file changes
304 307 added 9 changesets with 9 changes to 9 files
305 308 1 new obsolescence markers
306 309 new changesets ea207398892e:49003e504178 (9 drafts)
307 310 updating to branch branch_A
308 311 9 files updated, 0 files merged, 0 files removed, 0 files unresolved
309 312 $ cd public-only
310 313 $ cat <<EOF >> .hg/hgrc
311 314 > [phases]
312 315 > publish = no
313 316 > [experimental]
314 317 > single-head-per-branch = yes
315 318 > single-head-per-branch:public-changes-only = yes
316 319 > EOF
317 320 > hg phase -p :
318 321 $ hg update 'desc("c_aG0")'
319 322 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
320 323 $ mkcommit c_dO0
321 324 created new head
322 325 $ hg log -G
323 326 @ changeset: 9:8058fd35cc2b
324 327 | branch: branch_A
325 328 | tag: tip
326 329 | parent: 7:a33fb808fb4b
327 330 | user: test
328 331 | date: Thu Jan 01 00:00:00 1970 +0000
329 332 | summary: c_dO0
330 333 |
331 334 | o changeset: 8:49003e504178
332 335 |/| branch: branch_A
333 336 | | parent: 7:a33fb808fb4b
334 337 | | parent: 3:840af1c6bc88
335 338 | | user: test
336 339 | | date: Thu Jan 01 00:00:00 1970 +0000
337 340 | | summary: c_aI0
338 341 | |
339 342 o | changeset: 7:a33fb808fb4b
340 343 | | branch: branch_A
341 344 | | user: test
342 345 | | date: Thu Jan 01 00:00:00 1970 +0000
343 346 | | summary: c_aG0
344 347 | |
345 348 o | changeset: 6:99a2dc242c5d
346 349 | | user: test
347 350 | | date: Thu Jan 01 00:00:00 1970 +0000
348 351 | | summary: c_dF1
349 352 | |
350 353 o | changeset: 5:6ed1df20edb1
351 354 |\ \ parent: 4:9bf953aa81f6
352 355 | | | parent: 2:286d02a6e2a2
353 356 | | | user: test
354 357 | | | date: Thu Jan 01 00:00:00 1970 +0000
355 358 | | | summary: c_dE0
356 359 | | |
357 360 | o | changeset: 4:9bf953aa81f6
358 361 | | | parent: 1:134bc3852ad2
359 362 | | | user: test
360 363 | | | date: Thu Jan 01 00:00:00 1970 +0000
361 364 | | | summary: c_dD0
362 365 | | |
363 366 | | o changeset: 3:840af1c6bc88
364 367 | | | branch: branch_A
365 368 | | | parent: 0:ea207398892e
366 369 | | | user: test
367 370 | | | date: Thu Jan 01 00:00:00 1970 +0000
368 371 | | | summary: c_aC0
369 372 | | |
370 373 o | | changeset: 2:286d02a6e2a2
371 374 |/ / user: test
372 375 | | date: Thu Jan 01 00:00:00 1970 +0000
373 376 | | summary: c_dB0
374 377 | |
375 378 o | changeset: 1:134bc3852ad2
376 379 |/ user: test
377 380 | date: Thu Jan 01 00:00:00 1970 +0000
378 381 | summary: c_dA0
379 382 |
380 383 o changeset: 0:ea207398892e
381 384 user: test
382 385 date: Thu Jan 01 00:00:00 1970 +0000
383 386 summary: ROOT
384 387
385 388 $ hg phase -p .
386 389 abort: rejecting multiple heads on branch "branch_A"
387 390 (2 heads: 49003e504178 8058fd35cc2b)
388 391 [255]
General Comments 0
You need to be logged in to leave comments. Login now