[PATCH 3 of 4] changegroup: collect manifest and file nodes for shallow clone

Vishakh H vsh426 at gmail.com
Thu Aug 12 10:39:49 CDT 2010


# HG changeset patch
# User Vishakh H <vsh426 at gmail.com>
# Date 1281627411 -19800
# Node ID fcbe54b1378310b03f39d5a23f9cc6b069660f7b
# Parent  555e05986dad510e784100e5d050e6e72d8b3039
changegroup: collect manifest and file nodes for shallow clone

if the changegroup is being calculated for shallow clone then collect
changedfiles and manifests when changelog node is needed in the shallow clone.

diff --git a/mercurial/changegroup.py b/mercurial/changegroup.py
--- a/mercurial/changegroup.py
+++ b/mercurial/changegroup.py
@@ -56,10 +56,12 @@
     "HG10GZ": ("HG10GZ", lambda: zlib.compressobj()),
 }
 
-def collector(cl, mmfs, files):
+def collector(cl, mmfs, files, shallowclnodes=None):
     # Gather information about changeset nodes going out in a bundle.
     # We want to gather manifests needed and filelogs affected.
     def collect(node):
+        if shallowclnodes is not None and node not in shallowclnodes:
+            return
         c = cl.read(node)
         files.update(c[3])
         mmfs.setdefault(c[0], node)


More information about the Mercurial-devel mailing list