topic: provide cache to successorssets() in _singlesuccessor()
Since we're using obsutil.successorssets() in a loop, it may help performance
to have cache.
--- a/hgext3rd/topic/evolvebits.py Wed Apr 29 00:43:13 2020 +0800
+++ b/hgext3rd/topic/evolvebits.py Wed Apr 29 00:44:14 2020 +0800
@@ -75,14 +75,15 @@
return p.rev()
obs = repo[p]
ui = repo.ui
- newer = obsutil.successorssets(repo, obs.node())
+ cache = {}
+ newer = obsutil.successorssets(repo, obs.node(), cache=cache)
# search of a parent which is not killed
while not newer:
ui.debug(b"stabilize target %s is plain dead,"
b" trying to stabilize on its parent\n" %
obs)
obs = obs.p1()
- newer = obsutil.successorssets(repo, obs.node())
+ newer = obsutil.successorssets(repo, obs.node(), cache=cache)
if 1 < len(newer):
# divergence case
# we should pick as arbitrary one