Patchwork D10604: revlog: preindent some code in _enforceinlinesize

login
register
mail settings
Submitter phabricator
Date May 3, 2021, 12:07 p.m.
Message ID <differential-rev-PHID-DREV-ermyfl2lfp2fqty2qzep-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/48922/
State Superseded
Headers show

Comments

phabricator - May 3, 2021, 12:07 p.m.
marmoute created this revision.
Herald added a reviewer: indygreg.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  Indenting this beforehand will make a future changeset much simpler.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/revlog.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/revlog.py b/mercurial/revlog.py
--- a/mercurial/revlog.py
+++ b/mercurial/revlog.py
@@ -1982,29 +1982,30 @@ 
             # its usage.
             self._writinghandles = None
 
-        with self._indexfp(b'r') as ifh, self._datafp(b'w') as dfh:
-            for r in self:
-                dfh.write(self._getsegmentforrevs(r, r, df=ifh)[1])
-                if troffset <= self.start(r):
-                    trindex = r
-
-        with self._indexfp(b'w') as fp:
-            self._format_flags &= ~FLAG_INLINE_DATA
-            self._inline = False
-            for i in self:
-                e = self.index.entry_binary(i)
-                if i == 0:
-                    header = self._format_flags | self._format_version
-                    header = self.index.pack_header(header)
-                    e = header + e
-                fp.write(e)
-
-            # the temp file replace the real index when we exit the context
-            # manager
-
-        tr.replace(self._indexfile, trindex * self.index.entry_size)
-        nodemaputil.setup_persistent_nodemap(tr, self)
-        self._chunkclear()
+        if True:
+            with self._indexfp(b'r') as ifh, self._datafp(b'w') as dfh:
+                for r in self:
+                    dfh.write(self._getsegmentforrevs(r, r, df=ifh)[1])
+                    if troffset <= self.start(r):
+                        trindex = r
+
+            with self._indexfp(b'w') as fp:
+                self._format_flags &= ~FLAG_INLINE_DATA
+                self._inline = False
+                for i in self:
+                    e = self.index.entry_binary(i)
+                    if i == 0:
+                        header = self._format_flags | self._format_version
+                        header = self.index.pack_header(header)
+                        e = header + e
+                    fp.write(e)
+
+                # the temp file replace the real index when we exit the context
+                # manager
+
+            tr.replace(self._indexfile, trindex * self.index.entry_size)
+            nodemaputil.setup_persistent_nodemap(tr, self)
+            self._chunkclear()
 
     def _nodeduplicatecallback(self, transaction, node):
         """called when trying to add a node already stored."""