Summary:
We want to migrate the tests to run using treemanifest. As part of
that, we want to first transition to using treemanifest without actually
changing the hash, so we can check that the tests still work first, then update
the hashes second.
This diff adds the flatcompat mode and enables it by default. A future diff will
start enabling treemanifest for existing tests.
Reviewed By: quark-zju
Differential Revision: D15030252
fbshipit-source-id: 06c82be749282d62f1d9cfb43246695c427f8165
Summary:
The Hyper-based EdenAPI client proved to be problematic in practice due to various difficult to debug issues with Tokio, Hyper, TLS, and h2. We have kept it around for the time being while building out the Curl based client in case we wanted to revert back to a pure Rust solution.
Today, the Curl client works well, and future work on the EdenAPI will involve adding more functionality to it. Given that both the Hyper and Curl clients implement the EdenAPI trait, modifications to the trait involve updating both clients. So far this has been acceptable because the updates have been minor, but we would now like to add substantial new functionality to the trait (namely tree fetching), and adding this functionality to the Hyper client would take nontrivial effort.
Given that we aren't using this client at all, let's just delete it. We can always bring it back from the repo's history if we need it in the future.
Reviewed By: quark-zju
Differential Revision: D15289196
fbshipit-source-id: d9c0c3cfc5087c3e080a9919dd9e627b9657676c
Summary:
For now, only pack-file based stores implement MutableHistoryStore, but once
the trait is implemented for stores that are updated in place, returning a Path
on close will not make much sense.
Reviewed By: kulshrax
Differential Revision: D15285970
fbshipit-source-id: 011db2b60c11c1eebfe11881cfc5ebafa1676704
Summary:
While it makes sense that closing a datapack returns the path, it doesn't
really mean anything for an update in place store. Let's change the API to
return an Option<PathBuf>.
Reviewed By: kulshrax
Differential Revision: D15285969
fbshipit-source-id: 804acd75607e86a0bc875910f6aaa300a5526558
Summary: The edenapi is now independant of the storage type for history data.
Reviewed By: kulshrax
Differential Revision: D15284355
fbshipit-source-id: 72a5db42bb0fb19ee03155b13914202581ab5966
Summary:
The python mutablehistorypack can implement MutableHistoryStore, so let's do
it.
Reviewed By: kulshrax
Differential Revision: D15284357
fbshipit-source-id: e55818e2432573f0fbe4f5b73c592f7f6418785c
Summary:
The type of store where data is stored is now fully abstracted to the python
bindings. For now, edenapi will write to the pending mutabledatapack, but we
can now switch it easily to any other store implementing MutableDeltaStore,
including an IndexedLogDataStore.
Reviewed By: kulshrax
Differential Revision: D15266191
fbshipit-source-id: 638cf90a567ef170e0302376312c4b82e6d6b6da
Summary:
The python mutabledatapack is a delta store, and therefore we can implement the
MutableDeltaStore trait for it.
Reviewed By: kulshrax
Differential Revision: D15266192
fbshipit-source-id: 6cc04e4a5e792d037d17c706a374f6864a2902a9
Summary: Adds tracing for mergedriver and for the individual generators.
Reviewed By: quark-zju
Differential Revision: D15223926
fbshipit-source-id: c0c6e1a6814f59fda3ddd75eee901a60a2335c1b
Summary:
Set the `component` to `"commitcloud"` for commit cloud statuses and
messages, rather than using custom highlight functions.
Reviewed By: quark-zju
Differential Revision: D15201944
fbshipit-source-id: 7635942a5ca029209711a2b89c32cc5fd677d22f
Summary:
Add optional prefix keyword arguments to `ui.write` (and thus `ui.status`,
`ui.warn`, etc.). These prefixes can be used to indicate an error condition,
some notice to the user, or to mark a message as coming from a particular
component. The prefixes are labelled so that they can be colored to stand
out from the surrounding text. The default colors are red for errors, yellow
for notices, and cyan for components.
Add a component parameter to `error.Abort` (and thus any exception that
inherits from it) that can be used by callers to mark which component is
responsible for the exception. When the error is printed, the component is
passed as the component prefix of the error message.
Reviewed By: mitrandir77
Differential Revision: D15201946
fbshipit-source-id: 02e3da40e9563704fa1d7ce81366e6e7f66c7f34
Summary:
While closing the repo, hg_memcache_client is terminated, and later, the
pending packfiles are commited. Unfortunately, the commit phase is also when
the content of the pending packfiles will be sent to memcache, and since the
connection is at this point closed, nothing is sent then.
Reviewed By: quark-zju
Differential Revision: D15247639
fbshipit-source-id: 8719cb8bbc3c9571b9cfe250ba4be2b745e4ba15
Summary:
With the mutablestores, this code was starting to be too messy and hard to
follow. Let's simplify it a bit.
Reviewed By: quark-zju
Differential Revision: D15200748
fbshipit-source-id: 2c0cc5a4ff5057f7a9590fcc602afc2b1cc72dcd
Summary:
The `finally` block relies on this name being in scope. If the exception
happens before this name is initialized, the finally block also throws and we
loose the original root cause exception.
Reviewed By: singhsrb, HarveyHunt
Differential Revision: D15244583
fbshipit-source-id: fd8be11987c3028f775a62cb3ae308b30a9d5e75
Summary:
`visibility.add` expects to be given a list of nodes. From reset
we pass a single node which makes the underlying code break it up.
Reviewed By: singhsrb
Differential Revision: D15207234
fbshipit-source-id: 9e0dd0cc8dde0eac69d20816923b39f20963237c
Summary:
I wanted this feature in multiple cases. For example, I have renamed
`segdag::SegDag` to `segment::Dag`, and want to edit commit message for
`D15055347::D15055347`, a 9-diff stack. Editing them one by one is
painful.
Reviewed By: singhsrb
Differential Revision: D15188668
fbshipit-source-id: c7cc11aca0a5e16992b5246a74346a35bec00770
Summary:
We already had tracing for tree prefetches, but in some cases the
fetching happens ondemand and goes through a different code path. Now that we
have pack file receive size tracking, let's annotate this appropriately.
Differential Revision: D15172482
fbshipit-source-id: 2db1dc8464ed9e0b8f6987718c448e391744f445
Summary: This will let us get a feel for download speeds.
Reviewed By: kulshrax
Differential Revision: D15168153
fbshipit-source-id: 86291b8eb3393d54271d574250291ed691a64a86
Summary: Records how many memcache misses we hit.
Reviewed By: kulshrax
Differential Revision: D15168154
fbshipit-source-id: 53e105999d0af566666fcfaecc5bcaf414c5e804
Summary:
Adds tracing support for recording how many bytes we download for lfs,
including the download speed.
Reviewed By: kulshrax
Differential Revision: D15167587
fbshipit-source-id: fb76bbf15cd44dcef2601d9e750794816d273120
Summary:
The prefetch code was not refreshing the pack stores after writing
stuff into packs. This meant that in some cases we would execute a prefetch,
then when we went to read an entry from the store it wouldn't be found. That
would trigger a one-by-one download, which would happen to trigger a pack store
refresh (since remotecontentstore had a refresh) which would cause the rest of
the prefetched data to then become visible.
This fixes it to make prefetch responsible for refreshing the pack data.
This also caused issues where prefetching lfs files requires the hg fetching to
get the metadata, then it reads that metadata and does an lfs fetch. Since the
original metadata wasn't visible (since the packs had not refreshed), this
resulted in infinite recursion until the default 100ms refresh time passed.
Differential Revision: D15171701
fbshipit-source-id: 190b1da542675265efaad75a2a6826cbe3c9631c
Summary:
File that tracks accessed bookmarks doesn't interact with anything else and doesn't really need repo.wlock. However if does use wlock, hg commands like `hg log -r`, which normally are read-only, start waiting for the lock and thus are blocked by other writing commands, that might be running in different checkouts of the same repo.
Let's use a different lock for this feature.
Reviewed By: simpkins
Differential Revision: D15165788
fbshipit-source-id: f04c7196d51db67069c6420545be24d2b7c0af27
Summary:
`infinitepush.sqlindex` depends on `mysql.connector`, which is only needed on
infinitepush servers using the sqlstore, and may not be otherwise available.
Delay the import of this module until we know for sure that it is needed.
Reviewed By: ikostia
Differential Revision: D15197758
fbshipit-source-id: 34f166ceab2530c875a4539089e544755f199b7b
Summary:
Do not keep all revlogs in memory. Detect memory usage and drop filelogs on
demand.
Reviewed By: ikostia
Differential Revision: D15186221
fbshipit-source-id: 8311d479e8dd4f8f449981873a98940410c20c9e
Summary:
On a memcache miss, let's put the server data into a pending packfile. This
will greatly reduce the number of packfiles being created, and thus reduce the
need to run repack.
Reviewed By: DurhamG
Differential Revision: D15154509
fbshipit-source-id: 661efd7fde4fc4f3f6441eebeaf7d3ff4c43871a
Summary:
The code to handle pending mutable packs was effectively duplicated in 3
places. The new class allows refactoring of all of it. The use of several
lambdas is unfortunate, but required as the repo and the cache path are dynamic
and can't be obtained when constructing the pendingmutablepack object.
Reviewed By: DurhamG
Differential Revision: D15023059
fbshipit-source-id: 1eae68fe66ce741eb36baa0c8db318ba32957b41
Summary:
This diff adds a new progress reporting framework to the Eden API crate and uses it to power progress bars for HTTP file downloads in Mercurial.
The new `ProgressManager` type is designed to aggregate progress values across multiple concurrent HTTP transfers. The API is currently designed to integrate well with libcurl's progress callback API, allowing all of the curl handles within a curl multi session to concurrently report their progress.
This progress can then be reported (in aggregate) to a user-provided callback. In most cases, this callback will be a Rust wrapper around a callback provided by the Python code. The `EdenAPI` trait and FFI bindings have been updated accordingly to allow optionally passing in a callback for long-running operations.
Lastly, in `remotefilelog`'s Python code, the callback is specified as a Python closure that simply updates the progress bar.
Reviewed By: quark-zju
Differential Revision: D15179983
fbshipit-source-id: ee677b71beff730f91aafe0364124f7ea0671387
Summary:
This introduces `repo.sqlreporeadonlystate()`, which works similarly to `repo.sqlisreporeadonly()`, but also gets the reason why the read only state is the way it is.
The underlying goal is to use this in a repo hook to report the lock state.
I retained the `sqlisreporeadonly` function so that we don't need to synchronize deployment of this code and the underlying hook.
Reviewed By: quark-zju
Differential Revision: D15165946
fbshipit-source-id: 0a62147167fa826b575178dd261990a956b5f317
Summary:
Move all the store creation and access code into bundlestore. Clean up the
interfaces to the index and store, removing the abstract base classes as no
code was being shared.
Reviewed By: DurhamG
Differential Revision: D15170164
fbshipit-source-id: f22ec4a266333b3100074b21cf9577c82f56e4c6
Summary:
Add support for the `unamend` command. It should use the mutation predecessors
if mutation is enabled, and update the visibility of the commits.
Reviewed By: quark-zju
Differential Revision: D15146976
fbshipit-source-id: e9ee4d26f45ba9e5c3c05a7bca80c8ac326adb9c
Summary: Per title, `hg debughttp` now prints out the hostname that the API server reports rather than the hostname in the URL we used to connect to it. The reason for this is that if the API server is behind a VIP, we get the actual hostname rather than just the VIP URL.
Differential Revision: D15170618
fbshipit-source-id: 9af5480f9987d8ea9c914baf3b62a00ad88d1b32
Summary: The packfile code already does the sort, no need to do it twice.
Reviewed By: DurhamG
Differential Revision: D15154517
fbshipit-source-id: 6ecfc65315a7e443e0c385a5a011f1b491b3f6ac
Summary:
The caller specifies whether data or history or both is needed. Let's only
download what is requested to avoid the network transfer and the disk usage.
Reviewed By: DurhamG
Differential Revision: D15151457
fbshipit-source-id: 5f8600e2ef6c45a98e05b17448fcee8d6574fa36
Summary:
We have an existing method which can capture the desired functionality
without dropping all the data in the `revision_references` table. This
primarily solves these problems:
- Reuse of code.
Reviewed By: farnz
Differential Revision: D15107057
fbshipit-source-id: 5f9970ffd13536808c1b201481b6d2015fbe8295
Summary: Added logging of a number of the currently tracked accessed remote bookmarks.
Reviewed By: mitrandir77
Differential Revision: D15080683
fbshipit-source-id: c03c417afcd24683998689365c893d9e16f265f8
Summary:
Track remote names that are used as destination for hg update.
Resolving name in the repo happens actually twice: as validation during parsing and tokenization of the given specs and actual resolving. This is still fine to update file with used bookmarks twice, because the update/pull operations are much heavy, and updating the file won't make things much slower. Implementing kind-of-cache for used remote names so we could update the file once, isn't worth it, as the feature will be temporarily enabled and won't be needed after the selective pull rollout.
Reviewed By: markbt
Differential Revision: D15048105
fbshipit-source-id: 5b03443a6ab349e3bd88613d21e7b1efdc1ff6cf
Summary: `accessed(..)` method will allow to log the fact of a name access, that is needed to track interesting remotenames.
Reviewed By: markbt
Differential Revision: D15047919
fbshipit-source-id: 29566653e742b3f24b742ffce2282baed833ea61
Summary:
Tracking remote bookmarks that was pulled with
```
hg pull -B <remote name>
```
All these remotenames, if they exist, will be stored in `.hg/selectivepullusedbookmarks` file.
It will allow us to estimate how much memory do we need to keep remote names in sync state in Commit Cloud and automatically mark collected remote bookmarks as "interesting" when the selective pull will be enabled.
Reviewed By: markbt
Differential Revision: D14912903
fbshipit-source-id: 3001869175553327c0840e2cfb829724dfd82893
Summary:
The former is no longer maintained and throws warnings with recent rust
versions.
Reviewed By: singhsrb
Differential Revision: D15109706
fbshipit-source-id: 94479cdedf42c4dd99e35fa8e337d2fc73f74eb5
Summary:
D15053374 changed this to a great regex, but lost a single piece in translation - which is the fact that both `T` and `t` are valid prefixes.
And majority of tooling (like Tasks tool) is actually using `T` prefix for tasks.
This fixes it.
Reviewed By: mitrandir77
Differential Revision: D15125683
fbshipit-source-id: 30a5f5e01bff93613a964d6a0a13ed08067f8323
Summary:
a "local changes" was visible in the smartlog even instantly after "jf submit"
because hg was comparing the has in the repo with the latest draft version.
https://fb.workplace.com/groups/scm/permalink/2115574591825483/
Reviewed By: katherinez
Differential Revision: D15098057
fbshipit-source-id: 5ad8e87a802a21ccbb1534c189d4e9de78e29fe7
Summary:
The existing bindings had a bug where if you replace a directory with a
file or symlink in a single commit, it would tell subversion to add the file
before it told it to delete the directory. This resulted in an error from
subversion and meant we couldn't actually push these commits.
Reviewed By: quark-zju
Differential Revision: D15066581
fbshipit-source-id: 1a1db0fa88cd3456fde45a4aec5d4df01837474d