[PATCH 3 of 6] pushbookmark: stop unrolling ancestors
Pierre-Yves David
pierre-yves.david at ens-lyon.org
Mon Aug 18 16:50:01 CDT 2014
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at fb.com>
# Date 1408145466 25200
# Fri Aug 15 16:31:06 2014 -0700
# Node ID 032e5a4ffd4341b22f2135d26cd8172e64cabfb6
# Parent 45f5b72530ad0be0c6ae2af17af70f461274c9e4
pushbookmark: stop unrolling ancestors
Now that ancestors has the same boolean property as list, we can stop unrolling
the set of ancestors. This should provide significant speedup to this step as
ancestors object are smart and lazy.
diff --git a/mercurial/exchange.py b/mercurial/exchange.py
--- a/mercurial/exchange.py
+++ b/mercurial/exchange.py
@@ -616,11 +616,11 @@ def _pushbookmark(pushop):
ui = pushop.ui
repo = pushop.repo.unfiltered()
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)
for b, scid, dcid in advsrc:
More information about the Mercurial-devel
mailing list