changeset 47215:042388bba644

revlog: rename variable in `rewrite_sidedata` to match other code Let's call the index file object and `ifh` and the data file object `dfh` as the rest of the revlog code. This will make future change clearer. Differential Revision: https://phab.mercurial-scm.org/D10606
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Mon, 03 May 2021 12:27:53 +0200
parents 906a7bcaac86
children 2bd4b5218918
files mercurial/revlog.py
diffstat 1 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/revlog.py	Mon May 03 12:27:42 2021 +0200
+++ b/mercurial/revlog.py	Mon May 03 12:27:53 2021 +0200
@@ -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)