mercurial/commands.py
changeset 41397 0bd56c291359
parent 41382 2f2a7ea62e9a
child 41398 2ff8994ac71d
--- a/mercurial/commands.py	Mon Jan 21 15:29:14 2019 +0000
+++ b/mercurial/commands.py	Fri Jan 25 23:36:23 2019 -0800
@@ -1672,8 +1672,8 @@
         if not bheads:
             raise error.Abort(_('can only close branch heads'))
         elif opts.get('amend'):
-            if repo[None].parents()[0].p1().branch() != branch and \
-                    repo[None].parents()[0].p2().branch() != branch:
+            if repo[None].p1().p1().branch() != branch and \
+                    repo[None].p1().p2().branch() != branch:
                 raise error.Abort(_('can only close branch heads'))
 
     if opts.get('amend'):