mirror of
https://github.com/facebook/sapling.git
synced 2024-10-11 17:27:53 +03:00
ee2e6fd8e2
Summary: RepoBlobstore is currently a type alias for the underlying blobstore type. This is a bit unideal for a few reasons: - It means we can't add convenience methods on it. Notably, getting access to the underlying blobstore can be helpful in tests, but as-is we cannot do that (see the test that I updated in the LFS server change in this diff for an example). - Since the various blobstores we use for wrapping are blobstores themselves, it is possible when deconstructing the repo blobstore to accidentally forget to remove one layer. By making the internal blobstore a `T`, we can let the compiler prove that deconstructing the `RepoBlobstore` is done properly. Most of the changes in this diff are slight refactorings to make this compile (e.g. removing obsolete trait bounds, etc.), but there are a couple functional changes: - I've extracted the RedactedBlobstore configuration into its own Arc. This enables us to pull it back out of a RedactedBlobstore without having to copy the actual data that's in it. - I've removed `as_inner()` and `into_inner()` from `RedactedBlobstore`. Those methods didn't really make sense. They had 2 use cases: - Deconstruct the `RedactedBlobstore` (to rebuild a new blobstore). This is better handled by `as_parts()`. - Get the underlying blobstore to make a request. This is better handled by yielding the blobstore when checking for access, which also ensures you cannot accidentally bypass redaction by using `as_inner()` (this which also allowed me to remove a clone on blobstore in the process). Reviewed By: farnz Differential Revision: D20941351 fbshipit-source-id: 9fa566702598b916cb87be6b3f064cd7e8e0b3e0 |
||
---|---|---|
.. | ||
blobstore_fetch.rs | ||
bonsai_fetch.rs | ||
bookmarks_manager.rs | ||
cmdargs.rs | ||
common.rs | ||
content_fetch.rs | ||
crossrepo.rs | ||
derived_data.rs | ||
error.rs | ||
filenodes.rs | ||
filestore.rs | ||
hash_convert.rs | ||
hg_changeset.rs | ||
hg_sync.rs | ||
main.rs | ||
phases.rs | ||
redaction.rs | ||
skiplist_subcommand.rs | ||
subcommand_blame.rs | ||
subcommand_deleted_manifest.rs | ||
subcommand_unodes.rs |