Page MenuHomePhabricator

treemanifest: allow using manifest nodes as base nodes during pack fetch
ClosedPublic

Authored by durham on Jul 13 2017, 6:52 PM.

Details

Summary

When requesting trees from the server, the client sends a list of manifest nodes
it wants and base nodes it has, then the server sends back any parts of the tree
that are in the desired manifests but not in the base nodes. If no base nodes
are sent, then the server tries to pick appropriate base nodes from the list of
manifests being requested.

Previously, when requesting manifest X, it would only try to pick X^ as the base
node (assuming X^ was in the request set). This meant that if you requested X
and X^^, it wouldn't realize they were very similar and instead it would send
the entire X and entire X^^ trees (with lots of duplication).

With this patch, it will always use the previously requested manifest as the
base node for the next manifest, if no base nodes are specified. So requests X
and X^^ will return the minimal set of nodes.

Test Plan

Added a test. It fails before and passes afterwards

Diff Detail

Repository
rFBHGX Facebook Mercurial Extensions
Branch
default
Lint
Lint OK
Unit
Unit Tests OK

Event Timeline

durham created this revision.Jul 13 2017, 6:52 PM
simpkins accepted this revision.Jul 13 2017, 6:58 PM
This revision is now accepted and ready to land.Jul 13 2017, 6:58 PM
This revision was automatically updated to reflect the committed changes.