--------------------------------------------------------------------------
This message, including its attachments, is confidential. For more information 
please read NNG's email policy here:
http://www.nng.com/emailpolicy/
By responding to this email you accept the email policy.


________________________________________
Feladó: Pierre-Yves David <pierre-yves.da...@ens-lyon.org>
Elküldve: 2016. október 4. 19:28
Címzett: Gábor STEFANIK; mercurial-devel@mercurial-scm.org
Tárgy: Re: [PATCH 05 of 11] copies: don't record divergence for files needing 
no merge (issue4028)

On 10/04/2016 04:39 PM, Gábor Stefanik wrote:
> # HG changeset patch
> # User Gábor Stefanik <gabor.stefa...@nng.com>
> # Date 1475494199 -7200
> #      Mon Oct 03 13:29:59 2016 +0200
> # Node ID bc8729a69d10d61498712d5dab773918f1edcde0
> # Parent  a2b50d0c5dc69a4ce15b6a54d030e478c0f4cc41
> copies: don't record divergence for files needing no merge (issue4028)

Can you elaborate about why this change make sense ?

also: do not include (issue4028) tag until the changeset that actually
fixes the issue.

(Sorry for the weird headers and formatting, I'm using webmail.)

Yuya Nishihara specifically asked for this to be factored out into its own 
patch.

Of the two "break" statements that were changed to "return", only the first is 
a real change, as the 2nd one had "of = None" before it, to skip the final pass 
of recording divergent renames. The first one would record a divergence for 
files where there was nothing to merge in m2 compared to ma - this divergence 
would be dropped later in mergecopies as irrelevant.

The new checkcopies does more than just record a divergence after the main 
loop, which makes it essential that it doesn't enter the post-processing stage 
after the main loop when it has already came up with an answer. Specifically, 
an incomplete copy can get recorded, which could then be inappropriately 
matched in mergecopies with another incomplete copy or an incomplete divergence 
from the other pass.

So, this is a preparatory change for the checkcopies divergence handling patch.


>
> diff -r a2b50d0c5dc6 -r bc8729a69d10 mercurial/copies.py
> --- a/mercurial/copies.py     Mon Oct 03 13:24:56 2016 +0200
> +++ b/mercurial/copies.py     Mon Oct 03 13:29:59 2016 +0200
> @@ -524,13 +524,12 @@
>          if of not in m2:
>              continue # no match, keep looking
>          if m2[of] == ma.get(of):
> -            break # no merge needed, quit early
> +            return # no merge needed, quit early
>          c2 = getfctx(of, m2[of])
>          cr = _related(oc, c2, ca.rev())
>          if cr and (of == f or of == c2.path()): # non-divergent
>              copy[f] = of
> -            of = None
> -            break
> +            return
>
>      if of in ma:
>          diverge.setdefault(of, []).append(f)
>
>
>
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>

--
Pierre-Yves David
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to