changeset 12887:8ce6240587b1 stable

revlog: simplify cachedelta handling
author Matt Mackall <mpm@selenic.com>
date Sat, 30 Oct 2010 02:47:34 -0500
parents c25945a148c1
children ad01fe38afe6
files mercurial/revlog.py
diffstat 1 files changed, 5 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- 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)