pushbookmark: stop unrolling ancestors
authorPierre-Yves David <pierre-yves.david@fb.com>
Fri, 15 Aug 2014 16:31:06 -0700
changeset 22226 827bce9e24fb
parent 22225 baecf4e1b7d0
child 22227 98cbd41cb532
pushbookmark: stop unrolling ancestors Now that ancestors has the same boolean property as a list, we can stop unrolling the set of ancestors. This should provide a significant speedup to this step as ancestor objects are smart and lazy.
mercurial/exchange.py
--- a/mercurial/exchange.py	Fri Aug 15 15:57:50 2014 -0700
+++ b/mercurial/exchange.py	Fri Aug 15 16:31:06 2014 -0700
@@ -618,7 +618,7 @@
     remote = pushop.remote
     ui.debug("checking for updated bookmarks\n")
     revnums = map(repo.changelog.rev, pushop.revs or [])
-    ancestors = [a for a in repo.changelog.ancestors(revnums, inclusive=True)]
+    ancestors = repo.changelog.ancestors(revnums, inclusive=True)
     (addsrc, adddst, advsrc, advdst, diverge, differ, invalid
      ) = bookmarks.compare(repo, repo._bookmarks, remote.listkeys('bookmarks'),
                            srchex=hex)