##// END OF EJS Templates
branchmap: avoid changelog and attribute lookups in replacecache()...
Gregory Szorc -
r40411:76d4272b default
parent child Browse files
Show More
@@ -130,18 +130,21 b' def replacecache(repo, bm):'
130
130
131 This is likely only called during clone with a branch map from a remote.
131 This is likely only called during clone with a branch map from a remote.
132 """
132 """
133 cl = repo.changelog
134 clrev = cl.rev
135 clbranchinfo = cl.branchinfo
133 rbheads = []
136 rbheads = []
134 closed = []
137 closed = []
135 for bheads in bm.itervalues():
138 for bheads in bm.itervalues():
136 rbheads.extend(bheads)
139 rbheads.extend(bheads)
137 for h in bheads:
140 for h in bheads:
138 r = repo.changelog.rev(h)
141 r = clrev(h)
139 b, c = repo.changelog.branchinfo(r)
142 b, c = clbranchinfo(r)
140 if c:
143 if c:
141 closed.append(h)
144 closed.append(h)
142
145
143 if rbheads:
146 if rbheads:
144 rtiprev = max((int(repo.changelog.rev(node))
147 rtiprev = max((int(clrev(node))
145 for node in rbheads))
148 for node in rbheads))
146 cache = branchcache(bm,
149 cache = branchcache(bm,
147 repo[rtiprev].node(),
150 repo[rtiprev].node(),
General Comments 0
You need to be logged in to leave comments. Login now