changeset 51766:f0be60ed6242

manifest: align some vfs option access on the fact we might not have options This make the usage consistent with the other option. Caught by pytype.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Sun, 04 Aug 2024 10:48:51 +0200
parents 50b3ff0ec297
children 61976dece720
files mercurial/manifest.py
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/manifest.py	Sun Aug 04 10:49:48 2024 +0200
+++ b/mercurial/manifest.py	Sun Aug 04 10:48:51 2024 +0200
@@ -1605,10 +1605,12 @@
         # stacks of commits, the number can go up, hence the config knob below.
         cachesize = 4
         optiontreemanifest = False
+        persistentnodemap = False
         opts = getattr(opener, 'options', None)
         if opts is not None:
             cachesize = opts.get(b'manifestcachesize', cachesize)
             optiontreemanifest = opts.get(b'treemanifest', False)
+            persistentnodemap = opts.get(b'persistent-nodemap', False)
 
         self._treeondisk = optiontreemanifest or treemanifest
 
@@ -1637,7 +1639,7 @@
             checkambig=not bool(tree),
             mmaplargeindex=True,
             upperboundcomp=MAXCOMPRESSION,
-            persistentnodemap=opener.options.get(b'persistent-nodemap', False),
+            persistentnodemap=persistentnodemap,
         )
 
         self.index = self._revlog.index