mercurial/copies.py
changeset 45977 a66568f20ddc
parent 45957 89a2afe31e82
child 45987 8b99c473aae2
--- a/mercurial/copies.py	Wed Sep 18 13:21:38 2019 +0200
+++ b/mercurial/copies.py	Thu Oct 01 18:52:13 2020 +0200
@@ -17,6 +17,7 @@
     match as matchmod,
     node,
     pathutil,
+    policy,
     pycompat,
     util,
 )
@@ -26,6 +27,8 @@
 
 from .revlogutils import flagutil
 
+rustmod = policy.importrust("copy_tracing")
+
 
 def _filter(src, dst, t):
     """filters out invalid copies after chaining"""
@@ -310,8 +313,15 @@
 
     It returns the aggregated copies information for `targetrev`.
     """
+
+    alwaysmatch = match.always()
+
+    if rustmod is not None and alwaysmatch:
+        return rustmod.combine_changeset_copies(
+            list(revs), children, targetrev, revinfo, isancestor
+        )
+
     all_copies = {}
-    alwaysmatch = match.always()
     for r in revs:
         copies = all_copies.pop(r, None)
         if copies is None: