revlog: simplify cachedelta handling stable
authorMatt Mackall <mpm@selenic.com>
Sat, 30 Oct 2010 02:47:34 -0500
branchstable
changeset 12887 8ce6240587b1
parent 12886 c25945a148c1
child 12888 ad01fe38afe6
revlog: simplify cachedelta handling
mercurial/revlog.py
--- a/mercurial/revlog.py	Sat Oct 30 02:47:34 2010 -0500
+++ b/mercurial/revlog.py	Sat Oct 30 02:47:34 2010 -0500
@@ -1188,14 +1188,12 @@
         # should we try to build a delta?
         if deltarev != nullrev:
             # can we use the cached delta?
-            if cachedelta:
-                cacherev, d = cachedelta
-                if cacherev != deltarev:
-                    text = buildtext()
-                    d = None
-            if d is None:
+            if cachedelta and cachedelta[0] == deltarev:
+                d = cachedelta[1]
+            else:
+                t = buildtext()
                 ptext = self.revision(deltanode)
-                d = mdiff.textdiff(ptext, text)
+                d = mdiff.textdiff(ptext, t)
             data = compress(d)
             l = len(data[1]) + len(data[0])
             base = self.base(deltarev)