When a narrow clone is done initially the whole manifest is send. In case of
treemanifests, the manifest and the dirlogs of the paths matching the
narrowmatcher are send while clone.
So while widening, we don't need the manifests again. In case of treemanifests,
we just need the dirlogs.
This patch adds logic in cgpacker.generate() to skip adding the manifests if
they are not dirlogs and omit manifest from the required parts in call while
widening in narrow extension.
This saves a lot of time on big repos. It prevents downloading manifest which
can be in GB's on big repos and also since we don't get it, we don't try to
unpack and apply it saving more time. It saves around 3-4 minutes on our
internal repository while extending on the treemanifest repo. On flat manifest
repo, since the manifest is much much larger, I can guess this saves around ~10
mins.
I also checked the actual payload size of changegroup in bundle2 in
test-narrow-widen-no-ellipsis.t.
Before this patch
flat: 662
tree: 835
After this patch
flat: 157
tree: 333
These are the numbers from the test which has 7-8 commits and few dirs. On big
repos the improvement is *huge*.
The above all is the case when we are widening without ellipses.
@martinvonz IIUC because of this and condition in line 1041 above, we won't send the manifest for all those directories and we will be sending manifest for baz/. The filematcher here is the differencematcher so foo/ and bar/ does not match it.