# HG changeset patch # User Pierre-Yves David # Date 1686008890 -7200 # Node ID 3ce370a00225dc8f05b8d119f29c6fd7422c3c20 # Parent b10c786b0145758b761bb7ec58ef3cd04f7eb15e perf: add support for stream-v3 during benchmark This is getting important as the v3 protocol will diverge from the v2 protocol. diff -r b10c786b0145 -r 3ce370a00225 contrib/perf.py --- a/contrib/perf.py Tue Jun 06 01:43:48 2023 +0200 +++ b/contrib/perf.py Tue Jun 06 01:48:10 2023 +0200 @@ -1924,9 +1924,20 @@ return data available[b'v2'] = generate + # try to fetch a v3 generator + generatev3 = getattr(mercurial.streamclone, "generatev3", None) + if generatev3 is not None: + + def generate(repo): + entries, bytes, data = generatev3(repo, None, None, True) + return data + + available[b'v3-exp'] = generate + # resolve the request if version == b"latest": - latest_key = max(available) + # latest is the highest non experimental version + latest_key = max(v for v in available if b'-exp' not in v) return available[latest_key] elif version in available: return available[version]