changeset 22347:7198cb9b56b9

push: use bundle2 to push obsmarkers when possible
author Pierre-Yves David <pierre-yves.david@fb.com>
date Mon, 25 Aug 2014 19:44:27 +0200
parents a76660f85200
children 44092e6d5e13
files mercurial/exchange.py tests/test-bundle2.t
diffstat 2 files changed, 12 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/exchange.py	Mon Aug 25 19:32:51 2014 +0200
+++ b/mercurial/exchange.py	Mon Aug 25 19:44:27 2014 +0200
@@ -438,6 +438,17 @@
                 pushop.ui.warn(msg)
     return handlereply
 
+@b2partsgenerator('obsmarkers')
+def _pushb2obsmarkers(pushop, bundler):
+    if 'obsmarkers' in pushop.stepsdone:
+        return
+    remoteversions = bundle2.obsmarkersversion(bundler.capabilities)
+    if obsolete.commonversion(remoteversions) is None:
+        return
+    pushop.stepsdone.add('obsmarkers')
+    if pushop.outobsmarkers:
+        buildobsmarkerspart(bundler, pushop.outobsmarkers)
+
 @b2partsgenerator('bookmarks')
 def _pushb2bookmarks(pushop, bundler):
     """handle phase push through bundle2"""
--- a/tests/test-bundle2.t	Mon Aug 25 19:32:51 2014 +0200
+++ b/tests/test-bundle2.t	Mon Aug 25 19:44:27 2014 +0200
@@ -878,6 +878,7 @@
   remote: adding manifests
   remote: adding file changes
   remote: added 1 changesets with 0 changes to 0 files (-1 heads)
+  remote: 5 new obsolescence markers
   updating bookmark book_eea1
   exporting bookmark book_eea1
   $ hg -R other log -G