Mercurial > public > mercurial-scm > hg
comparison mercurial/revlogutils/nodemap.py @ 51652:8e24f4f86ba8 stable
mmap: fix another instance of reverse mmap logic in persistent nodemap
This fix the same kind of issue as 85d96517e650
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Wed, 03 Jul 2024 12:47:08 +0200 |
parents | 85d96517e650 |
children | 21442f87f7fa |
comparison
equal
deleted
inserted
replaced
51651:c0e30a019ce1 | 51652:8e24f4f86ba8 |
---|---|
237 tr.addabort(callback_id, abortck) | 237 tr.addabort(callback_id, abortck) |
238 with revlog.opener(datafile, b'w+') as fd: | 238 with revlog.opener(datafile, b'w+') as fd: |
239 fd.write(data) | 239 fd.write(data) |
240 if feed_data: | 240 if feed_data: |
241 if use_mmap: | 241 if use_mmap: |
242 new_data = data | |
243 else: | |
244 fd.flush() | 242 fd.flush() |
245 new_data = util.buffer(util.mmapread(fd, len(data))) | 243 new_data = util.buffer(util.mmapread(fd, len(data))) |
244 else: | |
245 new_data = data | |
246 target_docket.data_length = len(data) | 246 target_docket.data_length = len(data) |
247 target_docket.tip_rev = revlog.tiprev() | 247 target_docket.tip_rev = revlog.tiprev() |
248 target_docket.tip_node = revlog.node(target_docket.tip_rev) | 248 target_docket.tip_node = revlog.node(target_docket.tip_rev) |
249 # EXP-TODO: if this is a cache, this should use a cache vfs, not a | 249 # EXP-TODO: if this is a cache, this should use a cache vfs, not a |
250 # store vfs | 250 # store vfs |