mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 07:17:55 +03:00
branch heads: optimise computation of branch head cache (issue1734)
The previous branch heads cache implementation iterated all ancestors for each new revision in the repository, causing a massive slowdown on cloning larger repositories.
This commit is contained in:
parent
afad34fc2e
commit
180b39fb48
@ -473,9 +473,8 @@ class localrepository(repo.repository):
|
||||
latest = newnodes.pop()
|
||||
if latest not in bheads:
|
||||
continue
|
||||
reachable = set()
|
||||
for bh in bheads:
|
||||
reachable |= self.changelog.reachable(latest, bh)
|
||||
minbhrev = self[min([self[bh].rev() for bh in bheads])].node()
|
||||
reachable = self.changelog.reachable(latest, minbhrev)
|
||||
bheads = [b for b in bheads if b not in reachable]
|
||||
newbheads.insert(0, latest)
|
||||
bheads.extend(newbheads)
|
||||
|
Loading…
Reference in New Issue
Block a user