[PATCH 1 of 6 V3] revset: make revsbetween public
Laurent Charignon
lcharignon at fb.com
Fri Aug 7 17:38:10 UTC 2015
# HG changeset patch
# User Laurent Charignon <lcharignon at fb.com>
# Date 1438938822 25200
# Fri Aug 07 02:13:42 2015 -0700
# Branch stable
# Node ID c5d77654f500692aae08a0f5b0026e200b0971b7
# Parent 79f0cb97d7537a7c2948f8f9b0a89148825a3a1d
revset: make revsbetween public
This patch is part of a series of patches to speed up the computation of
revset.revsbetween by introducing a C implementation. The main motivation is to
speed up smartlog on big repositories. At the end of the series, on our big
repositories the computation of revsbetween is 10-50x faster and smartlog on is
2x-5x faster.
Later in this serie, we want to reuse the implementation of revsbetween in the
changelog module, therefore, we make it public.
diff --git a/mercurial/revset.py b/mercurial/revset.py
--- a/mercurial/revset.py
+++ b/mercurial/revset.py
@@ -78,7 +78,7 @@
return generatorset(iterate(), iterasc=True)
-def _revsbetween(repo, roots, heads):
+def revsbetween(repo, roots, heads):
"""Return all paths between roots and heads, inclusive of both endpoint
sets."""
if not roots:
@@ -382,7 +382,7 @@
def dagrange(repo, subset, x, y):
r = fullreposet(repo)
- xs = _revsbetween(repo, getset(repo, r, x), getset(repo, r, y))
+ xs = revsbetween(repo, getset(repo, r, x), getset(repo, r, y))
# XXX We should combine with subset first: 'subset & baseset(...)'. This is
# necessary to ensure we preserve the order in subset.
return xs & subset
More information about the Mercurial-devel
mailing list