##// END OF EJS Templates
commit: add a check if it is trying to close an already closed branch head...
Sushil khanchi -
r42693:9f7cb777 default
parent child Browse files
Show More
@@ -1673,7 +1673,10 b' def _docommit(ui, repo, *pats, **opts):'
1673 if opts.get('close_branch'):
1673 if opts.get('close_branch'):
1674 extra['close'] = '1'
1674 extra['close'] = '1'
1675
1675
1676 if not bheads:
1676 if repo['.'].closesbranch():
1677 raise error.Abort(_('current revision is already a branch closing'
1678 ' head'))
1679 elif not bheads:
1677 raise error.Abort(_('can only close branch heads'))
1680 raise error.Abort(_('can only close branch heads'))
1678 elif branch == repo['.'].branch() and repo['.'].node() not in bheads:
1681 elif branch == repo['.'].branch() and repo['.'].node() not in bheads:
1679 raise error.Abort(_('can only close branch heads'))
1682 raise error.Abort(_('can only close branch heads'))
@@ -280,7 +280,7 b' verify update will accept invalid legacy'
280 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
280 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
281 $ hg commit -d '9 0' --close-branch -m 'close this part branch too'
281 $ hg commit -d '9 0' --close-branch -m 'close this part branch too'
282 $ hg commit -d '9 0' --close-branch -m 're-closing this branch'
282 $ hg commit -d '9 0' --close-branch -m 're-closing this branch'
283 abort: can only close branch heads
283 abort: current revision is already a branch closing head
284 [255]
284 [255]
285
285
286 $ hg log -r tip --debug
286 $ hg log -r tip --debug
General Comments 0
You need to be logged in to leave comments. Login now