[Commented On] D10609: revlog: use `_writing` in `rewrite_sidedata`

baymax (Baymax, Your Personal Patch-care Companion) phabricator at mercurial-scm.org
Tue May 11 18:07:21 UTC 2021


baymax added a comment.
baymax updated this revision to Diff 27855.


  ✅ refresh by Heptapod after a successful CI run (🐙 💚)

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D10609?vs=27524&id=27855

BRANCH
  default

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

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

AFFECTED FILES
  mercurial/revlog.py

CHANGE DETAILS

diff --git a/mercurial/revlog.py b/mercurial/revlog.py
--- a/mercurial/revlog.py
+++ b/mercurial/revlog.py
@@ -3157,8 +3157,8 @@
 
         new_entries = []
         # append the new sidedata
-        with self._datafp(b'a+') as dfh:
-            # Maybe this bug still exists, see revlog._writeentry
+        with self._writing(transaction):
+            ifh, dfh = self._writinghandles
             dfh.seek(0, os.SEEK_END)
             current_offset = dfh.tell()
             for rev in range(startrev, endrev + 1):
@@ -3192,9 +3192,8 @@
                 new_entries.append(entry)
                 current_offset += len(serialized_sidedata)
 
-        # rewrite the new index entries
-        with self._indexfp(b'r+') as ifh:
-            fp.seek(startrev * self.index.entry_size)
+            # rewrite the new index entries
+            ifh.seek(startrev * self.index.entry_size)
             for i, e in enumerate(new_entries):
                 rev = startrev + i
                 self.index.replace_sidedata_info(rev, e[8], e[9], e[0])



To: marmoute, indygreg, #hg-reviewers
Cc: mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20210511/b9d40615/attachment-0002.html>


More information about the Mercurial-patches mailing list