create_skip_file.py 871 Bytes
Newer Older
1
"""Generate list of revision to skip for some benchmark
2 3 4 5 6
"""
import json
import os
import subprocess

7
from benchmarks.utils import read_yaml_file
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32


def generate_skip_file(config):
    skip = {}
    for key, revsets in config["skip"].items():
        skiprev = set()
        for revset in revsets:
            for rev in subprocess.check_output(
                [
                    "hg",
                    "log",
                    "--cwd",
                    "mercurial",
                    "-r",
                    revset,
                    "-T",
                    "{node|short}\n",
                ]
            ).splitlines():
                skiprev.add(rev)
        skip[key] = list(skiprev)
    with open(os.path.join("repos", "skip.json"), "w") as f:
        json.dump(skip, f)


33
config = read_yaml_file("config.yaml")
34
skip = generate_skip_file(config)