Mercurial > public > mercurial-scm > hg-stable
diff mercurial/commands.py @ 5242:9cd6578750b9
improve error message for 'hg merge' when repo already at branchtip
author | Benoit Boissinot <benoit.boissinot@ens-lyon.org> |
---|---|
date | Sat, 25 Aug 2007 11:30:11 +0200 |
parents | ce4e67533723 |
children | 5517aa5aafb0 |
line wrap: on
line diff
--- 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'))