commit: factor the post commit status check into a cmdutil method
The largefiles extension needs to set lfstatus for this status call. Otherwise,
if a missing largefile is explicitly named, a confusing message is issued that
says the largefile wasn't found, followed by another that says nothing changed.
--- a/mercurial/cmdutil.py Sat Jan 23 20:51:17 2016 -0500
+++ b/mercurial/cmdutil.py Sat Jan 23 23:24:30 2016 -0500
@@ -2841,6 +2841,9 @@
elif repo.ui.verbose:
repo.ui.write(_('committed changeset %d:%s\n') % (int(ctx), ctx))
+def postcommitstatus(repo, pats, opts):
+ return repo.status(match=scmutil.match(repo[None], pats, opts))
+
def revert(ui, repo, ctx, parents, *pats, **opts):
parent, p2 = parents
node = ctx.node()
--- a/mercurial/commands.py Sat Jan 23 20:51:17 2016 -0500
+++ b/mercurial/commands.py Sat Jan 23 23:24:30 2016 -0500
@@ -1720,7 +1720,7 @@
node = cmdutil.commit(ui, repo, commitfunc, pats, opts)
if not node:
- stat = repo.status(match=scmutil.match(repo[None], pats, opts))
+ stat = cmdutil.postcommitstatus(repo, pats, opts)
if stat[3]:
ui.status(_("nothing changed (%d missing files, see "
"'hg status')\n") % len(stat[3]))