changeset 47152:09338a2d5c14

revlog: also use radix when computing nodemap data file We have a radix, lets use it! Differential Revision: https://phab.mercurial-scm.org/D10578
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Mon, 03 May 2021 12:22:57 +0200
parents 24be247a13b4
children fbf38517d17d
files mercurial/revlogutils/nodemap.py
diffstat 1 files changed, 2 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- 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)