mirror of
https://github.com/facebook/sapling.git
synced 2024-12-26 14:34:34 +03:00
mutation: remove exponential algorithm from obsoletenodes
Summary: Computing all successorsets is exponential with the number of splits that have happened. This can slow things down tremendously. The obsoletenodes path only needs to know "is there a visible successor" in order to determine if a draft commit is obsolete. Let's use allsuccessors instead of successorset. Reviewed By: quark-zju Differential Revision: D23771025 fbshipit-source-id: 666875e681c2e3306fc301357c95f1ab5bb40a87
This commit is contained in:
parent
923bac59b2
commit
41b0cf71e8
@ -315,10 +315,11 @@ class obsoletecache(object):
|
||||
clrev = repo.changelog.rev
|
||||
obsolete = self.obsolete[None]
|
||||
for node in repo.nodes("not public()"):
|
||||
succsets = successorssets(repo, node, closest=True)
|
||||
if succsets != [[node]]:
|
||||
if any(clhasnode(succ) for succset in succsets for succ in succset):
|
||||
obsolete.add(node)
|
||||
if any(
|
||||
clhasnode(succ)
|
||||
for succ in allsuccessors(repo, [node], startdepth=1)
|
||||
):
|
||||
obsolete.add(node)
|
||||
candidates = set(obsolete)
|
||||
seen = set(obsolete)
|
||||
while candidates:
|
||||
|
Loading…
Reference in New Issue
Block a user