# HG changeset patch # User Pierre-Yves David # Date 2014-08-25 17:44:27 # Node ID 7198cb9b56b9cc57fa4aa48815613c7e96cf32f4 # Parent a76660f85200e9008284d5d69dde14af90a53fbc push: use bundle2 to push obsmarkers when possible diff --git a/mercurial/exchange.py b/mercurial/exchange.py --- a/mercurial/exchange.py +++ b/mercurial/exchange.py @@ -438,6 +438,17 @@ def _pushb2phases(pushop, bundler): 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""" diff --git a/tests/test-bundle2.t b/tests/test-bundle2.t --- a/tests/test-bundle2.t +++ b/tests/test-bundle2.t @@ -878,6 +878,7 @@ push 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