mirror of
https://github.com/facebook/sapling.git
synced 2024-10-11 17:27:53 +03:00
75db021d70
Summary: The goal is to make it easier to implement unit tests, which depend on `LiveCommitSyncConfig`. Specifically, `scs` has a piece of code, which instantiates `mononoke_api::Repo` with a test version of `CommitSyncConfig`. To migrate it to `LiveCommitSyncConfig`, I need to be able to create a test version of that. It **is** possible now, but would require me to turn a supplied instance of `CommitSyncConfig` back into `json`, which is cumbersome. Using a `dyn LiveCommitSyncConfig` there, instead of a concrete struct seems like a good idea. Note also that we are using this technique in many places: most (all?) of our DB tables are traits, which we then implement for SQL-specific structs. Finally, this diff does not actually migrate all of the current users of `LiveCommitSyncConfig` (the struct) to be users of `LiveCommitSyncConfig` (the trait), and instead makes them use `CfgrLiveCommitSyncConfig` (the trait impl). The idea is that we can migrate bits to use traits when needed (for example, in an upcoming `scs` diff). When not needed, it's fine to use concrete structs. Again, this is already the case in a a few places: we sometimes use `SqlSyncedCommitMapping` struct directly, instead of `T: SyncedCommitMapping` or `dyn SyncedCommitMapping`. Reviewed By: StanislavGlebik Differential Revision: D22383859 fbshipit-source-id: 8657fa39b11101684c1baae9f26becad6f890302 |
||
---|---|---|
.. | ||
getbundle_response | ||
mononoke_repo | ||
obsolete | ||
remotefilelog | ||
repo_read_write_status | ||
reverse_filler_queue | ||
schemas | ||
scribe_commit_queue | ||
src | ||
streaming_clone | ||
unbundle | ||
wirepack | ||
Cargo.toml |