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

Pierre-Yves David pierre-yves.david at ens-lyon.org
Wed Jun 10 13:53:36 CDT 2015


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at 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.

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


More information about the Mercurial-devel mailing list