[Commented On] D10606: revlog: rename variable in `rewrite_sidedata` to match other code

baymax (Baymax, Your Personal Patch-care Companion) phabricator at mercurial-scm.org
Tue May 4 01:55:55 UTC 2021


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


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

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D10606?vs=27383&id=27521

BRANCH
  default

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

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

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
@@ -3145,10 +3145,10 @@
 
         new_entries = []
         # append the new sidedata
-        with self._datafp(b'a+') as fp:
+        with self._datafp(b'a+') as dfh:
             # Maybe this bug still exists, see revlog._writeentry
-            fp.seek(0, os.SEEK_END)
-            current_offset = fp.tell()
+            dfh.seek(0, os.SEEK_END)
+            current_offset = dfh.tell()
             for rev in range(startrev, endrev + 1):
                 entry = self.index[rev]
                 new_sidedata, flags = sidedatautil.run_sidedata_helpers(
@@ -3174,12 +3174,12 @@
                 entry = (new_offset_flags,) + entry[1:8]
                 entry += (current_offset, len(serialized_sidedata))
 
-                fp.write(serialized_sidedata)
+                dfh.write(serialized_sidedata)
                 new_entries.append(entry)
                 current_offset += len(serialized_sidedata)
 
         # rewrite the new index entries
-        with self._indexfp(b'r+') as fp:
+        with self._indexfp(b'r+') as ifh:
             fp.seek(startrev * self.index.entry_size)
             for i, e in enumerate(new_entries):
                 rev = startrev + i
@@ -3189,4 +3189,4 @@
                     header = self._format_flags | self._format_version
                     header = self.index.pack_header(header)
                     packed = header + packed
-                fp.write(packed)
+                ifh.write(packed)



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/20210504/66319dfd/attachment-0002.html>


More information about the Mercurial-patches mailing list