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.
--- 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