##// END OF EJS Templates
annotate: memory efficiency...
mpm@selenic.com -
r200:8450c18f default
parent child Browse files
Show More
@@ -41,6 +41,7 b' class filelog(revlog):'
41 41 new += child[s:t]
42 42 return new
43 43
44 # find all ancestors
44 45 needed = {}
45 46 visit = [node]
46 47 while visit:
@@ -49,7 +50,11 b' class filelog(revlog):'
49 50 if p not in needed:
50 51 needed[p] = 1
51 52 visit.append(p)
53 else:
54 # count how many times we'll use this
55 needed[p] += 1
52 56
57 # sort by revision which is a topological order
53 58 visit = needed.keys()
54 59 visit = [ (self.rev(n), n) for n in visit ]
55 60 visit.sort()
@@ -61,6 +66,10 b' class filelog(revlog):'
61 66 for p in self.parents(n):
62 67 if p != nullid:
63 68 curr = pair(hist[p], curr)
69 # trim the history of unneeded revs
70 needed[p] -= 1
71 if not needed[p]:
72 del hist[p]
64 73 hist[n] = curr
65 74
66 75 return hist[n]
General Comments 0
You need to be logged in to leave comments. Login now