mirror of
https://github.com/facebook/sapling.git
synced 2024-10-11 09:17:30 +03:00
3fdda29376
Summary: Adding support to the Mononoke API server for naive is_ancestor queries using a BFS. The API server now supports queries as: Request URL: "{repo}/is_ancestor/{proposed_ancestor}/{proposed_descendent}" where the arguments in the URL are: - repo: the name of the repo to query reachability in - proposed_ancestor: a 20 byte hex encoded string representing a node hash - proposed_descendent: a 20 byte hex encoded string representing a node hash Response: One of: - the string, "true", if 'proposed_ancestor' is an ancestor of 'proposed_descendent' in 'repo'. - the string, "false", if the above condition isn't satisfied. - an error if the query couldn't be performed This involved adding: - new enum values for the MononokeRepoQuery and MononokeRepoResponse structs for 'IsAncestor' queries and responses. - a dependency on the 'mononoke/reachabilityindex' crate. - a 'is_ancestor' function to the MononokeRepoActor struct, which delegates queries to a GenerationNumberBFS index. - appropriate url handling to the server object in main - New enums to the API server ErrorKind, and appropriate down casting from the ReachabilityIndex ErrorKind. - Integration tests which made the test repo in test-apiserver.t have a few branches, and queries the API server for reachability of pairs of commits. Reviewed By: fanzeyi Differential Revision: D8844221 fbshipit-source-id: 1ba102fede378688243827850ff67aabc587a748 |
||
---|---|---|
.. | ||
src | ||
Cargo.toml |