changeset 27943:02c5f8ad00ac stable

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.
author Matt Harbison <matt_harbison@yahoo.com>
date Sat, 23 Jan 2016 23:24:30 -0500
parents eb1135d5e688
children 4511e8dac4c7
files mercurial/cmdutil.py mercurial/commands.py
diffstat 2 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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]))