perf: make perf::bundle compatible before 61ba04693d65
authorPierre-Yves David <pierre-yves.david@octobus.net>
Fri, 26 Aug 2022 00:48:54 +0200
changeset 49473 a7a5740b322a
parent 49472 f59e49f6bee4
child 49474 d513ae93dff3
perf: make perf::bundle compatible before 61ba04693d65 A small change to make it compatible with a wider set of revision.
contrib/perf.py
--- 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)