diff --git a/mercurial/bundlecaches.py b/mercurial/bundlecaches.py --- a/mercurial/bundlecaches.py +++ b/mercurial/bundlecaches.py @@ -192,7 +192,8 @@ def parsebundlespec(repo, spec, strict=T % spec ) - if b'-' in spec: + pre_args = spec.split(b';', 1)[0] + if b'-' in pre_args: compression, version = spec.split(b'-', 1) if compression not in util.compengines.supportedbundlenames: diff --git a/tests/test-obsolete-bundle-strip.t b/tests/test-obsolete-bundle-strip.t --- a/tests/test-obsolete-bundle-strip.t +++ b/tests/test-obsolete-bundle-strip.t @@ -1494,6 +1494,14 @@ Test bundlespec overwrite default obsmarkers -- {} (mandatory: True) version: 1 (50 bytes) 1ea73414a91b0920940797d8fc6a11e447f8ea1e 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} + + $ hg bundle -R repo-with-obs --type 'v2;obsolescence=yes;obsolescence-mandatory=no' --all --hidden bundle-type-with-obs-adv + 1 changesets found + $ hg debugbundle bundle-type-with-obs-adv --part-type obsmarkers + Stream params: {Compression: BZ} + obsmarkers -- {} (mandatory: False) + version: 1 (50 bytes) + 1ea73414a91b0920940797d8fc6a11e447f8ea1e 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} $ hg bundle -R repo-with-obs --type 'v2;obsolescence=no' --all --hidden bundle-type-without-obs 1 changesets found $ hg debugbundle bundle-type-without-obs --part-type obsmarkers