mercurial/commands.py
changeset 42508 9f7cb777b654
parent 42464 1314c0bb6b24
child 42509 abd4783db5a7
--- 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'))