[PATCH 15 of 19] commit: use workingctx._rawstatus for subrepo-realted commit validation

David Schleimer dschleimer at fb.com
Sun Feb 10 17:30:05 CST 2013


# HG changeset patch
# User David Schleimer <dschleimer at fb.com>
# Date 1360511456 28800
# Node ID d45c2924e79b417059dfc166e2364e85d4fd09a7
# Parent  730f81cd4b340348dfc5d2eb571f3b13e01c73e4
commit: use workingctx._rawstatus for subrepo-realted commit validation

This changes a little bit of the validation we do during the commit
process to use workingctx._rawstatus to check for a .hgsub that has
been modified but not matched.  This is preparatory to moving the
validation logic into workingctx with the intention of making that
logic more accessible.

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -1168,8 +1168,10 @@
                 subs, commitsubs, newstate = wctx.commitablesubstate(match,
                                                                      force)
                 if subs:
+                    rawchanges = wctx._rawstatus()
                     if (not match('.hgsub') and
-                        '.hgsub' in (wctx.modified() + wctx.added())):
+                        # 0 = modified, 1 = added
+                        '.hgsub' in (rawchanges[0] + rawchanges[1])):
                         raise util.Abort(
                             _("can't commit subrepos without .hgsub"))
                     changes[0].insert(0, '.hgsubstate')


More information about the Mercurial-devel mailing list