comparison mercurial/commands.py @ 42494:abd4783db5a7

commit: make the error message more specific while aborting branch closing Differential Revision: https://phab.mercurial-scm.org/D6493
author Sushil khanchi <sushilkhanchi97@gmail.com>
date Tue, 16 Apr 2019 02:53:28 +0530
parents 9f7cb777b654
children a68350a7fc55
comparison
equal deleted inserted replaced
42493:9f7cb777b654 42494:abd4783db5a7
1675 1675
1676 if repo['.'].closesbranch(): 1676 if repo['.'].closesbranch():
1677 raise error.Abort(_('current revision is already a branch closing' 1677 raise error.Abort(_('current revision is already a branch closing'
1678 ' head')) 1678 ' head'))
1679 elif not bheads: 1679 elif not bheads:
1680 raise error.Abort(_('can only close branch heads')) 1680 raise error.Abort(_('branch "%s" has no heads to close') % branch)
1681 elif branch == repo['.'].branch() and repo['.'].node() not in bheads: 1681 elif branch == repo['.'].branch() and repo['.'].node() not in bheads:
1682 raise error.Abort(_('can only close branch heads')) 1682 raise error.Abort(_('can only close branch heads'))
1683 elif opts.get('amend'): 1683 elif opts.get('amend'):
1684 if (repo['.'].p1().branch() != branch and 1684 if (repo['.'].p1().branch() != branch and
1685 repo['.'].p2().branch() != branch): 1685 repo['.'].p2().branch() != branch):