revlog: also use radix when computing nodemap data file
authorPierre-Yves David <pierre-yves.david@octobus.net>
Mon, 03 May 2021 12:22:57 +0200
changeset 47152 09338a2d5c14
parent 47151 24be247a13b4
child 47153 fbf38517d17d
revlog: also use radix when computing nodemap data file We have a radix, lets use it! Differential Revision: https://phab.mercurial-scm.org/D10578
mercurial/revlogutils/nodemap.py
--- a/mercurial/revlogutils/nodemap.py	Mon May 03 12:22:47 2021 +0200
+++ b/mercurial/revlogutils/nodemap.py	Mon May 03 12:22:57 2021 +0200
@@ -363,15 +363,12 @@
 
 def _rawdata_filepath(revlog, docket):
     """The (vfs relative) nodemap's rawdata file for a given uid"""
-    if revlog.nodemap_file.endswith(b'.n.a'):
-        prefix = revlog.nodemap_file[:-4]
-    else:
-        prefix = revlog.nodemap_file[:-2]
+    prefix = revlog.radix
     return b"%s-%s.nd" % (prefix, docket.uid)
 
 
 def _other_rawdata_filepath(revlog, docket):
-    prefix = revlog.nodemap_file[:-2]
+    prefix = revlog.radix
     pattern = re.compile(br"(^|/)%s-[0-9a-f]+\.nd$" % prefix)
     new_file_path = _rawdata_filepath(revlog, docket)
     new_file_name = revlog.opener.basename(new_file_path)