Patchwork [3,of,6] changegroup: expose list of changesets from getlocalchangegroupraw

login
register
mail settings
Submitter Gregory Szorc
Date May 26, 2015, 12:42 a.m.
Message ID <40916b298b6a21068149.1432600956@vm-ubuntu-main.gateway.sonic.net>
Download mbox | patch
Permalink /patch/9267/
State Changes Requested
Delegated to: Pierre-Yves David
Headers show

Comments

Gregory Szorc - May 26, 2015, 12:42 a.m.
# HG changeset patch
# User Gregory Szorc <gregory.szorc@gmail.com>
# Date 1432590240 25200
#      Mon May 25 14:44:00 2015 -0700
# Node ID 40916b298b6a2106814992935565f61a6d3a7e2c
# Parent  4b918669c9657317144dee847ddeaa8b2073b066
changegroup: expose list of changesets from getlocalchangegroupraw

Continuing our work to expose a list of changesets whenever we create
a changegroup, we expose the list of changesets from
getlocalchangegroupraw.

Patch

diff --git a/mercurial/changegroup.py b/mercurial/changegroup.py
--- a/mercurial/changegroup.py
+++ b/mercurial/changegroup.py
@@ -603,13 +603,16 @@  def getlocalchangegroupraw(repo, source,
                            version='01'):
     """Like getbundle, but taking a discovery.outgoing as an argument.
 
     This is only implemented for local repos and reuses potentially
-    precomputed sets in outgoing. Returns a raw changegroup generator."""
+    precomputed sets in outgoing.
+
+    Returns a list of binary changeset nodes and a raw changegroup iterator.
+    """
     if not outgoing.missing:
         return None
     bundler = packermap[version][0](repo, bundlecaps)
-    return getsubsetraw(repo, outgoing, bundler, source)[1]
+    return getsubsetraw(repo, outgoing, bundler, source)
 
 def getlocalchangegroup(repo, source, outgoing, bundlecaps=None):
     """Like getbundle, but taking a discovery.outgoing as an argument.
 
@@ -652,9 +655,9 @@  def getchangegroupraw(repo, source, head
     current discovery protocol works. Returns a raw changegroup generator.
     """
     outgoing = _computeoutgoing(repo, heads, common)
     return getlocalchangegroupraw(repo, source, outgoing, bundlecaps=bundlecaps,
-                                  version=version)
+                                  version=version)[1]
 
 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
@@ -476,17 +476,17 @@  def _pushb2ctx(pushop, bundler):
     version = None
     cgversions = b2caps.get('changegroup')
     if not cgversions:  # 3.1 and 3.2 ship with an empty value
         cg = changegroup.getlocalchangegroupraw(pushop.repo, 'push',
-                                                pushop.outgoing)
+                                                pushop.outgoing)[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.getlocalchangegroupraw(pushop.repo, 'push',
                                                 pushop.outgoing,
-                                                version=version)
+                                                version=version)[1]
     cgpart = bundler.newpart('changegroup', data=cg)
     if version is not None:
         cgpart.addparam('version', version)
     def handlereply(op):