From patchwork Sun Feb 10 23:30:05 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [15, of, 19] commit: use workingctx._rawstatus for subrepo-realted commit validation From: David Schleimer X-Patchwork-Id: 956 Message-Id: To: mercurial-devel@selenic.com Date: Sun, 10 Feb 2013 15:30:05 -0800 # HG changeset patch # User David Schleimer # 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')