persistent-nodemap: respect the mmap setting when refreshing data
After writing updated data, we reload the in-memory data. However, that logic
was… wrong. We were doing file read when mmap was requested and when the
configuration was requesting to not use mmap… we were using it.
This should now be fine.
--- a/mercurial/revlogutils/nodemap.py Thu Dec 07 03:49:48 2023 +0100
+++ b/mercurial/revlogutils/nodemap.py Thu Dec 21 01:45:43 2023 +0100
@@ -206,11 +206,11 @@
fd.write(data)
if feed_data:
if use_mmap:
+ fd.flush()
+ new_data = util.buffer(util.mmapread(fd, new_length))
+ else:
fd.seek(0)
new_data = fd.read(new_length)
- else:
- fd.flush()
- new_data = util.buffer(util.mmapread(fd, new_length))
target_docket.data_length = new_length
target_docket.data_unused = new_unused