mirror of
https://github.com/facebook/sapling.git
synced 2024-10-11 01:07:15 +03:00
86965b2f80
Summary: While the change looks fairly mechanical and simple, the why is a bit tricky. If we follow the calls of `ContentStore::get`, we can see that it first goes through every on-disk stores, and then switches to the remote ones, thanks to that, when we reach the remote stores there is no reason to believe that the local store attached to them contains the data we're fetching. Thus the code used to always prefetch the data, before reading from the store what was just written. While this is true for regular stores (packstore, indexedlog, etc), it starts to break down for the LFS store. The reason being that the LFS store is internally represented as 2 halves: a pointer store, and a blob store. It is entirely possible that the LFS store contains a pointer, but not the actual blob. In that case, the `get` executed on the LFS store will simply return `Ok(None)` as the blob just isn't present, which will cause us to fallback to the remote stores. Since we do have the pointer locally, we shouldn't try to refetch it from the remote store, and thus why a `get_missing` needs to be run before fetching from the remote store. As I was writing this, I realized that all of this subtle behavior is basically the same between all the stores, but unfortunately, doing a: impl<T: RemoteDataStore + ?Sized> HgIdDataStore for T Conflicts with the one for `Deref<Target=HgIdDataStore>`. Macros could be used to avoid code duplication, but for now let's not stray into them. Reviewed By: DurhamG Differential Revision: D21132667 fbshipit-source-id: 67a2544c36c2979dbac70dac5c1d055845509746 |
||
---|---|---|
.. | ||
bindings | ||
__init__.py | ||
clindex.pyi | ||
clindex.pyx | ||
linelog.pyx | ||
patchrmdir.pyi | ||
patchrmdir.pyx | ||
traceprof.pyx |