Patchwork D7891: nodemap: write new data from the expected current data length

login
register
mail settings
Submitter phabricator
Date Feb. 5, 2020, 12:27 a.m.
Message ID <974446ad3d4b80a1e39645efa839f648@localhost.localdomain>
Download mbox | patch
Permalink /patch/44947/
State Not Applicable
Headers show

Comments

phabricator - Feb. 5, 2020, 12:27 a.m.
marmoute added a comment.
marmoute updated this revision to Diff 19903.


  rebase to latest default

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7891?vs=19843&id=19903

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7891/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7891

AFFECTED FILES
  mercurial/revlogutils/nodemap.py

CHANGE DETAILS




To: marmoute, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/mercurial/revlogutils/nodemap.py b/mercurial/revlogutils/nodemap.py
--- a/mercurial/revlogutils/nodemap.py
+++ b/mercurial/revlogutils/nodemap.py
@@ -92,7 +92,8 @@ 
             datafile = _rawdata_filepath(revlog, target_docket)
             # EXP-TODO: if this is a cache, this should use a cache vfs, not a
             # store vfs
-            with revlog.opener(datafile, b'a') as fd:
+            with revlog.opener(datafile, b'r+') as fd:
+                fd.seek(target_docket.data_length)
                 fd.write(data)
             target_docket.data_length += len(data)
             target_docket.data_unused += data_changed_count