mercurial/commands.py
branchstable
changeset 20872 3f83fc5cfe71
parent 20871 e01cff65f4c5
child 20875 cc62c9d6887a
--- a/mercurial/commands.py	Sat Mar 08 18:41:56 2014 +0900
+++ b/mercurial/commands.py	Sat Mar 08 18:52:16 2014 +0900
@@ -416,7 +416,8 @@
 
     See :hg:`help dates` for a list of formats valid for -d/--date.
 
-    Returns 0 on success, 1 if there are unresolved files.
+    Returns 0 on success, 1 if nothing to backout or there are unresolved
+    files.
     '''
     if rev and node:
         raise util.Abort(_("please specify just one revision"))
@@ -495,6 +496,9 @@
             return repo.commit(message, opts.get('user'), opts.get('date'),
                                match, editor=e)
         newnode = cmdutil.commit(ui, repo, commitfunc, [], opts)
+        if not newnode:
+            ui.status(_("nothing changed\n"))
+            return 1
         cmdutil.commitstatus(repo, newnode, branch, bheads)
 
         def nice(node):