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

login
register
mail settings
Submitter Pierre-Yves David
Date Oct. 9, 2016, 2:18 p.m.
Message ID <2a472b0c384f95503a6e.1476022728@nodosa.octopoid.net>
Download mbox | patch
Permalink /patch/17009/
State Accepted
Headers show

Comments

Pierre-Yves David - Oct. 9, 2016, 2:18 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@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.

Patch

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