[PATCH 3 of 3] checkcopies: add an inline comment about the '_related' call

Pierre-Yves David pierre-yves.david at ens-lyon.org
Sun Oct 9 10:18:48 EDT 2016


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at ens-lyon.org>
# Date 1475960455 -7200
#      Sat Oct 08 23:00:55 2016 +0200
# Node ID 2a472b0c384f95503a6e4aa1c78d6b5c6dc886a9
# Parent  5801b0cd4ec0de5e9fb4129212d08f38fd66716b
# EXP-Topic checkcopies
checkcopies: add an inline comment about the '_related' call

This helps understanding the flow of the function.

diff --git a/mercurial/copies.py b/mercurial/copies.py
--- a/mercurial/copies.py
+++ b/mercurial/copies.py
@@ -526,6 +526,8 @@ def _checkcopies(ctx, f, m1, m2, base, l
         if m2[of] == mb.get(of):
             return # no merge needed, quit early
         c2 = getfctx(of, m2[of])
+        # c2 might be a plain new file on added on destination side that is
+        # unrelated to the droids we are looking for.
         cr = _related(oc, c2, base.rev())
         if cr and (of == f or of == c2.path()): # non-divergent
             copy[f] = of


More information about the Mercurial-devel mailing list