changeset 49475:d513ae93dff3

perf: make perf::bundle compatible down to 5.2 A another small change to make it compatible with a wider set of revision. I did not check compatibility in the python-2 territory yet.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Fri, 26 Aug 2022 00:50:31 +0200
parents a7a5740b322a
children 5846bc8a2855
files contrib/perf.py
diffstat 1 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/perf.py	Fri Aug 26 00:48:54 2022 +0200
+++ b/contrib/perf.py	Fri Aug 26 00:50:31 2022 +0200
@@ -1065,7 +1065,15 @@
 
     For now, this only supports "none" compression.
     """
-    from mercurial import bundlecaches
+    try:
+        from mercurial import bundlecaches
+
+        parsebundlespec = bundlecaches.parsebundlespec
+    except ImportError:
+        from mercurial import exchange
+
+        parsebundlespec = exchange.parsebundlespec
+
     from mercurial import discovery
     from mercurial import bundle2