# HG changeset patch # User Pierre-Yves David # Date 1404729031 -7200 # Node ID 7a7def851ba0e1de62df72d9437fbc60a2fe1ffc # Parent 8612c4ab7f5432473de354f5455b59ae576e4949 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. diff -r 8612c4ab7f54 -r 7a7def851ba0 mercurial/exchange.py --- 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