[PATCH] copies: added manifests to computenonoverlap

Durham Goode durham at fb.com
Tue Mar 10 22:29:52 UTC 2015


# HG changeset patch
# User Durham Goode <durham at fb.com>
# Date 1426020965 25200
#      Tue Mar 10 13:56:05 2015 -0700
# Node ID 2c1d33d6a45257f27da9ea2b590db48b21eeeb87
# Parent  913347bcd59c33110f029d83203b3b4c2ecd91a8
copies: added manifests to computenonoverlap

Commit 30219bd46ed7 changed the computenonoverlap api's to not require the
manifests. We actually need the manifests in the remotefilelog extension so
we can find the file nodes for the various files that change.  Let's add it
back to the function signature with a note explaining why.

This doesn't affect any behavior.

diff --git a/mercurial/copies.py b/mercurial/copies.py
--- a/mercurial/copies.py
+++ b/mercurial/copies.py
@@ -209,10 +209,13 @@ def pathcopies(x, y):
         return _backwardrenames(x, y)
     return _chain(x, y, _backwardrenames(x, a), _forwardcopies(a, y))
 
-def _computenonoverlap(repo, addedinm1, addedinm2):
+def _computenonoverlap(repo, m1, m2, addedinm1, addedinm2):
     """Computes, based on addedinm1 and addedinm2, the files exclusive to m1
     and m2. This is its own function so extensions can easily wrap this call
     to see what files mergecopies is about to process.
+
+    Even though m1 and m2 are not used in this function, they are useful in
+    other extensions for being able to read the file nodes of the changed files.
     """
     u1 = sorted(addedinm1 - addedinm2)
     u2 = sorted(addedinm2 - addedinm1)
@@ -280,7 +283,7 @@ def mergecopies(repo, c1, c2, ca):
 
     addedinm1 = m1.filesnotin(ma)
     addedinm2 = m2.filesnotin(ma)
-    u1, u2 = _computenonoverlap(repo, addedinm1, addedinm2)
+    u1, u2 = _computenonoverlap(repo, m1, m2, addedinm1, addedinm2)
 
     for f in u1:
         checkcopies(ctx, f, m1, m2, ca, limit, diverge, copy, fullcopy)


More information about the Mercurial-devel mailing list