[PATCH 2 of 3 V2] revlog: indent block to make review easier

Jun Wu quark at fb.com
Sun Apr 2 21:43:00 EDT 2017


# HG changeset patch
# User Jun Wu <quark at fb.com>
# Date 1491182964 25200
#      Sun Apr 02 18:29:24 2017 -0700
# Node ID e5669675e4f24e98c99165c112fa81db66ff6094
# Parent  0413ffdb4a294c9d4c7b9b9c41eb733f82d7556b
# Available At https://bitbucket.org/quark-zju/hg-draft
#              hg pull https://bitbucket.org/quark-zju/hg-draft -r e5669675e4f2
revlog: indent block to make review easier

diff --git a/mercurial/revlog.py b/mercurial/revlog.py
--- a/mercurial/revlog.py
+++ b/mercurial/revlog.py
@@ -1289,20 +1289,21 @@ class revlog(object):
         # look up what we need to read
         rawtext = None
-        if rev is None:
-            rev = self.rev(node)
+        if rawtext is None:
+            if rev is None:
+                rev = self.rev(node)
 
-        chain, stopped = self._deltachain(rev, stoprev=cachedrev)
-        if stopped:
-            rawtext = self._cache[2]
+            chain, stopped = self._deltachain(rev, stoprev=cachedrev)
+            if stopped:
+                rawtext = self._cache[2]
 
-        # drop cache to save memory
-        self._cache = None
+            # drop cache to save memory
+            self._cache = None
 
-        bins = self._chunks(chain, df=_df)
-        if rawtext is None:
-            rawtext = bytes(bins[0])
-            bins = bins[1:]
+            bins = self._chunks(chain, df=_df)
+            if rawtext is None:
+                rawtext = bytes(bins[0])
+                bins = bins[1:]
 
-        rawtext = mdiff.patches(rawtext, bins)
+            rawtext = mdiff.patches(rawtext, bins)
 
         if flags is None:


More information about the Mercurial-devel mailing list