From patchwork Sun Feb 10 23:30:02 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [12, of, 19] localrepo: don't use raw context when checking for an empty commit From: David Schleimer X-Patchwork-Id: 952 Message-Id: To: mercurial-devel@selenic.com Date: Sun, 10 Feb 2013 15:30:02 -0800 # HG changeset patch # User David Schleimer # Date 1360330572 28800 # Node ID cb00b77bc8e24c68b5b4df5e484f7c005f12d2d1 # Parent 272e90e44133f13219edd88cf9d3ecbb87886563 localrepo: don't use raw context when checking for an empty commit This switches one of the cases in the if statement checking for empty commits to use the commitable context instead of the raw working context. The point of this change is that there is now a clear distinction between the part of localrepo.commit() where we are operating on the raw context and the part where we are operating on the commitable context. This is turn will make it proactical for future patches to split up the function. This is part of a larger refactoring effort to make memctx more useful, and make it easier to smoothly commit in memory. diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -1204,7 +1204,7 @@ if (not force and not extra.get("close") and not merge and not cctx.files() - and wctx.branch() == wctx.p1().branch()): + and cctx.branch() == cctx.p1().branch()): return None if merge and cctx.deleted():