[PATCH 1 of 3 STABLE] commit: factor the post commit status check into a cmdutil method

Matt Harbison mharbison72 at gmail.com
Sun Jan 24 00:25:44 CST 2016


# HG changeset patch
# User Matt Harbison <matt_harbison at yahoo.com>
# Date 1453609470 18000
#      Sat Jan 23 23:24:30 2016 -0500
# Branch stable
# Node ID 85d60883b44d2092115a54a747f9ca26ccb76b42
# Parent  d07901a07264cc495565bce44eccb7d80afb7a25
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.

diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -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()
diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -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]))


More information about the Mercurial-devel mailing list