Mercurial > hg
diff tests/test-single-head.t @ 42969:76608f9f27f6
singlehead: introduce special handling of closed heads
Until now, the experimental option `single-head-per-branch` was also refusing
closed heads. The logic is now ignoring them by default and a suboption have
been added to refuse them too `single-head-per-branch:account-closed-heads`.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Wed, 25 Sep 2019 12:59:26 +0200 |
parents | 3609ea82b971 |
children | 88a306478556 |
line wrap: on
line diff
--- a/tests/test-single-head.t Wed Sep 25 12:57:11 2019 +0200 +++ b/tests/test-single-head.t Wed Sep 25 12:59:26 2019 +0200 @@ -200,3 +200,62 @@ $ hg strip --config extensions.strip= --rev 'desc("c_dH0")' saved backup bundle to $TESTTMP/client/.hg/strip-backup/fe47ea669cea-a41bf5a9-backup.hg +Test that closing heads are ignored by default +----------------------------------------------- + + $ hg up 'desc("c_aG0")' + 0 files updated, 0 files merged, 2 files removed, 0 files unresolved + $ mkcommit c_aJ0 + created new head + +pushing the new head should fails + + $ hg push -f + pushing to $TESTTMP/single-head-server + searching for changes + adding changesets + adding manifests + adding file changes + transaction abort! + rollback completed + abort: rejecting multiple heads on branch "branch_A" + (2 heads: 49003e504178 468bd81ccc5d) + [255] + + +closing the head and pushing should succeed + + $ mkcommit c_aK0 --close-branch + $ hg push -f + pushing to $TESTTMP/single-head-server + searching for changes + adding changesets + adding manifests + adding file changes + added 4 changesets with 4 changes to 4 files (-1 heads) + + +Test that closing heads can be explicitly accounted for +------------------------------------------------------- + + $ cat <<EOF >> $TESTTMP/single-head-server/.hg/hgrc + > [experimental] + > single-head-per-branch:account-closed-heads = yes + > EOF + + $ hg up 'desc("c_aG0")' + 0 files updated, 0 files merged, 2 files removed, 0 files unresolved + $ mkcommit c_aL0 + created new head + $ mkcommit c_aM0 --close-branch + $ hg push -f + pushing to $TESTTMP/single-head-server + searching for changes + adding changesets + adding manifests + adding file changes + transaction abort! + rollback completed + abort: rejecting multiple heads on branch "branch_A" + (3 heads: 49003e504178 5254bcccab93 42b9fe70a3c1) + [255]