# HG changeset patch # User John Li # Date 2012-08-22 15:18:35 # Node ID 45b5eb2941d0d35863a96d13ce11a55be1825c68 # Parent b32a30da608d529a0ebbde364f291c5ef107a6b4 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. diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -4269,7 +4269,7 @@ def merge(ui, repo, node=None, **opts): 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"),