comparison mercurial/commands.py @ 42493:9f7cb777b654

commit: add a check if it is trying to close an already closed branch head It would check if the revision we are going to close is already a closed branch head and print the error message accordingly. Differential Revision: https://phab.mercurial-scm.org/D6491
author Sushil khanchi <sushilkhanchi97@gmail.com>
date Tue, 16 Apr 2019 02:33:54 +0530
parents 1314c0bb6b24
children abd4783db5a7
comparison
equal deleted inserted replaced
42492:4bcabb5ae9b6 42493:9f7cb777b654
1671 1671
1672 extra = {} 1672 extra = {}
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'))
1680 elif opts.get('amend'): 1683 elif opts.get('amend'):
1681 if (repo['.'].p1().branch() != branch and 1684 if (repo['.'].p1().branch() != branch and