changeset 17917:12178f07de97

bookmark: issue a single call to `allsuccessors` per loop Update to this code was minimalist when `allsuccessors` argument were changed from a list to a set. As this code is getting my attention again I realised we can drastically simplify this part of the code by issue a single call to `allsuccessors`.
author Pierre-Yves David <pierre-yves.david@logilab.fr>
date Wed, 24 Oct 2012 17:55:21 +0200
parents ed225834b372
children 2eb5f4d1c235
files mercurial/bookmarks.py
diffstat 1 files changed, 2 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/bookmarks.py	Wed Oct 24 17:26:40 2012 +0200
+++ b/mercurial/bookmarks.py	Wed Oct 24 17:55:21 2012 +0200
@@ -263,11 +263,8 @@
         while len(validdests) != plen:
             plen = len(validdests)
             succs = set(c.node() for c in validdests)
-            for c in validdests:
-                if c.mutable():
-                    # obsolescence marker does not apply to public changeset
-                    succs.update(obsolete.allsuccessors(repo.obsstore,
-                                                        [c.node()]))
+            mutable = [c.node() for c in validdests if c.mutable()]
+            succs.update(obsolete.allsuccessors(repo.obsstore, mutable))
             known = (n for n in succs if n in nm)
             validdests = set(repo.set('%ln::', known))
         validdests.remove(old)