##// END OF EJS Templates
branch: abort if closing branch from a non-branchhead cset...
Sushil khanchi -
r42388:8d14d915 default
parent child Browse files
Show More
@@ -1675,6 +1675,8 b' def _docommit(ui, repo, *pats, **opts):'
1675
1675
1676 if not bheads:
1676 if not bheads:
1677 raise error.Abort(_('can only close branch heads'))
1677 raise error.Abort(_('can only close branch heads'))
1678 elif branch == repo['.'].branch() and repo['.'].node() not in bheads:
1679 raise error.Abort(_('can only close branch heads'))
1678 elif opts.get('amend'):
1680 elif opts.get('amend'):
1679 if (repo['.'].p1().branch() != branch and
1681 if (repo['.'].p1().branch() != branch and
1680 repo['.'].p2().branch() != branch):
1682 repo['.'].p2().branch() != branch):
@@ -956,19 +956,16 b' Test to make sure that `--close-branch` '
956
956
957 trying to close branch from a cset which is not a branch head
957 trying to close branch from a cset which is not a branch head
958 it should abort:
958 it should abort:
959 XXX: it should have aborted here
960 $ hg ci -m "closing branch" --close-branch
959 $ hg ci -m "closing branch" --close-branch
961 created new head
960 abort: can only close branch heads
961 [255]
962
962
963 $ hg up 0
963 $ hg up 0
964 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
964 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
965 $ hg log -GT "{rev}: {node|short} {desc|firstline}\n\t{branch}\n\n"
965 $ hg log -GT "{rev}: {node|short} {desc|firstline}\n\t{branch}\n\n"
966 _ 3: 006876ddd20e closing branch
966 o 2: 155349b645be added c
967 | default
967 | default
968 |
968 |
969 | o 2: 155349b645be added c
970 |/ default
971 |
972 o 1: 5f6d8a4bf34a added b
969 o 1: 5f6d8a4bf34a added b
973 | default
970 | default
974 |
971 |
General Comments 0
You need to be logged in to leave comments. Login now