changeset 47133:5e5fad5166e6

revlog: adjust rewrite_sidedata code to not delete existing revlog content The "w+" file mode is deleting all the content of the opened file. Which is bad… This is not caught by the test because the test only check for a full, initial pull where not pre-existing content exists. So we need to fix our test coverage here. However they are another issue that prevent "incremental" pull to work here. See next changeset for details. Differential Revision: https://phab.mercurial-scm.org/D10543
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Mon, 03 May 2021 12:18:48 +0200
parents 65e6970042c5
children 1b33e38d4b6d
files mercurial/revlog.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/revlog.py	Fri May 07 17:33:47 2021 +0200
+++ b/mercurial/revlog.py	Mon May 03 12:18:48 2021 +0200
@@ -3118,7 +3118,7 @@
                 current_offset += len(serialized_sidedata)
 
         # rewrite the new index entries
-        with self._indexfp(b'w+') as fp:
+        with self._indexfp(b'r+') as fp:
             fp.seek(startrev * self.index.entry_size)
             for i, e in enumerate(new_entries):
                 rev = startrev + i