Patchwork [12,of,19] localrepo: don't use raw context when checking for an empty commit

login
register
mail settings
Submitter David Schleimer
Date Feb. 10, 2013, 11:30 p.m.
Message ID <cb00b77bc8e24c68b5b4.1360539002@dev010.prn1.facebook.com>
Download mbox | patch
Permalink /patch/952/
State Changes Requested
Headers show

Comments

David Schleimer - Feb. 10, 2013, 11:30 p.m.
# HG changeset patch
# User David Schleimer <dschleimer@fb.com>
# 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.
Bryan O'Sullivan - Feb. 11, 2013, 8:58 p.m.
On Sun, Feb 10, 2013 at 3:30 PM, David Schleimer <dschleimer@fb.com> wrote:

> This is turn will make it proactical for


Couple of typos here.
Matt Mackall - Feb. 13, 2013, 5:08 a.m.
On Mon, 2013-02-11 at 12:58 -0800, Bryan O'Sullivan wrote:
> On Sun, Feb 10, 2013 at 3:30 PM, David Schleimer <dschleimer@fb.com> wrote:
> 
> > This is turn will make it proactical for
> 
> 
> Couple of typos here.

David might want to enable a spell-checker in his editor (I use flyspell
in Emacs). But see:

http://markmail.org/message/4jv2dsbjtfxemq7g

Patch

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():