##// END OF EJS Templates
Optimize annotate a bit...
mpm@selenic.com -
r436:6aeb4fee default
parent child Browse files
Show More
@@ -63,19 +63,16 b' class filelog(revlog):'
63 def annotate(self, node):
63 def annotate(self, node):
64
64
65 def decorate(text, rev):
65 def decorate(text, rev):
66 return [(rev, l) for l in text.splitlines(1)]
66 return ([rev] * len(text.splitlines()), text)
67
68 def strip(annotation):
69 return "".join([e[1] for e in annotation])
70
67
71 def pair(parent, child):
68 def pair(parent, child):
72 new = []
69 new = []
73 lb = 0
70 lb = 0
74 for a1, a2, b1, b2 in bdiff.blocks(strip(parent), strip(child)):
71 for a1, a2, b1, b2 in bdiff.blocks(parent[1], child[1]):
75 new += child[lb:b1]
72 new[lb:] = child[0][lb:b1]
76 new += parent[a1:a2]
73 new[b1:] = parent[0][a1:a2]
77 lb = b2
74 lb = b2
78 return new
75 return (new, child[1])
79
76
80 # find all ancestors
77 # find all ancestors
81 needed = {node:1}
78 needed = {node:1}
@@ -108,7 +105,7 b' class filelog(revlog):'
108 del hist[p]
105 del hist[p]
109 hist[n] = curr
106 hist[n] = curr
110
107
111 return hist[n]
108 return zip(hist[n][0], hist[n][1].splitlines(1))
112
109
113 class manifest(revlog):
110 class manifest(revlog):
114 def __init__(self, opener):
111 def __init__(self, opener):
General Comments 0
You need to be logged in to leave comments. Login now