Summary:
See D31935606 (82bc644036) for high level explanation.
## What this diff
Remove logic on client and server to deal with `index` and `token` fields.
## Land safety
This needs to be landed after the previous diff deploys everywhere. It is safe to deploy in any order because:
- If server deploys first, it will stop sending `usize` and ìndex` fields, which will be defaulted by serde, but the client code already uses `result` token if it's not default, which it's already not as the previous diff deployed.
- If client deploys first, we stop looking at `usize` and `index` fields, but since previous diff already deployed, `result` always has a value so the behaviour is the same.
Reviewed By: StanislavGlebik
Differential Revision: D32000221
fbshipit-source-id: ded7591448c16b4e1c1264cf0409d996a8834d97
Summary: I was a little afraid there might be corner cases for the snapshot update optimisation, so I added a bunch more tests on snapshot update, to make sure it always restores the snapshot correctly, regardless of how the working directory state is.
Reviewed By: StanislavGlebik
Differential Revision: D32314413
fbshipit-source-id: 2e42a5fe2eff499fd53a06be110b69eb7c1ad59d
Summary:
This is an optimisation for snapshots. If we're restoring an snapshot, and the files are already downloaded with correct content, we don't need to delete and redownload them.
This is useful for "syncing" mechanisms that quickly create and restore snapshots, as most of the files will be the same between restores, and thus don't need redownloading.
Reviewed By: StanislavGlebik
Differential Revision: D32288548
fbshipit-source-id: 6572c3d49584d350f06c2f8e2a3ac57e7c8696c9
Summary: It's used in a few tests, and I don't see a reason to not initialize it here
Reviewed By: mitrandir77
Differential Revision: D32490222
fbshipit-source-id: 58c1a08379636b529247e1b3cde64098e536d468
Summary:
Add support for nullable value_len fields to sqlblob chunk tables and population of them from sqlblob_gc mark phase.
For put() this change adds a chunk_generation insert if the UpdateGeneration on put shows no rows affected. This is so that that chunk_generation.value_len can be relied on to be present for new rows. The insert is done after chunk and data put so as to not introduce a "chunk_generation without data key" state.
Reviewed By: farnz
Differential Revision: D32317235
fbshipit-source-id: 83de98350a59aab6905a7e6cf9f64d8f89c7682e
Summary:
The commit cloud service uses hex nodes, as it uses JSON as its usual
serialization format. However, historically these have leaked into the
Mercurial internals.
In D21554672 (b2c1d90f22) we converted the fake dag for cloud smartlog to use the `dag`
module, however since this requires binary nodes, we converted the hex
nodes to binary by encoding them (i.e. they ended up with hex-encoded nodes
stored in a bytes object).
This leads to further issues when other things are expecting real binary
nodes, but instead get binary-encoded hex nodes. For example, if these
nodes are passed to the mutation store to do look-ups.
Instead, let's use the real binary node as the keys in the fake dag.
Reviewed By: DurhamG
Differential Revision: D32361889
fbshipit-source-id: bfeab9ea25741ca76db91617d6bc6bf094adf679
Summary:
Cast EDEN_MICRO to something fmt::format can handle: char* (from std::basic_string<char8_t>); but that means this is no longer a literal, so cannot concat. Move to its own fmt argument.
This avoids the following errors:
eden/fs/service/EdenServiceHandler.cpp:227:60: error: invalid operands to binary expression ('basic_ostream<char>' and 'std::basic_string<char8_t>')
Differential Revision: D32486517
fbshipit-source-id: c799bdd73be1b46cc938b2076ebc78d0bdb3dded
Summary:
We should all be migrating to platform010, for the improved performance of its
generated code and for its improved diagnostics/portability.
reinterpret_cast another u8"..." literal to const char*
This avoids the following errors:
```
stderr: In file included from eden/fs/utils/test/Utf8Test.cpp:9:
In file included from folly/portability/GTest.h:32:
third-party-buck/platform010/build/googletest/include/gtest/gtest.h:1545:11: error: invalid operands to binary expression ('char8_t const[4]' and 'const std::basic_string<char>')
if (lhs == rhs) {
~~~ ^ ~~~
third-party-buck/platform010/build/googletest/include/gtest/gtest.h:1572:12: note: in instantiation of function template specialization 'testing::internal::CmpHelperEQ<char8_t [4], std::basic_string<char>>' requested here
return CmpHelperEQ(lhs_expression, rhs_expression, lhs, rhs);
^
eden/fs/utils/test/Utf8Test.cpp:43:3: note: in instantiation of function template specialization 'testing::internal::EqHelper::Compare<char8_t [4], std::basic_string<char>, nullptr>' requested here
EXPECT_EQ(u8"\uFFFD", ensureValidUtf8("\xff"));
```
Differential Revision: D32484896
fbshipit-source-id: b271292eb121e0e183bec56ab51fc6acb791b052
Summary:
It turns out repo.sparsematch() is called in a tight loop in some
places, like during checkout's record update phase. Let's cache it in memory.
This is a little different from the old caching mechanism because 1) it's only
ever in memory, so we don't need to worry about persisting it over time and
invalidating it when the sparse profile configs change, and 2) it only hashes
the inputs, and not the whole config file. The one input that is not part of the
cache key is the dynamic sparse profile config. Since that input has strict
invalidation points, we can just invalidate the sparse cache when the dynamic
sparse profile config invalidated.
Differential Revision: D32474918
fbshipit-source-id: 35593d06dac420e7a7fee47c5e1602413541de5f
Summary:
On Windows, directory removal notifications can be received out of order, and
sometimes duplicated. The next diff will rework the way EdenFS handle
notifications on Windows by looking at the on-disk state and applying it to the
inode hierarchy. In some cases, an entire directory hierarchy will need to be
removed which the added function will make it easier to do.
Reviewed By: chadaustin
Differential Revision: D32329806
fbshipit-source-id: ad9af389c993420184c0e59dd3d25188adddb77a
Summary: As the title says. More details can be found in the associated task.
Reviewed By: quark-zju
Differential Revision: D32346505
fbshipit-source-id: 00494165a57714dd8f8e6d3f36920a1342c121c7
Summary: A default impl that errors was added to EdenApi trait, but this impl still has a bunch of similar implementations, let's clean them.
Reviewed By: DurhamG
Differential Revision: D32314851
fbshipit-source-id: 7899c9ea23dc56bb83962d3f8625023f14b5cb4f
Summary:
This is an attempt to import `move-vm-runtime` and some other core crates of the Move programming language into fbsource.
The imported Move crates contains a few patches and are different from the official release in the following ways:
1. `diem-workspace-hack` regenerated in disabled mode
2. `diem-types` does not enable the default features for its dependency `diem-crypto`
3. `bytecode-interpreter` does not enable the default features for its dependency `bytecode-interpreter-crypto`
All of these patches are needed to help avoid enabling conflicting features at the same time.
#buildmore
Reviewed By: shazqadeer
Differential Revision: D29804394
fbshipit-source-id: 4fe3ba153437062a8744ffdf8cfe528bab817a91
Summary:
In the next diff we are going to refactor CommitSyncOutcome::NotSyncCandidate
to have a version, which would mean that the version should always be present
even for NotSyncCandidate
So in this diff let's make mapping version non-optional. Note that at the moment our
prod tables have some of the mapping entries with a non-empty version - I'm
going to fix it before landing this diff.
Reviewed By: mitrandir77
Differential Revision: D32428740
fbshipit-source-id: be9f8b104a14497bf5a524c68c0fd53beba22ee1
Summary:
Use the more efficient implementation.
This is about 100x faster. In my repo with `len(ml.roots())` being 10k+:
Before:
In [1]: %time [ml.checkout(r) for r in ml.roots()];1
CPU times: user 4.97 s, sys: 2.75 s, total: 7.72 s
Wall time: 8.72 s
After:
In [1]: %time [ml.checkout(r) for r in ml.roots()];1
CPU times: user 76.9 ms, sys: 16.5 ms, total: 93.4 ms
Wall time: 92.2 ms
Reviewed By: DurhamG
Differential Revision: D32436360
fbshipit-source-id: 6c993ea70bea5f45d0e2d1b410180f791c9fdd96
Summary: This will be used to checkout previous versions of metalog relatively cheaply.
Reviewed By: DurhamG
Differential Revision: D32436359
fbshipit-source-id: 97ca4512f63831dcc4dc109bd62f734a3e5c80c2
Summary:
This will be used to implement an efficient `checkout` without re-opening the
logs.
Reviewed By: DurhamG
Differential Revision: D32436358
fbshipit-source-id: 12edb685d88c140ffc9f76cf996ee8f3b146d4aa
Summary: Have constructor do init() instead. I can't think of any valid reason to have this API other than confusing everyone who decides to use it.
Reviewed By: praihan
Differential Revision: D32302228
fbshipit-source-id: 136e0d2919291acd60be953337309cd006bd674b