Patchwork [2,of,6] changegroup: expose list of changesets from getsubset

login
register
mail settings
Submitter Gregory Szorc
Date May 26, 2015, 12:42 a.m.
Message ID <4b918669c9657317144d.1432600955@vm-ubuntu-main.gateway.sonic.net>
Download mbox | patch
Permalink /patch/9266/
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 1432590428 25200
#      Mon May 25 14:47:08 2015 -0700
# Node ID 4b918669c9657317144dee847ddeaa8b2073b066
# Parent  ea28b7239085bbc7d561ab6aa6f86bdc19f77a25
changegroup: expose list of changesets from getsubset

Patch

diff --git a/mercurial/changegroup.py b/mercurial/changegroup.py
--- a/mercurial/changegroup.py
+++ b/mercurial/changegroup.py
@@ -571,9 +571,9 @@  def getsubsetraw(repo, outgoing, bundler
     return csets, bundler.generate(commonrevs, csets, fastpathlinkrev, source)
 
 def getsubset(repo, outgoing, bundler, source, fastpath=False, version='01'):
     csets, gengroup = getsubsetraw(repo, outgoing, bundler, source, fastpath)
-    return packermap[version][1](util.chunkbuffer(gengroup), 'UN')
+    return csets, packermap[version][1](util.chunkbuffer(gengroup), 'UN')
 
 def changegroupsubset(repo, roots, heads, source, version='01'):
     """Compute a changegroup consisting of all the nodes that are
     descendants of any of the roots and ancestors of any of the heads.
@@ -596,9 +596,9 @@  def changegroupsubset(repo, roots, heads
     for n in roots:
         discbases.extend([p for p in cl.parents(n) if p != nullid])
     outgoing = discovery.outgoing(cl, discbases, heads)
     bundler = packermap[version][0](repo)
-    return getsubset(repo, outgoing, bundler, source, version=version)
+    return getsubset(repo, outgoing, bundler, source, version=version)[1]
 
 def getlocalchangegroupraw(repo, source, outgoing, bundlecaps=None,
                            version='01'):
     """Like getbundle, but taking a discovery.outgoing as an argument.
@@ -617,9 +617,9 @@  def getlocalchangegroup(repo, source, ou
     precomputed sets in outgoing."""
     if not outgoing.missing:
         return None
     bundler = cg1packer(repo, bundlecaps)
-    return getsubset(repo, outgoing, bundler, source)
+    return getsubset(repo, outgoing, bundler, source)[1]
 
 def _computeoutgoing(repo, heads, common):
     """Computes which revs are outgoing given a set of common
     and a set of heads.
diff --git a/mercurial/exchange.py b/mercurial/exchange.py
--- a/mercurial/exchange.py
+++ b/mercurial/exchange.py
@@ -644,9 +644,9 @@  def _pushchangeset(pushop):
         cg = changegroup.getsubset(pushop.repo,
                                    outgoing,
                                    bundler,
                                    'push',
-                                   fastpath=True)
+                                   fastpath=True)[1]
     else:
         cg = changegroup.getlocalchangegroup(pushop.repo, 'push', outgoing,
                                         bundlecaps)