[PATCH 5 of 6] changegroup: expose list of changesets from getchangegroupraw

Gregory Szorc gregory.szorc at gmail.com
Mon May 25 19:42:38 CDT 2015


# HG changeset patch
# User Gregory Szorc <gregory.szorc at gmail.com>
# Date 1432592438 25200
#      Mon May 25 15:20:38 2015 -0700
# Node ID eec32b6c4b3c3b45250f78918eb3cfde17be7da5
# Parent  c152c1659c8f4afa36a34437f4b7a06e41cdb77f
changegroup: expose list of changesets from getchangegroupraw

diff --git a/mercurial/changegroup.py b/mercurial/changegroup.py
--- a/mercurial/changegroup.py
+++ b/mercurial/changegroup.py
@@ -655,13 +655,16 @@ def getchangegroupraw(repo, source, head
 
     If version is None, use a version '1' changegroup.
 
     The nodes in common might not all be known locally due to the way the
-    current discovery protocol works. Returns a raw changegroup generator.
+    current discovery protocol works.
+
+    Returns a list of binary changeset nodes and an iterator over raw
+    changegroup data.
     """
     outgoing = _computeoutgoing(repo, heads, common)
     return getlocalchangegroupraw(repo, source, outgoing, bundlecaps=bundlecaps,
-                                  version=version)[1]
+                                  version=version)
 
 def getchangegroup(repo, source, heads=None, common=None, bundlecaps=None):
     """Like changegroupsubset, but returns the set difference between the
     ancestors of heads and the ancestors common.
diff --git a/mercurial/exchange.py b/mercurial/exchange.py
--- a/mercurial/exchange.py
+++ b/mercurial/exchange.py
@@ -1222,18 +1222,18 @@ def _getbundlechangegrouppart(bundler, r
         cgversions = b2caps.get('changegroup')
         if not cgversions:  # 3.1 and 3.2 ship with an empty value
             cg = changegroup.getchangegroupraw(repo, source, heads=heads,
                                                common=common,
-                                               bundlecaps=bundlecaps)
+                                               bundlecaps=bundlecaps)[1]
         else:
             cgversions = [v for v in cgversions if v in changegroup.packermap]
             if not cgversions:
                 raise ValueError(_('no common changegroup version'))
             version = max(cgversions)
             cg = changegroup.getchangegroupraw(repo, source, heads=heads,
                                                common=common,
                                                bundlecaps=bundlecaps,
-                                               version=version)
+                                               version=version)[1]
 
     if cg:
         part = bundler.newpart('changegroup', data=cg)
         if version is not None:


More information about the Mercurial-devel mailing list