--- a/mercurial/commands.py Mon Jun 17 10:53:00 2019 -0700
+++ b/mercurial/commands.py Tue Apr 16 02:33:54 2019 +0530
@@ -1673,7 +1673,10 @@
if opts.get('close_branch'):
extra['close'] = '1'
- if not bheads:
+ if repo['.'].closesbranch():
+ raise error.Abort(_('current revision is already a branch closing'
+ ' head'))
+ elif not bheads:
raise error.Abort(_('can only close branch heads'))
elif branch == repo['.'].branch() and repo['.'].node() not in bheads:
raise error.Abort(_('can only close branch heads'))