comparison mercurial/commands.py @ 17386:45b5eb2941d0 stable

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.
author John Li <jli@circularly.org>
date Wed, 22 Aug 2012 11:18:35 -0400
parents 3fe199579323
children 54feb8d3bab7 bdd248666dbc
comparison
equal deleted inserted replaced
17385:b32a30da608d 17386:45b5eb2941d0
4267 "please merge with an explicit rev") 4267 "please merge with an explicit rev")
4268 % (branch, len(bheads)), 4268 % (branch, len(bheads)),
4269 hint=_("run 'hg heads .' to see heads")) 4269 hint=_("run 'hg heads .' to see heads"))
4270 4270
4271 parent = repo.dirstate.p1() 4271 parent = repo.dirstate.p1()
4272 if len(nbhs) == 1: 4272 if len(nbhs) <= 1:
4273 if len(bheads) > 1: 4273 if len(bheads) > 1:
4274 raise util.Abort(_("heads are bookmarked - " 4274 raise util.Abort(_("heads are bookmarked - "
4275 "please merge with an explicit rev"), 4275 "please merge with an explicit rev"),
4276 hint=_("run 'hg heads' to see all heads")) 4276 hint=_("run 'hg heads' to see all heads"))
4277 if len(repo.heads()) > 1: 4277 if len(repo.heads()) > 1: