[PATCH 6 of 7] revlog: indent block to make review easier

Jun Wu quark at fb.com
Tue Mar 28 03:49:07 EDT 2017


# HG changeset patch
# User Jun Wu <quark at fb.com>
# Date 1490683470 25200
#      Mon Mar 27 23:44:30 2017 -0700
# Node ID d3d803ed16fe8e9d43f7a4daeca079e4022c297a
# Parent  aecce2adbd64b25325e559798baa617e7311e85f
# Available At https://bitbucket.org/quark-zju/hg-draft
#              hg pull https://bitbucket.org/quark-zju/hg-draft -r d3d803ed16fe
revlog: indent block to make review easier

This patch indents a block in revlog.revision to make reviewing the next
patch easier.

diff --git a/mercurial/revlog.py b/mercurial/revlog.py
--- a/mercurial/revlog.py
+++ b/mercurial/revlog.py
@@ -1277,17 +1277,18 @@ class revlog(object):
             rev = self.rev(node)
 
-        chain, stopped = self._deltachain(rev, stoprev=cachedrev)
-        if stopped:
-            text = self._cache[2]
-
-        # drop cache to save memory
-        self._cache = None
+        if text is None:
+            chain, stopped = self._deltachain(rev, stoprev=cachedrev)
+            if stopped:
+                text = self._cache[2]
 
-        bins = self._chunks(chain, df=_df)
-        if text is None:
-            text = bytes(bins[0])
-            bins = bins[1:]
+            # drop cache to save memory
+            self._cache = None
 
-        text = mdiff.patches(text, bins)
+            bins = self._chunks(chain, df=_df)
+            if text is None:
+                text = bytes(bins[0])
+                bins = bins[1:]
+
+            text = mdiff.patches(text, bins)
 
         if flags is None:


More information about the Mercurial-devel mailing list