# HG changeset patch # User Gábor Stefanik # Date 1475494199 -7200 # Node ID 2c8ec8c2ddfeb2d229b81eb5b11e3639fb34b0a0 # Parent 8f34e217338be6a1b997807521e95f9f7409d722 copies: don't record divergence for files needing no merge This is left over from when _checkcopies was factored out from mergecopies. The 2nd break has "of = None" before it, so it's a functionally equivalent change. The 1st one, however, causes a divergence to be recorded when a file has been renamed, but there is nothing to be merged to it. This is currently harmless, since the extra divergence is simply ignored later. However, the new _checkcopies introduced in the rest of this series does more than just record a divergence after completing the main loop, and it's important that the "post-processing" stage is really skipped for no-merge-needed renames. diff -r 8f34e217338b -r 2c8ec8c2ddfe mercurial/copies.py --- a/mercurial/copies.py Sat Oct 08 19:32:54 2016 +0900 +++ 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)