comparison mercurial/localrepo.py @ 18092:ff36650e4238

localrepo: use lazy ancestor membership testing For a repository with over 400,000 commits, rebasing one revision near tip, this avoids two treks up the DAG, speeding the operation up by around 1.6 seconds.
author Siddharth Agarwal <sid0@fb.com>
date Mon, 17 Dec 2012 20:43:37 -0800
parents 739c88ff043c
children 3a6ddacb7198
comparison
equal deleted inserted replaced
18091:f7f8159caad3 18092:ff36650e4238
2079 cl = self.changelog 2079 cl = self.changelog
2080 if not bases: 2080 if not bases:
2081 bases = [nullid] 2081 bases = [nullid]
2082 csets, bases, heads = cl.nodesbetween(bases, heads) 2082 csets, bases, heads = cl.nodesbetween(bases, heads)
2083 # We assume that all ancestors of bases are known 2083 # We assume that all ancestors of bases are known
2084 common = set(cl.ancestors([cl.rev(n) for n in bases])) 2084 common = cl.ancestors([cl.rev(n) for n in bases])
2085 return self._changegroupsubset(common, csets, heads, source) 2085 return self._changegroupsubset(common, csets, heads, source)
2086 2086
2087 def getlocalbundle(self, source, outgoing): 2087 def getlocalbundle(self, source, outgoing):
2088 """Like getbundle, but taking a discovery.outgoing as an argument. 2088 """Like getbundle, but taking a discovery.outgoing as an argument.
2089 2089