Patchwork [1,of,3,V2] getbundle: add data about the number of changesets bundled

login
register
mail settings
Submitter Pierre-Yves David
Date June 10, 2015, 6:53 p.m.
Message ID <cf92b2231b86fe348fcc.1433962416@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/9584/
State Accepted
Headers show

Comments

Pierre-Yves David - June 10, 2015, 6:53 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@fb.com>
# Date 1433717577 25200
#      Sun Jun 07 15:52:57 2015 -0700
# Node ID cf92b2231b86fe348fcce33d6554df7330384eef
# Parent  e26c72a5a9aa4c13b0d57621dcce265f581abdcd
getbundle: add data about the number of changesets bundled

We use an advisory parameters to carry the number of changesets bundled. This
will be used for progress output.

Patch

diff --git a/mercurial/exchange.py b/mercurial/exchange.py
--- a/mercurial/exchange.py
+++ b/mercurial/exchange.py
@@ -1301,10 +1301,11 @@  def _getbundlechangegrouppart(bundler, r
 
     if cg:
         part = bundler.newpart('changegroup', data=cg)
         if version is not None:
             part.addparam('version', version)
+        part.addparam('nbchanges', str(len(outgoing.missing)), mandatory=False)
 
 @getbundle2partsgenerator('listkeys')
 def _getbundlelistkeysparts(bundler, repo, source, bundlecaps=None,
                             b2caps=None, **kwargs):
     """add parts containing listkeys namespaces to the requested bundle"""