Mercurial > hg
changeset 21902:7a7def851ba0
push: use `stepsdone` to control changegroup push through bundle10 or bundle20
We use the newly introduced `pushop.stepsdone` attribute to inform
older methods than changegroup have already been pushed using a newer
method.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Mon, 07 Jul 2014 12:30:31 +0200 |
parents | 8612c4ab7f54 |
children | 48f61cfb7576 |
files | mercurial/exchange.py |
diffstat | 1 files changed, 7 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/exchange.py Wed Jul 02 12:48:54 2014 +0200 +++ b/mercurial/exchange.py Mon Jul 07 12:30:31 2014 +0200 @@ -139,8 +139,7 @@ False) and pushop.remote.capable('bundle2-exp')): _pushbundle2(pushop) - else: - _pushchangeset(pushop) + _pushchangeset(pushop) _pushcomputecommonheads(pushop) _pushsyncphase(pushop) _pushobsolete(pushop) @@ -211,6 +210,9 @@ addchangegroup result is stored in the ``pushop.ret`` attribute. """ + if 'changesets' in pushop.stepsdone: + return + pushop.stepsdone.add('changesets') # Send known heads to the server for race detection. if not pushop.force: bundler.newpart('B2X:CHECK:HEADS', data=iter(pushop.remoteheads)) @@ -263,6 +265,9 @@ def _pushchangeset(pushop): """Make the actual push of changeset bundle to remote repo""" + if 'changesets' in pushop.stepsdone: + return + pushop.stepsdone.add('changesets') outgoing = pushop.outgoing unbundle = pushop.remote.capable('unbundle') # TODO: get bundlecaps from remote