##// END OF EJS Templates
copies: cache the ancestor checking call when tracing copy...
marmoute -
r46504:06b64fab default
parent child Browse files
Show More
@@ -230,6 +230,24 b' def _revinfo_getter(repo):'
230 230 return revinfo
231 231
232 232
233 def cached_is_ancestor(is_ancestor):
234 """return a cached version of is_ancestor"""
235 cache = {}
236
237 def _is_ancestor(anc, desc):
238 if anc > desc:
239 return False
240 elif anc == desc:
241 return True
242 key = (anc, desc)
243 ret = cache.get(key)
244 if ret is None:
245 ret = cache[key] = is_ancestor(anc, desc)
246 return ret
247
248 return _is_ancestor
249
250
233 251 def _changesetforwardcopies(a, b, match):
234 252 if a.rev() in (node.nullrev, b.rev()):
235 253 return {}
@@ -238,7 +256,7 b' def _changesetforwardcopies(a, b, match)'
238 256 children = {}
239 257
240 258 cl = repo.changelog
241 isancestor = cl.isancestorrev # XXX we should had chaching to this.
259 isancestor = cached_is_ancestor(cl.isancestorrev)
242 260 missingrevs = cl.findmissingrevs(common=[a.rev()], heads=[b.rev()])
243 261 mrset = set(missingrevs)
244 262 roots = set()
General Comments 0
You need to be logged in to leave comments. Login now