evolve: provide cache to successorssets() in _possibledestination()
authorAnton Shestakov <av6@dwimlabs.net>
Wed, 29 Apr 2020 00:28:15 +0800
changeset 5310 6d0d9ba04a1d
parent 5309 9923c6d6f0a8
child 5311 77a77d0f5441
evolve: provide cache to successorssets() in _possibledestination() Since we're using obsutil.successorssets() in a loop, it may help performance to have cache.
hgext3rd/evolve/evolvecmd.py
--- a/hgext3rd/evolve/evolvecmd.py	Sun Mar 29 17:41:48 2020 +0700
+++ b/hgext3rd/evolve/evolvecmd.py	Wed Apr 29 00:28:15 2020 +0800
@@ -1198,11 +1198,12 @@
     torev = repo.changelog.rev
     dest = set()
     tovisit = list(parents(rev))
+    cache = {}
     while tovisit:
         r = tovisit.pop()
         if r == -1:
             continue
-        succsets = obsutil.successorssets(repo, tonode(r))
+        succsets = obsutil.successorssets(repo, tonode(r), cache=cache)
         if not succsets:
             tovisit.extend(parents(r))
         else: