[PATCH STABLE] merge: avoid superfluous filemerges when grafting through renames (issue5407)

Yuya Nishihara yuya at tcha.org
Thu Oct 27 09:24:59 EDT 2016


On Tue, 25 Oct 2016 17:21:24 -0500, Gábor Stefanik wrote:
> # HG changeset patch
> # User Gábor Stefanik <gabor.stefanik at nng.com>
> # Date 1477422113 -7200
> #      Tue Oct 25 21:01:53 2016 +0200
> # Branch stable
> # Node ID 1f40c1fe34442812291b000c5e1a8b22ad14f091
> # Parent  76c57e1fe79b0980b377b4f305635dea393d6315
> merge: avoid superfluous filemerges when grafting through renames (issue5407)
> 
> This is a fix for a regression introduced by the patches for issue4028.
> 
> The test changes are due to us doing fewer _checkcopies searches now, which
> makes some test outputs revert to the pre-issue4028 behavior. That issue itself
> remains fixed, we only skip copy tracing for files where it isn't relevant.
> As a nice side effect, this makes copy detection much faster when tracing
> backwards through lots of renames.
> 
> diff --git a/mercurial/copies.py b/mercurial/copies.py
> --- a/mercurial/copies.py
> +++ b/mercurial/copies.py
> @@ -631,6 +631,10 @@
>      backwards = not remotebase and base != tca and f in mb
>      getfctx = _makegetfctx(ctx)
>  
> +    if m1[f] == mb.get(f) and not remotebase:
> +        # Nothing to merge
> +        return

I'm not 100% sure, but this change looks good and I have no particular concern.
Queued, thanks.

I expect this will be 2nd-reviewed by marmoute as he's reviewed the previous
round of the mergecopies series.


More information about the Mercurial-devel mailing list