bundle-uri: parse bundle.heuristic=creationToken
The bundle.heuristic value communicates that the bundle list is organized to make use of the bundle.<id>.creationToken values that may be provided in the bundle list. Those values will create a total order on the bundles, allowing the Git client to download them in a specific order and even remember previously-downloaded bundles by storing the maximum creation token value. Before implementing any logic that parses or uses the bundle.<id>.creationToken values, teach Git to parse the bundle.heuristic value from a bundle list. We can use 'test-tool bundle-uri' to print the heuristic value and verify that the parsing works correctly. As an extra precaution, create the internal 'heuristics' array to be a list of (enum, string) pairs so we can iterate through the array entries carefully, regardless of the enum values. Signed-off-by: Derrick Stolee <derrickstolee@github.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
7bc73e7b61
commit
c93c3d2fa4
14
bundle-uri.h
14
bundle-uri.h
@@ -52,6 +52,14 @@ enum bundle_list_mode {
|
||||
BUNDLE_MODE_ANY
|
||||
};
|
||||
|
||||
enum bundle_list_heuristic {
|
||||
BUNDLE_HEURISTIC_NONE = 0,
|
||||
BUNDLE_HEURISTIC_CREATIONTOKEN,
|
||||
|
||||
/* Must be last. */
|
||||
BUNDLE_HEURISTIC__COUNT
|
||||
};
|
||||
|
||||
/**
|
||||
* A bundle_list contains an unordered set of remote_bundle_info structs,
|
||||
* as well as information about the bundle listing, such as version and
|
||||
@@ -75,6 +83,12 @@ struct bundle_list {
|
||||
* advertised by the bundle list at that location.
|
||||
*/
|
||||
char *baseURI;
|
||||
|
||||
/**
|
||||
* A list can have a heuristic, which helps reduce the number of
|
||||
* downloaded bundles.
|
||||
*/
|
||||
enum bundle_list_heuristic heuristic;
|
||||
};
|
||||
|
||||
void init_bundle_list(struct bundle_list *list);
|
||||
|
||||
Reference in New Issue
Block a user