D7659: rust-index: use the new method in shortesthexnodeidprefix

gracinet (Georges Racinet) phabricator at mercurial-scm.org
Wed Jan 8 13:11:19 EST 2020


Closed by commit rHG992f0d6e7f33: rust-index: use the new method in shortesthexnodeidprefix (authored by gracinet).
This revision was automatically updated to reflect the committed changes.
This revision was not accepted when it landed; it landed in state "Needs Review".

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7659?vs=18705&id=19083

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7659/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7659

AFFECTED FILES
  mercurial/scmutil.py

CHANGE DETAILS

diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
--- a/mercurial/scmutil.py
+++ b/mercurial/scmutil.py
@@ -58,6 +58,7 @@
     from . import scmposix as scmplatform
 
 parsers = policy.importmod('parsers')
+rustrevlog = policy.importrust('revlog')
 
 termsize = scmplatform.termsize
 
@@ -548,7 +549,11 @@
                 if util.safehasattr(parsers, 'nodetree'):
                     # The CExt is the only implementation to provide a nodetree
                     # class so far.
-                    nodetree = parsers.nodetree(cl.index, len(revs))
+                    index = cl.index
+                    if util.safehasattr(index, 'get_cindex'):
+                        # the rust wrapped need to give access to its internal index
+                        index = index.get_cindex()
+                    nodetree = parsers.nodetree(index, len(revs))
                     for r in revs:
                         nodetree.insert(r)
                     if cache is not None:



To: marmoute, #hg-reviewers, Alphare
Cc: mercurial-devel


More information about the Mercurial-devel mailing list