diff -r 75c71c533977 -r df224038c516 mercurial/commands.py --- a/mercurial/commands.py Fri Oct 14 03:03:39 2016 +0200 +++ b/mercurial/commands.py Fri Oct 14 09:52:38 2016 +0200 @@ -1638,9 +1638,11 @@ def _docommit(ui, repo, *pats, **opts): if opts.get('interactive'): opts.pop('interactive') - cmdutil.dorecord(ui, repo, commit, None, False, - cmdutil.recordfilter, *pats, **opts) - return + ret = cmdutil.dorecord(ui, repo, commit, None, False, + cmdutil.recordfilter, *pats, **opts) + # ret can be 0 (no changes to record) or the value returned by + # commit(), 1 if nothing changed or None on success. + return 1 if ret == 0 else ret if opts.get('subrepos'): if opts.get('amend'):