[PATCH 4 of 4 stable?] merge: before cd/dc prompt, check that changed side really changed

Matt Mackall mpm at selenic.com
Mon Dec 1 17:54:29 CST 2014


On Mon, 2014-12-01 at 02:33 +0100, Mads Kiilerich wrote:
> # HG changeset patch
> # User Mads Kiilerich <madski at unity3d.com>
> # Date 1417397421 -3600
> #      Mon Dec 01 02:30:21 2014 +0100
> # Branch stable
> # Node ID 03a765f8fc576d3f5e0663f4a2b3a419eee49d7d
> # Parent  f4e4b477208f723b5edefda8ae1ff23266abc127
> merge: before cd/dc prompt, check that changed side really changed
> 
> Before, merging would in some cases ask "wrong" questions about
> "changed/deleted" conflicts ... and even do it before the resolve phase where
> they can be postponed, re"resolved" or answered in bulk operations.
> 
> Instead, check that the content of the changed file really did change.
> 
> Reading and comparing file content is expensive and should be avoided before
> the resolve phase. Prompting the user is however even more expensive. Checking
> the content here is thus better.
> 
> The 'f in ancestors[0]' should not be necessary but is included to be extra
> safe.

> +        if f in ancestors[0] and wctx[f].data() == ancestors[0][f].data():

As discussed on IRC, I've tweaked these in flight to use "not
fctx1.cmp(fctx2)" which has extra smarts relative to raw data()
comparison. So, queued for stable.

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list