Mercurial > hg
comparison tests/test-single-head.t @ 46096:4d5e2fd53707
singlehead: introduce option to restrict to public changes
The new experimental.single-head-per-branch:public-changes-only option
restricts the single-head-per-branch filter to public changesets. This
is useful when serving one repository with different views as publishing
and non-publishing repository.
Differential Revision: https://phab.mercurial-scm.org/D9525
author | Joerg Sonnenberger <joerg@bec.de> |
---|---|
date | Sat, 05 Dec 2020 23:35:55 +0100 |
parents | 88a306478556 |
children | 54589bb9604d |
comparison
equal
deleted
inserted
replaced
46095:93e09d370003 | 46096:4d5e2fd53707 |
---|---|
275 comparing with $TESTTMP/single-head-server | 275 comparing with $TESTTMP/single-head-server |
276 searching for changes | 276 searching for changes |
277 c_aL0 | 277 c_aL0 |
278 c_aM0 | 278 c_aM0 |
279 | 279 |
280 Let's make a new head and push everythin. The server feedback will mention | 280 Let's make a new head and push everything. The server feedback will mention |
281 exactly one new head because c_aM0 is closed. | 281 exactly one new head because c_aM0 is closed. |
282 | 282 |
283 $ hg up 'desc("c_aG0")' | 283 $ hg up 'desc("c_aG0")' |
284 0 files updated, 0 files merged, 2 files removed, 0 files unresolved | 284 0 files updated, 0 files merged, 2 files removed, 0 files unresolved |
285 $ mkcommit c_aN0 | 285 $ mkcommit c_aN0 |
289 searching for changes | 289 searching for changes |
290 adding changesets | 290 adding changesets |
291 adding manifests | 291 adding manifests |
292 adding file changes | 292 adding file changes |
293 added 3 changesets with 3 changes to 3 files (+1 heads) | 293 added 3 changesets with 3 changes to 3 files (+1 heads) |
294 $ cd .. | |
295 | |
296 | |
297 Test that singe-head-per-branch can be restricted to public changes | |
298 ------------------------------------------------------------------- | |
299 | |
300 $ hg clone -r 49003e504178 single-head-server public-only | |
301 adding changesets | |
302 adding manifests | |
303 adding file changes | |
304 added 9 changesets with 9 changes to 9 files | |
305 1 new obsolescence markers | |
306 new changesets ea207398892e:49003e504178 (9 drafts) | |
307 updating to branch branch_A | |
308 9 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
309 $ cd public-only | |
310 $ cat <<EOF >> .hg/hgrc | |
311 > [phases] | |
312 > publish = no | |
313 > [experimental] | |
314 > single-head-per-branch = yes | |
315 > single-head-per-branch:public-changes-only = yes | |
316 > EOF | |
317 > hg phase -p : | |
318 $ hg update 'desc("c_aG0")' | |
319 0 files updated, 0 files merged, 2 files removed, 0 files unresolved | |
320 $ mkcommit c_dO0 | |
321 created new head | |
322 $ hg log -G | |
323 @ changeset: 9:8058fd35cc2b | |
324 | branch: branch_A | |
325 | tag: tip | |
326 | parent: 7:a33fb808fb4b | |
327 | user: test | |
328 | date: Thu Jan 01 00:00:00 1970 +0000 | |
329 | summary: c_dO0 | |
330 | | |
331 | o changeset: 8:49003e504178 | |
332 |/| branch: branch_A | |
333 | | parent: 7:a33fb808fb4b | |
334 | | parent: 3:840af1c6bc88 | |
335 | | user: test | |
336 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
337 | | summary: c_aI0 | |
338 | | | |
339 o | changeset: 7:a33fb808fb4b | |
340 | | branch: branch_A | |
341 | | user: test | |
342 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
343 | | summary: c_aG0 | |
344 | | | |
345 o | changeset: 6:99a2dc242c5d | |
346 | | user: test | |
347 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
348 | | summary: c_dF1 | |
349 | | | |
350 o | changeset: 5:6ed1df20edb1 | |
351 |\ \ parent: 4:9bf953aa81f6 | |
352 | | | parent: 2:286d02a6e2a2 | |
353 | | | user: test | |
354 | | | date: Thu Jan 01 00:00:00 1970 +0000 | |
355 | | | summary: c_dE0 | |
356 | | | | |
357 | o | changeset: 4:9bf953aa81f6 | |
358 | | | parent: 1:134bc3852ad2 | |
359 | | | user: test | |
360 | | | date: Thu Jan 01 00:00:00 1970 +0000 | |
361 | | | summary: c_dD0 | |
362 | | | | |
363 | | o changeset: 3:840af1c6bc88 | |
364 | | | branch: branch_A | |
365 | | | parent: 0:ea207398892e | |
366 | | | user: test | |
367 | | | date: Thu Jan 01 00:00:00 1970 +0000 | |
368 | | | summary: c_aC0 | |
369 | | | | |
370 o | | changeset: 2:286d02a6e2a2 | |
371 |/ / user: test | |
372 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
373 | | summary: c_dB0 | |
374 | | | |
375 o | changeset: 1:134bc3852ad2 | |
376 |/ user: test | |
377 | date: Thu Jan 01 00:00:00 1970 +0000 | |
378 | summary: c_dA0 | |
379 | | |
380 o changeset: 0:ea207398892e | |
381 user: test | |
382 date: Thu Jan 01 00:00:00 1970 +0000 | |
383 summary: ROOT | |
384 | |
385 $ hg phase -p . | |
386 abort: rejecting multiple heads on branch "branch_A" | |
387 (2 heads: 49003e504178 8058fd35cc2b) | |
388 [255] |