mmap: fix another instance of reverse mmap logic in persistent nodemap stable
authorPierre-Yves David <pierre-yves.david@octobus.net>
Wed, 03 Jul 2024 12:47:08 +0200
branchstable
changeset 51655 8e24f4f86ba8
parent 51654 c0e30a019ce1
child 51656 21442f87f7fa
mmap: fix another instance of reverse mmap logic in persistent nodemap This fix the same kind of issue as 85d96517e650
mercurial/revlogutils/nodemap.py
--- a/mercurial/revlogutils/nodemap.py	Wed Jul 03 12:31:21 2024 +0200
+++ b/mercurial/revlogutils/nodemap.py	Wed Jul 03 12:47:08 2024 +0200
@@ -239,10 +239,10 @@
             fd.write(data)
             if feed_data:
                 if use_mmap:
-                    new_data = data
-                else:
                     fd.flush()
                     new_data = util.buffer(util.mmapread(fd, len(data)))
+                else:
+                    new_data = data
         target_docket.data_length = len(data)
     target_docket.tip_rev = revlog.tiprev()
     target_docket.tip_node = revlog.node(target_docket.tip_rev)