changeset 18660:7e6946ed5756

localrepo: use workingctx for validation in commit This changes localrepo.commit to use the workingctx it creates form the munged output of localrepo.status while running some precommit validation. Specifically, it uses functions that were already present on the workingctx. I believe this is a net readabilty improvement, and that this makes these lines consistent with the refactoring in a subsequent patch that pulls some of the validation logic into workingctx so that it can be reused elsewhere.
author David Schleimer <dschleimer@fb.com>
date Fri, 08 Feb 2013 05:36:08 -0800
parents b946470efed9
children 4fb92f14a97a
files mercurial/localrepo.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/localrepo.py	Fri Feb 08 05:36:07 2013 -0800
+++ b/mercurial/localrepo.py	Fri Feb 08 05:36:08 2013 -0800
@@ -1233,11 +1233,11 @@
             cctx = context.workingctx(self, text, user, date, extra, changes)
 
             if (not force and not extra.get("close") and not merge
-                and not (changes[0] or changes[1] or changes[2])
+                and not cctx.files()
                 and wctx.branch() == wctx.p1().branch()):
                 return None
 
-            if merge and changes[3]:
+            if merge and cctx.deleted():
                 raise util.Abort(_("cannot commit merge with missing files"))
 
             ms = mergemod.mergestate(self)