mercurial/scmutil.py
changeset 44016 992f0d6e7f33
parent 44003 60de488cad11
child 44039 0750cbffdb3b
equal deleted inserted replaced
44015:443dc1655923 44016:992f0d6e7f33
    56     from . import scmwindows as scmplatform
    56     from . import scmwindows as scmplatform
    57 else:
    57 else:
    58     from . import scmposix as scmplatform
    58     from . import scmposix as scmplatform
    59 
    59 
    60 parsers = policy.importmod('parsers')
    60 parsers = policy.importmod('parsers')
       
    61 rustrevlog = policy.importrust('revlog')
    61 
    62 
    62 termsize = scmplatform.termsize
    63 termsize = scmplatform.termsize
    63 
    64 
    64 
    65 
    65 @attr.s(slots=True, repr=False)
    66 @attr.s(slots=True, repr=False)
   546                 nodetree = cache.get(b'disambiguationnodetree')
   547                 nodetree = cache.get(b'disambiguationnodetree')
   547             if not nodetree:
   548             if not nodetree:
   548                 if util.safehasattr(parsers, 'nodetree'):
   549                 if util.safehasattr(parsers, 'nodetree'):
   549                     # The CExt is the only implementation to provide a nodetree
   550                     # The CExt is the only implementation to provide a nodetree
   550                     # class so far.
   551                     # class so far.
   551                     nodetree = parsers.nodetree(cl.index, len(revs))
   552                     index = cl.index
       
   553                     if util.safehasattr(index, 'get_cindex'):
       
   554                         # the rust wrapped need to give access to its internal index
       
   555                         index = index.get_cindex()
       
   556                     nodetree = parsers.nodetree(index, len(revs))
   552                     for r in revs:
   557                     for r in revs:
   553                         nodetree.insert(r)
   558                         nodetree.insert(r)
   554                     if cache is not None:
   559                     if cache is not None:
   555                         cache[b'disambiguationnodetree'] = nodetree
   560                         cache[b'disambiguationnodetree'] = nodetree
   556             if nodetree is not None:
   561             if nodetree is not None: