changeset 471:4c7f687e4313

Minor annotate performance tweaks -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Minor annotate performance tweaks manifest hash: 2edd508182c7b3dfb2e0b9b90baebdd364cb29f0 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) iD8DBQFCvfQeywK+sNU5EO8RAsYSAJ0R8SuWnyQxVgauoaEuezOe3Taq/wCbBnEs +VG0LNrXnQM9khQyc0+pCeg= =U5gX -----END PGP SIGNATURE-----
author mpm@selenic.com
date Sat, 25 Jun 2005 16:17:34 -0800
parents 0ab093b473c5
children aa3d592df9b9
files mercurial/hg.py
diffstat 1 files changed, 4 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/hg.py	Sat Jun 25 00:16:39 2005 -0800
+++ b/mercurial/hg.py	Sat Jun 25 16:17:34 2005 -0800
@@ -50,13 +50,9 @@
             return ([rev] * len(text.splitlines()), text)
 
         def pair(parent, child):
-            new = []
-            lb = 0
             for a1, a2, b1, b2 in bdiff.blocks(parent[1], child[1]):
-                new[lb:] = child[0][lb:b1]
-                new[b1:] = parent[0][a1:a2]
-                lb = b2
-            return (new, child[1])
+                child[0][b1:b2] = parent[0][a1:a2]
+            return child
 
         # find all ancestors
         needed = {node:1}
@@ -72,13 +68,11 @@
                     needed[p] += 1
 
         # sort by revision which is a topological order
-        visit = needed.keys()
-        visit = [ (self.rev(n), n) for n in visit ]
+        visit = [ (self.rev(n), n) for n in needed.keys() ]
         visit.sort()
-        visit = [ p[1] for p in visit ]
         hist = {}
 
-        for n in visit:
+        for r,n in visit:
             curr = decorate(self.read(n), self.linkrev(n))
             for p in self.parents(n):
                 if p != nullid: