# HG changeset patch # User Pierre-Yves David # Date 2014-07-02 12:09:24 # Node ID 10fcfb615fb4c7ec3b3451e9ef597effb0bce5e5 # Parent 764adc332f6e8e92e56250e9a8982ab21f4ca916 bundle2: call _pushbundle2extraparts a bit sooner This is the first step of a refactoring that will ease the inclusion of new part in the bundle2 push and includes more information (like phases) in this push We need to move the function a bit sooner to be able to group the generation of `b2x:check:heads` and `b2x:changegroup` part in an external function. We move it sooner to preserve parts creation order bundle2 tests rely on. At the ends of this refactoring the `_pushbundle2extraparts` will be replaced by another mechanism anyway. diff --git a/mercurial/exchange.py b/mercurial/exchange.py --- a/mercurial/exchange.py +++ b/mercurial/exchange.py @@ -212,10 +212,10 @@ def _pushbundle2(pushop): # create reply capability capsblob = bundle2.encodecaps(pushop.repo.bundle2caps) bundler.newpart('b2x:replycaps', data=capsblob) + extrainfo = _pushbundle2extraparts(pushop, bundler) # Send known heads to the server for race detection. if not pushop.force: bundler.newpart('B2X:CHECK:HEADS', data=iter(pushop.remoteheads)) - extrainfo = _pushbundle2extraparts(pushop, bundler) # add the changegroup bundle cg = changegroup.getlocalbundle(pushop.repo, 'push', pushop.outgoing) cgpart = bundler.newpart('B2X:CHANGEGROUP', data=cg.getchunks())