mercurial/copies.py
changeset 45962 a66568f20ddc
parent 45942 89a2afe31e82
child 45972 8b99c473aae2
equal deleted inserted replaced
45961:35d5d1d8bcf0 45962:a66568f20ddc
    15 
    15 
    16 from . import (
    16 from . import (
    17     match as matchmod,
    17     match as matchmod,
    18     node,
    18     node,
    19     pathutil,
    19     pathutil,
       
    20     policy,
    20     pycompat,
    21     pycompat,
    21     util,
    22     util,
    22 )
    23 )
    23 
    24 
    24 
    25 
    25 from .utils import stringutil
    26 from .utils import stringutil
    26 
    27 
    27 from .revlogutils import flagutil
    28 from .revlogutils import flagutil
       
    29 
       
    30 rustmod = policy.importrust("copy_tracing")
    28 
    31 
    29 
    32 
    30 def _filter(src, dst, t):
    33 def _filter(src, dst, t):
    31     """filters out invalid copies after chaining"""
    34     """filters out invalid copies after chaining"""
    32 
    35 
   308     revinfo(rev): a function that return (p1, p2, p1copies, p2copies, removed)
   311     revinfo(rev): a function that return (p1, p2, p1copies, p2copies, removed)
   309     match: a matcher
   312     match: a matcher
   310 
   313 
   311     It returns the aggregated copies information for `targetrev`.
   314     It returns the aggregated copies information for `targetrev`.
   312     """
   315     """
       
   316 
       
   317     alwaysmatch = match.always()
       
   318 
       
   319     if rustmod is not None and alwaysmatch:
       
   320         return rustmod.combine_changeset_copies(
       
   321             list(revs), children, targetrev, revinfo, isancestor
       
   322         )
       
   323 
   313     all_copies = {}
   324     all_copies = {}
   314     alwaysmatch = match.always()
       
   315     for r in revs:
   325     for r in revs:
   316         copies = all_copies.pop(r, None)
   326         copies = all_copies.pop(r, None)
   317         if copies is None:
   327         if copies is None:
   318             # this is a root
   328             # this is a root
   319             copies = {}
   329             copies = {}