changeset 5265:77a77d0f5441

evolve: provide cache to successorssets() in _singlesuccessor() Since we're using obsutil.successorssets() in a loop, it may help performance to have cache.
author Anton Shestakov <av6@dwimlabs.net>
date Wed, 29 Apr 2020 00:43:13 +0800
parents 6d0d9ba04a1d
children 9035901412e6
files hgext3rd/evolve/utility.py
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/hgext3rd/evolve/utility.py	Wed Apr 29 00:28:15 2020 +0800
+++ b/hgext3rd/evolve/utility.py	Wed Apr 29 00:43:13 2020 +0800
@@ -112,14 +112,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 len(newer) > 1 or len(newer[0]) > 1:
         raise MultipleSuccessorsError(newer)