mercurial/configitems.py
changeset 46884 cc3ad5c3af3b
parent 46874 84a93fa7ecfd
child 47076 08e26ef4ad35
--- a/mercurial/configitems.py	Fri Apr 09 03:36:24 2021 +0200
+++ b/mercurial/configitems.py	Thu Jan 14 04:58:20 2021 +0100
@@ -1325,10 +1325,22 @@
     b'usestore',
     default=True,
 )
+
+
+def _persistent_nodemap_default():
+    """compute `use-persistent-nodemap` default value
+
+    The feature is disabled unless a fast implementation is available.
+    """
+    from . import policy
+
+    return policy.importrust('revlog') is not None
+
+
 coreconfigitem(
     b'format',
     b'use-persistent-nodemap',
-    default=False,
+    default=_persistent_nodemap_default,
 )
 # TODO needs to grow a docket file to at least store the last offset of the data
 # file when rewriting sidedata.