diff -r 2b8373bda032 -r 9cd6578750b9 mercurial/commands.py --- a/mercurial/commands.py Fri Aug 24 00:56:56 2007 +0200 +++ b/mercurial/commands.py Sat Aug 25 11:30:11 2007 +0200 @@ -1928,10 +1928,13 @@ raise util.Abort(_('repo has %d heads - ' 'please merge with an explicit rev') % len(heads)) + parent = repo.dirstate.parents()[0] if len(heads) == 1: - raise util.Abort(_('there is nothing to merge - ' - 'use "hg update" instead')) - parent = repo.dirstate.parents()[0] + msg = _('there is nothing to merge') + if parent != repo.lookup(repo.workingctx().branch()): + msg = _('%s - use "hg update" instead' % msg) + raise util.Abort(msg) + if parent not in heads: raise util.Abort(_('working dir not at a head rev - ' 'use "hg update" or merge with an explicit rev'))