mercurial/changegroup.py
changeset 39672 a1942015c10e
parent 39670 9b07ee0a1054
child 39731 c71f80bfb414
--- a/mercurial/changegroup.py	Tue Sep 18 10:46:19 2018 -0700
+++ b/mercurial/changegroup.py	Mon Sep 17 21:41:34 2018 +0300
@@ -827,8 +827,11 @@
         else:
             self._verbosenote = lambda s: None
 
-    def generate(self, commonrevs, clnodes, fastpathlinkrev, source):
-        """Yield a sequence of changegroup byte chunks."""
+    def generate(self, commonrevs, clnodes, fastpathlinkrev, source,
+                 changelog=True):
+        """Yield a sequence of changegroup byte chunks.
+        If changelog is False, changelog data won't be added to changegroup
+        """
 
         repo = self._repo
         cl = repo.changelog
@@ -838,9 +841,11 @@
 
         clstate, deltas = self._generatechangelog(cl, clnodes)
         for delta in deltas:
-            for chunk in _revisiondeltatochunks(delta, self._builddeltaheader):
-                size += len(chunk)
-                yield chunk
+            if changelog:
+                for chunk in _revisiondeltatochunks(delta,
+                                                    self._builddeltaheader):
+                    size += len(chunk)
+                    yield chunk
 
         close = closechunk()
         size += len(close)