merge: handle case when heads are all bookmarks stable
authorJohn Li <jli@circularly.org>
Wed, 22 Aug 2012 11:18:35 -0400
branchstable
changeset 17386 45b5eb2941d0
parent 17385 b32a30da608d
child 17388 54feb8d3bab7
child 17389 59581b667cd7
merge: handle case when heads are all bookmarks If all heads are bookmarks, merge fails to find what node to merge with (throws an IndexError while indexing into the non-bookmark heads list) as of 4a02cf4fbb2e. This catches that case and prints an error to specify a rev explicitly.
mercurial/commands.py
--- a/mercurial/commands.py	Tue Aug 21 20:51:16 2012 +0200
+++ b/mercurial/commands.py	Wed Aug 22 11:18:35 2012 -0400
@@ -4269,7 +4269,7 @@
                              hint=_("run 'hg heads .' to see heads"))
 
         parent = repo.dirstate.p1()
-        if len(nbhs) == 1:
+        if len(nbhs) <= 1:
             if len(bheads) > 1:
                 raise util.Abort(_("heads are bookmarked - "
                                    "please merge with an explicit rev"),