diff -r 2852933fc942 -r e0039716f3ea mercurial/commands.py --- a/mercurial/commands.py Fri Jun 24 10:51:05 2011 +0200 +++ b/mercurial/commands.py Fri Jun 24 12:37:29 2011 +0200 @@ -4179,6 +4179,8 @@ opts["rev"] = cmdutil.finddate(ui, repo, opts["date"]) parent, p2 = repo.dirstate.parents() + ctx = scmutil.revsingle(repo, opts.get('rev')) + node = ctx.node() if not pats and not opts.get('all'): msg = _("no files or directories specified") @@ -4186,10 +4188,15 @@ if p2 != nullid: hint = _("uncommitted merge, use --all to discard all changes," " or 'hg update -C .' to abort the merge") + elif node != parent: + if util.any(repo.status()): + hint = _("uncommitted changes, use --all to discard all" + " changes, or 'hg update %s' to update") % ctx.rev() + else: + hint = _("use --all to revert all files," + " or 'hg update %s' to update") % ctx.rev() raise util.Abort(msg, hint=hint) - ctx = scmutil.revsingle(repo, opts.get('rev')) - node = ctx.node() mf = ctx.manifest() if node == parent: pmf = mf