mercurial/bundle2.py
changeset 32516 37d70ba1d9d1
parent 32515 e70d6dbde713
child 32709 16ada4cbb1a9
--- a/mercurial/bundle2.py	Sun May 28 11:48:18 2017 -0700
+++ b/mercurial/bundle2.py	Sun May 28 11:50:43 2017 -0700
@@ -1348,7 +1348,10 @@
     elif not bundletype.startswith('HG20'):
         raise error.ProgrammingError('unknown bundle type: %s' % bundletype)
 
-    bundle = bundle20(ui)
+    caps = {}
+    if 'obsolescence' in opts:
+        caps['obsmarkers'] = ('V1',)
+    bundle = bundle20(ui, caps)
     bundle.setcompression(compression, compopts)
     _addpartsfromopts(ui, repo, bundle, source, outgoing, opts)
     chunkiter = bundle.getchunks()
@@ -1377,6 +1380,10 @@
 
     addparttagsfnodescache(repo, bundler, outgoing)
 
+    if opts.get('obsolescence', False):
+        obsmarkers = repo.obsstore.relevantmarkers(outgoing.missing)
+        buildobsmarkerspart(bundler, obsmarkers)
+
 def addparttagsfnodescache(repo, bundler, outgoing):
     # we include the tags fnode cache for the bundle changeset
     # (as an optional parts)