diff --git a/mercurial/exchange.py b/mercurial/exchange.py
index 6d15a8971e3036b647fad9262faf8eba9a1e383c_bWVyY3VyaWFsL2V4Y2hhbmdlLnB5..04cdb442a892179587e61ae932718bfc3c1d22e0_bWVyY3VyaWFsL2V4Y2hhbmdlLnB5 100644
--- a/mercurial/exchange.py
+++ b/mercurial/exchange.py
@@ -146,6 +146,10 @@
                 splitted = requirements.split()
                 params = bundle2._formatrequirementsparams(splitted)
                 return b'none-v2;stream=v2;%s' % params
+            elif part.type == b'obsmarkers':
+                params[b'obsolescence'] = b'yes'
+                if not part.mandatory:
+                    params[b'obsolescence-mandatory'] = b'no'
 
         if not version:
             raise error.Abort(
diff --git a/tests/test-obsolete-bundle-strip.t b/tests/test-obsolete-bundle-strip.t
index 6d15a8971e3036b647fad9262faf8eba9a1e383c_dGVzdHMvdGVzdC1vYnNvbGV0ZS1idW5kbGUtc3RyaXAudA==..04cdb442a892179587e61ae932718bfc3c1d22e0_dGVzdHMvdGVzdC1vYnNvbGV0ZS1idW5kbGUtc3RyaXAudA== 100644
--- a/tests/test-obsolete-bundle-strip.t
+++ b/tests/test-obsolete-bundle-strip.t
@@ -1489,6 +1489,8 @@
 
   $ hg bundle -R repo-with-obs --type 'v2;obsolescence=yes' --all --hidden bundle-type-with-obs
   1 changesets found
+  $ hg debugbundle --spec bundle-type-with-obs
+  bzip2-v2;obsolescence=yes
   $ hg debugbundle bundle-type-with-obs --part-type obsmarkers
   Stream params: {Compression: BZ}
   obsmarkers -- {} (mandatory: True)
@@ -1497,6 +1499,8 @@
 
   $ 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 --spec bundle-type-with-obs-adv
+  bzip2-v2;obsolescence=yes;obsolescence-mandatory=no
   $ hg debugbundle bundle-type-with-obs-adv --part-type obsmarkers
   Stream params: {Compression: BZ}
   obsmarkers -- {} (mandatory: False)
@@ -1504,6 +1508,8 @@
       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 --spec bundle-type-without-obs
+  bzip2-v2
   $ hg debugbundle bundle-type-without-obs --part-type obsmarkers
   Stream params: {Compression: BZ}
 
@@ -1512,6 +1518,8 @@
 
   $ hg bundle -R repo-with-obs --config experimental.evolution.bundle-obsmarker=false --type 'v2;obsolescence=yes' --all --hidden bundle-type-with-obs2
   1 changesets found
+  $ hg debugbundle --spec bundle-type-with-obs2
+  bzip2-v2;obsolescence=yes
   $ hg debugbundle bundle-type-with-obs2 --part-type obsmarkers
   Stream params: {Compression: BZ}
   obsmarkers -- {} (mandatory: True)
@@ -1519,5 +1527,7 @@
       1ea73414a91b0920940797d8fc6a11e447f8ea1e 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
   $ hg bundle -R repo-with-obs --config experimental.evolution.bundle-obsmarker=true --type 'v2;obsolescence=no' --all --hidden bundle-type-without-obs2
   1 changesets found
+  $ hg debugbundle --spec bundle-type-without-obs2
+  bzip2-v2
   $ hg debugbundle bundle-type-without-obs2 --part-type obsmarkers
   Stream params: {Compression: BZ}