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

login
register
mail settings
Submitter Jun Wu
Date April 3, 2017, 1:43 a.m.
Message ID <e5669675e4f24e98c991.1491183780@x1c>
Download mbox | patch
Permalink /patch/19921/
State Accepted
Headers show

Comments

Jun Wu - April 3, 2017, 1:43 a.m.
# HG changeset patch
# User Jun Wu <quark@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

Patch

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: