diff -r 6500a2eebee8 -r cc62c9d6887a mercurial/commands.py --- a/mercurial/commands.py Tue Apr 01 15:11:19 2014 -0500 +++ b/mercurial/commands.py Tue Apr 01 17:59:06 2014 -0500 @@ -417,7 +417,8 @@ See :hg:`help dates` for a list of formats valid for -d/--date. - Returns 0 on success. + 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")) @@ -497,6 +498,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):