mercurial/commands.py
branchstable
changeset 14755 6ba51c81ff75
parent 14742 271424fdbeec
child 14840 11b5a5d2ca8b
child 14849 d87814992728
--- a/mercurial/commands.py	Fri Jun 24 19:44:59 2011 +0300
+++ b/mercurial/commands.py	Sun Jun 26 01:13:30 2011 +0200
@@ -4184,17 +4184,22 @@
 
     if not pats and not opts.get('all'):
         msg = _("no files or directories specified")
-        hint = _("use --all to discard all changes")
         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()):
+            raise util.Abort(msg, hint=hint)
+        dirty = util.any(repo.status())
+        if node != parent:
+            if dirty:
                 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()
+        elif dirty:
+            hint = _("uncommitted changes, use --all to discard all changes")
+        else:
+            hint = _("use --all to revert all files")
         raise util.Abort(msg, hint=hint)
 
     mf = ctx.manifest()