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

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


# HG changeset patch
# User Gregory Szorc <gregory.szorc at 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

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)
 


More information about the Mercurial-devel mailing list