Mercurial > hg-stable
changeset 49485:ef0b0f94d2e5
compare-disco: move case parsing into its own function
This is open the way to the next changeset that will allow to specify a list of
heads.
author | Pierre-Yves DAVID <pierre-yves.david@octobus.net> |
---|---|
date | Sat, 04 Jun 2022 19:10:51 +0200 |
parents | ebbaf6a77807 |
children | 5acbc550d987 |
files | contrib/perf-utils/compare-discovery-case |
diffstat | 1 files changed, 8 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/contrib/perf-utils/compare-discovery-case Sat Jun 04 19:04:01 2022 +0200 +++ b/contrib/perf-utils/compare-discovery-case Sat Jun 04 19:10:51 2022 +0200 @@ -97,6 +97,12 @@ assert set(VARIANTS.keys()) == set(VARIANTS_KEYS) +def parse_case(case): + case_type, case_args = case.split('-', 1) + case = (case_type,) + tuple(int(x) for x in case_args.split('-')) + return case + + def format_case(case): return '-'.join(str(s) for s in case) @@ -210,8 +216,6 @@ print(usage, file=sys.stderr) sys.exit(128) repo = argv[1] - local_case = argv[2].split('-') - local_case = (local_case[0],) + tuple(int(x) for x in local_case[1:]) - remote_case = argv[3].split('-') - remote_case = (remote_case[0],) + tuple(int(x) for x in remote_case[1:]) + local_case = parse_case(argv[2]) + remote_case = parse_case(argv[3]) sys.exit(compare(repo, local_case, remote_case, **kwargs))