Newer
Older
from .utils import BaseTestSuite
VARIANTS = ["plain", "first", "last", "sort", "sort+first", "sort+last"]
def create_revset_benchmark(baseset):
def f(self, repo, variant, *args, **kwargs):
revset = baseset
if variant != "plain":
for var in variant.split("+"):
revset = "%s(%s)" % (var, revset)
return self.perfext('perfrevset', revset)
f.__name__ = "track_revset_" + "_".join("".join([
c if c in string.digits + string.letters else " "
for c in baseset
]).split())
class RevsetTestSuite(BaseTestSuite):
param_names = BaseTestSuite.param_names + ['variant']
params = BaseTestSuite.params + [VARIANTS]
def _inizialize():
"heads(ancestors(tip))",
"draft() and ::tip",
"::tip and draft()",
"0::tip",
"roots(0::tip)",
"tip:0",
"0::",
# those two `roots(...)` inputs are close to what phase movement use.
"roots((tip~100::) - (tip~100::tip))",
"roots((0::) - (0::tip))",
"42:68 and roots(42:tip)",
"::p1(p1(tip))::",
"public()",
":10000 and public()",
"draft()",
":10000 and draft()",
"roots((0:tip)::)",
"(not public() - obsolete())",
r"(_intlist('20000\x0020001')) and merge()",
"parents(20000)",
"(20000::) - (20000)",
# The one below is used by rebase
"(children(ancestor(tip~5, tip)) and ::(tip~5))::",
"heads(commonancestors(last(head(), 2)))",
"heads(-10000:-1)",
"roots(-10000:-1)",
"only(max(head()), min(head()))",
setattr(RevsetTestSuite, func.__name__, func)
_inizialize()
del _inizialize