Commit Graph

4812 Commits

Author SHA1 Message Date
Muir Manders
716d3245bb lock: kill inheritable lock code
Summary:
This unused feature allowed a sub-process to inherit an hg repo wlock from the parent process. It was apparently intended for merge drivers, but nothing was using it.

I want to move some locking logic into rust, and this stuff was complicating things.

Note that this functionality was also removed upstream in https://phab.mercurial-scm.org/D9053.

Reviewed By: quark-zju

Differential Revision: D31184339

fbshipit-source-id: 92908220d48e2bc55e2f4fca90e647650ca5bef7
2021-09-27 14:58:42 -07:00
Liubov Dmitrieva
48cfd2e7ee EdenApiUploads: eliminate extra lookup if no stacks
Summary:
EdenApiUploads: eliminate extra lookup if no stacks

In EdenApiUploads we filter heads first and then we filter the commits belonging to these stacks.

However, in some usecases users don't use stacks. If there is no any single stack, the second lookup would be redundant and it would be nice to avoid it completely.

We can pass a flag to the upload code saying that extra filtering is not needed.

For example, in configerator repo users usually don't do stacks.

Reviewed By: markbt

Differential Revision: D31203489

fbshipit-source-id: 0921a01198bfc377afc3af3f7319fd0c5fec04d7
2021-09-27 10:27:16 -07:00
Muir Manders
8e4deea41b native status: support HGPLAIN color suppression
Summary: Plus a minor refactoring to use the io::IsTty trait in edenfs_client::status instead of calling into libc directly.

Reviewed By: quark-zju

Differential Revision: D31156633

fbshipit-source-id: 218f06a4e64836be88b4afac98dcfa140373c730
2021-09-27 09:53:24 -07:00
Arun Kulshreshtha
c1cb465dd7 configparser: turn on HTTP fetching by default
Summary: Now that EdenAPI fetching is turned on everywhere, let's make it the default.

Reviewed By: quark-zju

Differential Revision: D31184213

fbshipit-source-id: 450c1167d42ee867b505a2a14b0c636bed81107d
2021-09-25 16:33:16 -07:00
Andrey Chursin
b9fac08853 fix build warning
Summary: dyn Drop produces warning because everything is Drop

Reviewed By: quark-zju

Differential Revision: D31175376

fbshipit-source-id: 78f55a60c9bb6d51cde9433ab2815ec133b15ecc
2021-09-24 12:35:51 -07:00
Andrey Chursin
df7d45e0e4 thrift: regenerate files
Summary: Build was recently broken, this fixes it

Reviewed By: quark-zju

Differential Revision: D31175377

fbshipit-source-id: c64b79080999b01d85dded6d66919b1e64d265b5
2021-09-24 12:35:51 -07:00
Jun Wu
e97d83b447 commitcloud: use metalog root to test repo changes
Summary:
This works more reliably and fully restores `test-commitcloud-sync-race.t` to
pre-D28595292 (c72cd2333f) state.

Reviewed By: markbt

Differential Revision: D30974286

fbshipit-source-id: 729e20f23cb5d8aacdbcef1c869fc9a73ac4d4d4
2021-09-24 10:58:36 -07:00
Jun Wu
2a9fc4819a visibility: use metalog for visibleheads state
Summary:
Change the state of visibleheads from the in-memory Python `_heads` variable
to the `svfs.metalog["visibleheads"]`. This changes a few things:
- No need to manually invalidate or reload the `_heads` state on transaction
  close/reload, since metalog gets reloaded on transaction boundaries.
- No need to use features from the old transaction framework, such as
  `addfilegenerator`, keeping `journal.visibleheads` for transaction
  rollback. No need to track `dirty`.

This probably solves issues where `hg pull` hides visible heads unexpectedly.
See P458576970 for example reported by chadaustin where pull runs right after
a cloud sync and hides 5a8c51b193 unexpectedly, but metalog parent shows that
pull got the state after the cloud sync.  See also
https://fb.workplace.com/groups/scm/posts/4114332378616351/ for a similar
report from dtolnay.

In theory other states (bookmarks, remotenames) might have similar issues.
But this diff only focuses on visibleheads.

Reviewed By: markbt

Differential Revision: D30974289

fbshipit-source-id: 85d81fd2e2d85ed22ac144f2cb663eb0423955fb
2021-09-24 10:58:36 -07:00
Jun Wu
eea8f86862 run-tests: bump default timeout
Summary:
`test-cross-repo-commit-validator.t` seems to take longer to run with the next
change. Bump the timeout to make it pass.

Reviewed By: markbt

Differential Revision: D31148285

fbshipit-source-id: 2c815d988b323eb08cf06256ee666130eeebf9a6
2021-09-24 10:58:35 -07:00
Jun Wu
3c40a5c98f tests: remove test-fb-hgext-treemanifest-pushrebase
Summary:
It tests the Python pushrebase server logic which is no longer relevant.
The next change breaks it and it seems easier deleting the test.

Reviewed By: markbt

Differential Revision: D31121918

fbshipit-source-id: ee5619b35ad4aa16f0227e563ed531e879d1c8d7
2021-09-24 10:58:35 -07:00
Jun Wu
22669c67c7 visibility: avoid some self.heads reads
Summary:
Store unchanged `self.heads` in a local variable. This avoids some overhead
if `self.heads` is going to be a bit more expensive.

Reviewed By: markbt

Differential Revision: D30974287

fbshipit-source-id: baaffb8f41da4b57e4ac94c305e5ad490a3c3135
2021-09-24 10:58:35 -07:00
Jun Wu
4ed6ba36ac localrepo: make invalidateall drop more states
Summary:
This is subtle. But fbhistedit (providing `exec` support) depends on it
invaliding everything related to repo to trigger state reloading after
executing a command (which could be `hg`).

Reviewed By: markbt

Differential Revision: D30974284

fbshipit-source-id: b033d81565dcf61104e4d30ecd7d48c33d6d79a4
2021-09-24 10:58:35 -07:00
Jun Wu
10e7ff0d3e doctor: provide svfs.metalog
Summary:
In a future change we'll require `svfs.metalog`. Let's move metalog fix to
before other stuff and attach fixed metalog to `svfs`.

Reviewed By: markbt

Differential Revision: D30974285

fbshipit-source-id: 3be89d1f1cda3d29dd5746940959ee47c1dd674d
2021-09-24 10:58:35 -07:00
Jun Wu
47fe779b2b changelog: move visibleheads to a lazy property
Summary:
This allows doctor to construct changelog without requiring valid visibleheads
data. doctor cannot fix visibleheads first, because fixing visibleheads requires
changelog.

Reviewed By: markbt

Differential Revision: D30974288

fbshipit-source-id: 5bcf0f1918809fc0c7db3c89c70e0d17f961dc2c
2021-09-24 10:58:35 -07:00
Jun Wu
c3695fa2bc metalog: expose pending changes for hooks
Summary:
To make metalog replace more features supported by the transaction framework,
there is a need to expose pending metalog states to sub-processes. This diff
makes it so.

Reviewed By: markbt

Differential Revision: D30970502

fbshipit-source-id: 84192a14f4cef0765e4e361b61ab630311fd2dff
2021-09-24 10:58:35 -07:00
Liubov Dmitrieva
61dac1c517 fix make local build
Summary:
fix `make local` build

Instructions are here: D30191123 (8ed3f2f031)

Also `make clean` is important.

Reviewed By: markbt

Differential Revision: D31172134

fbshipit-source-id: cb9d51b5bab94b9574719751af2f7678f91eb0cf
2021-09-24 10:23:28 -07:00
Liubov Dmitrieva
aa85540932 optimization for edenapi uploads
Summary:
optimization for edenapi upload

Lookup for filenodes and trees can be done in parallel. Usually we have a small number of trees to check and a small number of filenodes, it is better to send them in a single lookup request, so they all can be checked in parallel. Parallelism limit for the lookup request is few thousands, so almost always if we merge the requests here, they will be parallelised.

Reviewed By: yancouto

Differential Revision: D31127401

fbshipit-source-id: 8014b27a2ba9d082babe2e0cd7bebf43c8b46082
2021-09-24 07:49:15 -07:00
Liubov Dmitrieva
b16b45f902 add scuba metrics for stages of EdenApi Uploads
Summary:
add scuba metrics for stages of EdenApi Uploads

add cloud sync reason for manual run

This is an effort to improve our Eden Api Uploads metrics and Commit Cloud metrics, so we can analyse and improve its performance.

Reviewed By: markbt

Differential Revision: D31109948

fbshipit-source-id: ee5a449e2652ea1798997ae2c52c4672f55e3eae
2021-09-24 05:33:23 -07:00
Durham Goode
47d0c4c0c9 tests: delete test-issue1502.t
Summary:
This tests legacy bookmark pull behavior which we no longer use. Let's
delete it.

Reviewed By: quark-zju

Differential Revision: D31032053

fbshipit-source-id: c1ab3b2e17a81871eae377f02947fecc438d7209
2021-09-22 18:03:30 -07:00
Durham Goode
ccb3659050 tests: delete test-init.t
Summary:
This test tests a lot of legacy repo formats and a bunch of
peer-to-peer clones/pushes, etc which are no longer supported. Let's delete it.

Reviewed By: quark-zju

Differential Revision: D31032056

fbshipit-source-id: bc3ed9226e1a2d4656630ea5f99a904673268da6
2021-09-22 18:03:30 -07:00
Durham Goode
271389d982 tests: delete test-inherit-mode.t
Summary:
This test is fragile with respect to .hg store changes. We don't have
strong requirements of .hg permissions these days since we don't share repos
between people really. So Let's delete this test.

Reviewed By: quark-zju

Differential Revision: D31032058

fbshipit-source-id: 2d6b1ffed064ad41fda8938cfabc64291f509015
2021-09-22 18:03:29 -07:00
Durham Goode
90462cdad4 tests: delete test-getbundle.t
Summary:
This tests details of the getbundle wireproto command. This is becoming
less and less relevant as we move to edenapi, and the test itself is basically
impossible to maintain since it's heavily dependent on hashes. Let's just delete
it.

Reviewed By: quark-zju

Differential Revision: D31032062

fbshipit-source-id: 31f007ab989ebcd93424f2aea09168edc368a6c0
2021-09-22 18:03:29 -07:00
Durham Goode
15311d453d tests: add infra for swapping eager repo in for newserver/clone tests
Summary:
Previously newserver/clone supported ssh and mononoke. Now let's
support eagerrepo as well

Reviewed By: quark-zju

Differential Revision: D31032061

fbshipit-source-id: 5016bb74b317523611c645c040da92c8cbf897c1
2021-09-22 18:03:29 -07:00
Durham Goode
ff5e3cd2e9 tests: remove filepeer usage from several tests (part1)
Summary:
This is part of removing filepeer. I also enabled treemanifest and
modernclient (i.e. lazy changelog) on a few tests.

Reviewed By: quark-zju

Differential Revision: D31032060

fbshipit-source-id: cb45831892a6c75d89a553c23f3318e188f9489f
2021-09-22 18:03:29 -07:00
Durham Goode
dce381b61b tests: convert test-bundle* to modernclient
Summary:
Removes the tests usage of server logic, by migrating it to
modernclient.

Reviewed By: quark-zju

Differential Revision: D31032057

fbshipit-source-id: d7f5d2cf4fae4d0edd364ad435d17e4083c3297f
2021-09-22 18:03:29 -07:00
Durham Goode
f462233b5d tests: convert test-bookmarks.t to modernclient
Summary:
Removes usage of server logic from test-bookmarks.t.

This test is long and convoluted. I decided that the latter half of the test
wasn't really relevant/important to our usage of Mercurial so I deleted it
instead of trying to fix it.

Reviewed By: quark-zju

Differential Revision: D31032059

fbshipit-source-id: ac32d8179eb1caaa6383015ec3f6f67b2fc9106e
2021-09-22 18:03:29 -07:00
Durham Goode
9cb03ed510 tests: add helpers to remove file clones/pulls
Summary:
We want to get rid of server logic in Mercurial, and to do so we want
to get rid of filepeer. To make porting legacy tests easier, let's create some
helper functions to simulate clones, pushes, and pulls.

Reviewed By: quark-zju

Differential Revision: D31004444

fbshipit-source-id: def6fc4fc3d43c313eb4f2a6b0adcba7ddb5e00f
2021-09-22 18:03:29 -07:00
Durham Goode
e9e0539cc1 filepeer: disable use of filepeer by default
Summary:
We want to remove filepeer as part of removing server logic in the
client. To start with, let's disable it by default and only enable it in tests
that need it. The next step will be to update those tests.

Reviewed By: quark-zju

Differential Revision: D30977765

fbshipit-source-id: c56016f017e894a15bf43fb7a8d3a0a417663ad9
2021-09-22 18:03:29 -07:00
Jun Wu
7d0f1c8af7 dag: add another test about vertex to id logic
Summary:
The test does not discover new issues but it seems nice to have protecting
behaviors.

Reviewed By: StanislavGlebik

Differential Revision: D31106124

fbshipit-source-id: 4060b16f2dac34ff29c0d4cee1ce19a9a61014ee
2021-09-22 11:15:22 -07:00
Jun Wu
80b650d650 dag: resolve bugs in vertex to location translation
Summary:
There are 2 issues:

- Previously it only follows parent -> child relations when parent is the head
  of a segment. It's also possible that we need to follow parent -> child when
  parent is in the middle of a flat segment. The added ASCII graph in
  `iddag.rs` shows when that happens.
- Previously there is no check about following p2 (second parent) for linear
  history. The check needs to be added and p2 of merges cannot be resolved.

This change makes `x~0` result an error. Some `x~n` are changed to alternative
ones because more child segments are visited (see also D30919581 (3ef445c0a6)).

Reviewed By: StanislavGlebik

Differential Revision: D30919579

fbshipit-source-id: eaa69d31612a2006b0b46132a797025536288624
2021-09-22 11:15:22 -07:00
Carolyn Busch
f8d6e362da fix http conditional
Summary: Fix bug in httpenabled check. Only local repo has edenapi attribute and not remote.

Reviewed By: quark-zju

Differential Revision: D31059979

fbshipit-source-id: c77f1455949f28b081f8fef86aeb83ecd1c3ceba
2021-09-22 10:22:40 -07:00
Carolyn Busch
7a9cab0157 add method for httpcommitgraph enabled
Summary: Move conditionals for using edenapi commit graph endpoint to a common method. This fixes the conditional check in _pullchangeset which should match the one in pull.

Reviewed By: quark-zju

Differential Revision: D31030783

fbshipit-source-id: e665067bcf12bc8211850d547df42bc48727de48
2021-09-22 10:22:40 -07:00
Carolyn Busch
67380e537e match commit graph url to server
Summary: The url for commit graph on the server is repo/commit/graph and repo/commit/commit_graph on the client. Update client to match server url.

Reviewed By: quark-zju

Differential Revision: D31030784

fbshipit-source-id: fb58c53a9264498f0e488abadd5f2b5480f0c672
2021-09-22 10:22:40 -07:00
Jun Wu
3ef445c0a6 dag: make iddag parent lookup support parent range
Summary: This will be used by upcoming changes.

Reviewed By: DurhamG

Differential Revision: D30919581

fbshipit-source-id: 5e4c13004c577d4a87948c1985bdf48ebd1379a3
2021-09-22 10:18:22 -07:00
Jun Wu
a4a8be5d24 dag: extract indexedlog iddag parent key logic to a function
Summary: This method will be used in the next change.

Reviewed By: DurhamG

Differential Revision: D30919580

fbshipit-source-id: a5cab7fad0dda0de15244a9d7c1887534f061f3a
2021-09-22 10:18:22 -07:00
Jun Wu
f46401df93 dag: remove unnecessary methods
Summary:
After D26360561 (aa9dfeff2e), `IdDag<Store>` derefs to `Store` for algorithms. There is no
need to duplicate the methods in `IdDag<Store>`.

Reviewed By: yancouto

Differential Revision: D30911148

fbshipit-source-id: d476e318ab565369b93f4bd8467989a2a2e76f82
2021-09-22 10:18:22 -07:00
Jun Wu
c0a47999ae dag: resolve a bug in vertex to location translation
Summary:
Added checks so the `x` in the returned `x~n` is a parent of a merge that is an
ancestor of requested heads.

Reviewed By: DurhamG

Differential Revision: D30911149

fbshipit-source-id: 09fd6a01ea346a53c8d2ff6042951c8094cb8b04
2021-09-22 10:18:22 -07:00
Liubov Dmitrieva
fd9bd36040 clean up: remove dest option everywhere
Summary:
After migration to Mononoke & EdenAPI supporting different destinations don't make sense.

The destination is always either default path or edenapi endpoint.

Reviewed By: yancouto

Differential Revision: D31081193

fbshipit-source-id: 49a02899173690cfcb55bf8fc6aec13b05377ca6
2021-09-22 09:15:43 -07:00
Jan Mazur
32c57e97bf make test-cats less flaky
Summary: It used to be flaky. Perhaps ncat exited by itself in some cases so there was nothing to kill. Just ignore the kill command's output. As long as we get the cats header the test is fine.

Reviewed By: HarveyHunt

Differential Revision: D31108514

fbshipit-source-id: e2791610c49bacdc31c26710f087cbe49f4d734e
2021-09-22 04:52:06 -07:00
Yipu Miao
5ca5ef3871 Let download_directory support eden option
Summary: Follow the D30313559, this diff will enable ```download_directory``` with eden option

Reviewed By: Skory

Differential Revision: D30549600

fbshipit-source-id: f87326bd7c17abd975eab823c62ee0ffe3bf7443
2021-09-21 18:41:16 -07:00
Meyer Jacobs
39ec42f832 backingstore: add file aux data support to BackingStore
Summary: Add support for fetching file aux data from BackingStore via scmstore.

Reviewed By: andll

Differential Revision: D31048574

fbshipit-source-id: ccb783272d0ffe32277debdaac45c00fc4df9ddb
2021-09-21 15:19:55 -07:00
Durham Goode
8eda0549d1 eol: remove eol extension
Summary:
We've never really supported this and it has caused weird behavior in
the past. Let's delete it.

Reviewed By: quark-zju

Differential Revision: D31027574

fbshipit-source-id: 297668e35db3c4d5ea17d2a18fc0127ca694cc45
2021-09-21 13:55:08 -07:00
Durham Goode
742240b65f hggit: delete hggit
Summary: This is no longer used, now that configerator does it's sync via SCS.

Reviewed By: quark-zju

Differential Revision: D31006839

fbshipit-source-id: ddf7923a3c80ad47519bce0e5cb3895f62e7ae2e
2021-09-21 13:45:11 -07:00
Mark Juggurnauth-Thomas
6ddb2d3b52 clienttelemetry: split peerinfo from server response
Summary:
The server_realhostname log field no longer contains just the server hostname,
but instead was changed to the format `HOSTNAME session SESSIONID`, so that the
client knows the server session id.

Redefine the response format to `HOSTNAME (INFOKEY INFOVALUE)*`, so that
session is just an info field from the peer, and parse the response and log its
components.

Reviewed By: quark-zju

Differential Revision: D31081922

fbshipit-source-id: 28f963b4a44f7e9bdd75393ac9b14a2d1a4b5bd0
2021-09-21 12:45:17 -07:00
Muir Manders
c73e1c5556 progress: always create rust progress model
Summary:
Create rust progress bar model in python whenever any bar is created, as opposed to only when the bar is rendered. This makes progress metadata always available in rust, regardless of whether progress ends up getting displayed or not. In particular, this enables upcoming "global progress" work to generically expose all hg invocations' progress.

This change necessitated rust to respect more cases where progress should not be displayed. For example, "quiet" mode was previously only respected in python by creating a type of bar that did not end up being registered in rust. Now since all bars are registered, rust needs to know not to render output in this case and others.

Note that I discovered a config discrepancy between python and rust in the norepo=True command mode. Work around for now by changing debugprogress to optionalrepo.

Reviewed By: quark-zju

Differential Revision: D31005075

fbshipit-source-id: 0fa6fb594a15b34b3ae260343526496f8f8b05f8
2021-09-21 11:54:19 -07:00
Muir Manders
67b6925885 configparser: add utility to test for HGPLAIN
Summary:
Add rust utility function to test for HGPLAIN and HGPLAINEXCEPT, analagous to python's ui.plain() method.

I need this so rust can expand its logic of whether to render progress bars or not.

Reviewed By: quark-zju

Differential Revision: D31070840

fbshipit-source-id: 0c394234b9c4337bbddaa08d7a9b1d8ed59dfec0
2021-09-21 11:54:18 -07:00
Jan Mazur
34562e349e send cats with mononokepeer on push
Summary: We'll pass CAT's (Crypto Auth Tokens) from clients to our hooks so we can verify clients' identities.

Reviewed By: StanislavGlebik

Differential Revision: D30666379

fbshipit-source-id: 40bdcc04e05165ff379c34f8a8b5f54c509cce00
2021-09-21 10:30:53 -07:00
Xavier Deguillard
e9de9e1fe5 backingstore: rename refresh method to flush
Summary:
The intent behind the refresh method is to both read new data from the disk,
but also to flush the in-memory write buffer to disk. The name "flush" is used
in the revisionstore code to mean the latter, thus let's use "flush" in the
rest of the codebase.

Reviewed By: kmancini

Differential Revision: D30947873

fbshipit-source-id: c85a6abe770a47d6ce454d6af1fa73e505194a22
2021-09-21 10:22:11 -07:00
Liubov Dmitrieva
d5acd57947 measure pull and push time for cloud sync
Summary:
measure pull and push time for cloud sync

This is needed to be able to analyse this data in scuba

Reviewed By: yancouto

Differential Revision: D31081328

fbshipit-source-id: 404df394443282d62845fad094153a83d71d3150
2021-09-21 08:23:21 -07:00
Mark Juggurnauth-Thomas
ed2f622d66 phabstatus: add commiting and needs final review states
Summary:
Add support for Phabricator's "committing", "recently failed to land", and
"needs final review" states.  These are fake states based on other status
fields in the response from Phabricator.

Reviewed By: quark-zju

Differential Revision: D31055125

fbshipit-source-id: 16b17e1934efcb5d829dd8d4c72ea8465687ab46
2021-09-21 01:30:04 -07:00