##// END OF EJS Templates
changegroup: don't try to build changelog chunks if not required...
Pulkit Goyal -
r41491:fa7d61f9 default
parent child Browse files
Show More
@@ -817,9 +817,9 b' class cgpacker(object):'
817 817 self._verbosenote(_('uncompressed size of bundle content:\n'))
818 818 size = 0
819 819
820 clstate, deltas = self._generatechangelog(cl, clnodes)
820 clstate, deltas = self._generatechangelog(cl, clnodes,
821 generate=changelog)
821 822 for delta in deltas:
822 if changelog:
823 823 for chunk in _revisiondeltatochunks(delta,
824 824 self._builddeltaheader):
825 825 size += len(chunk)
@@ -917,12 +917,15 b' class cgpacker(object):'
917 917 if clnodes:
918 918 repo.hook('outgoing', node=hex(clnodes[0]), source=source)
919 919
920 def _generatechangelog(self, cl, nodes):
920 def _generatechangelog(self, cl, nodes, generate=True):
921 921 """Generate data for changelog chunks.
922 922
923 923 Returns a 2-tuple of a dict containing state and an iterable of
924 924 byte chunks. The state will not be fully populated until the
925 925 chunk stream has been fully consumed.
926
927 if generate is False, the state will be fully populated and no chunk
928 stream will be yielded
926 929 """
927 930 clrevorder = {}
928 931 manifests = {}
@@ -937,6 +940,20 b' class cgpacker(object):'
937 940 'clrevtomanifestrev': clrevtomanifestrev,
938 941 }
939 942
943 if not (generate or self._ellipses):
944 # sort the nodes in storage order
945 nodes = sorted(nodes, key=cl.rev)
946 for node in nodes:
947 c = cl.changelogrevision(node)
948 clrevorder[node] = len(clrevorder)
949 # record the first changeset introducing this manifest version
950 manifests.setdefault(c.manifest, node)
951 # Record a complete list of potentially-changed files in
952 # this manifest.
953 changedfiles.update(c.files)
954
955 return state, ()
956
940 957 # Callback for the changelog, used to collect changed files and
941 958 # manifest nodes.
942 959 # Returns the linkrev node (identity in the changelog case).
General Comments 0
You need to be logged in to leave comments. Login now