Skip to content
Snippets Groups Projects
Commit 0ef0aec56090 authored by Augie Fackler's avatar Augie Fackler
Browse files

changegroup: move manifest packing into a separate function

A future change will introduce a new function on a cg3packer that can
pack treemanifests as well as flatmanifests.
parent 730f328624ab
No related branches found
No related tags found
No related merge requests found
......@@ -591,6 +591,16 @@
rr, rl = revlog.rev, revlog.linkrev
return [n for n in missing if rl(rr(n)) not in commonrevs]
def _packmanifests(self, mfnodes, lookuplinknode):
"""Pack flat manifests into a changegroup stream."""
ml = self._repo.manifest
size = 0
for chunk in self.group(
mfnodes, ml, lookuplinknode, units=_('manifests')):
size += len(chunk)
yield chunk
self._verbosenote(_('%8.i (manifests)\n') % size)
def generate(self, commonrevs, clnodes, fastpathlinkrev, source):
'''yield a sequence of changegroup chunks (strings)'''
repo = self._repo
......@@ -654,12 +664,8 @@
return clnode
mfnodes = self.prune(ml, mfs, commonrevs)
size = 0
for chunk in self.group(
mfnodes, ml, lookupmflinknode, units=_('manifests')):
size += len(chunk)
yield chunk
self._verbosenote(_('%8.i (manifests)\n') % size)
for x in self._packmanifests(mfnodes, lookupmflinknode):
yield x
mfs.clear()
clrevs = set(cl.rev(x) for x in clnodes)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment