diff mercurial/revlog.py @ 46310:fc2d5c0aed7f

persistent-nodemap: add a "warn" option to the slow-path config And make it the default until we get an abort option. Differential Revision: https://phab.mercurial-scm.org/D9761
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 13 Jan 2021 23:07:41 +0100
parents 89a2afe31e82
children 711ba0f1057e
line wrap: on
line diff
--- a/mercurial/revlog.py	Wed Jan 13 18:33:48 2021 +0100
+++ b/mercurial/revlog.py	Wed Jan 13 23:07:41 2021 +0100
@@ -161,6 +161,16 @@
         rl.revision(node)
 
 
+# True if a fast implementation for persistent-nodemap is available
+#
+# We also consider we have a "fast" implementation in "pure" python because
+# people using pure don't really have performance consideration (and a
+# wheelbarrow of other slowness source)
+HAS_FAST_PERSISTENT_NODEMAP = rustrevlog is not None or util.safehasattr(
+    parsers, 'BaseIndexObject'
+)
+
+
 @attr.s(slots=True, frozen=True)
 class _revisioninfo(object):
     """Information about a revision that allows building its fulltext