changeset 49474:a7a5740b322a

perf: make perf::bundle compatible before 61ba04693d65 A small change to make it compatible with a wider set of revision.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Fri, 26 Aug 2022 00:48:54 +0200
parents f59e49f6bee4
children d513ae93dff3
files contrib/perf.py
diffstat 1 files changed, 8 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/perf.py	Thu Sep 01 16:51:26 2022 +0200
+++ b/contrib/perf.py	Fri Aug 26 00:48:54 2022 +0200
@@ -1092,9 +1092,14 @@
 
     bundle_spec = opts.get(b'type')
 
-    bundle_spec = bundlecaches.parsebundlespec(repo, bundle_spec, strict=False)
-
-    cgversion = bundle_spec.params[b"cg.version"]
+    bundle_spec = parsebundlespec(repo, bundle_spec, strict=False)
+
+    cgversion = bundle_spec.params.get(b"cg.version")
+    if cgversion is None:
+        if bundle_spec.version == b'v1':
+            cgversion = b'01'
+        if bundle_spec.version == b'v2':
+            cgversion = b'02'
     if cgversion not in changegroup.supportedoutgoingversions(repo):
         err = b"repository does not support bundle version %s"
         raise error.Abort(err % cgversion)