Commit Graph

58160 Commits

Author SHA1 Message Date
Mark Thomas
860594a0e6 streampager: fix progress rendering
Summary:
With the internal streampager, progress bars must be sent on a separate stream so that
streampager can render them correctly.

Reviewed By: quark-zju

Differential Revision: D21906173

fbshipit-source-id: eb41b0bf22807d9cae518b3f676996ab1c642c6e
2020-06-10 19:29:28 -07:00
Mark Thomas
ce3d15ef1d upgrade streampager to 0.8
Summary: Upgrade the internal streampager to the latest version, which includes line wrapping.

Reviewed By: quark-zju

Differential Revision: D21906172

fbshipit-source-id: 1bc63723f55ac115090e7ae0a2541158863056b9
2020-06-10 19:29:27 -07:00
svcscm
9f4c294d16 Updating submodules
Summary:
GitHub commits:

3c33c3cf99
e778b84267
709df14fc2
59a44176fa

Reviewed By: yns88

fbshipit-source-id: 76e5d7dc343d1fa82b0ea14ffbddffd8dea97257
2020-06-10 19:29:27 -07:00
Jun Wu
3ab369827a test-clone: enable visibility
Summary: The test is changed because an extra file is copied during local-repo clone.

Reviewed By: markbt

Differential Revision: D21894318

fbshipit-source-id: 4417fb5473dc2cb98eda4dcc4d0484cc3b31fae2
2020-06-10 19:29:27 -07:00
Jun Wu
d6263b9529 test-absorb: enable visibility
Summary:
Revision numbers changed since strip no longer happens.
Updated revsets to use `.^` instead of revision numbers.

Reviewed By: markbt

Differential Revision: D21894309

fbshipit-source-id: 0bea56c9e8c6fd306dc225e4cb64ed69739a697a
2020-06-10 19:29:26 -07:00
Jun Wu
a2d3da5114 bundlerepo: only enable index2 for changelog revlog
Summary:
`index2` is the Rust revlog index implementation that has extra requirements,
namely, the revlog cannot be inlined. We have code to make sure changelog is
not inlined, but manifest or filelog can still be inlined.

`index2` is only needed for changelog for phase and visibility calculations.
Therefore, disable it for manifest and filelog.

Reviewed By: singhsrb

Differential Revision: D21917447

fbshipit-source-id: c45f955175c623092e6f728042dbfd3b942fe911
2020-06-10 19:29:26 -07:00
Ailin Zhang
e9e6f94b92 update eden du to display a summary and display warnings with color
Summary: This diff updated `eden du` to display a summary and display warnings and cleaning information with colors.

Reviewed By: kmancini

Differential Revision: D21885051

fbshipit-source-id: be127b81c92bea1051a80715682cdbccf22f22e3
2020-06-10 19:29:26 -07:00
Ailin Zhang
a2a754b6f0 update eden du to display an aggregated result of all mounts.
Summary: This diff updated  `eden du` to display an aggregated result of all mounts instead of showing all details for each mount, as users generally just want to reduce disk usage but don't really care about details.

Reviewed By: genevievehelsel

Differential Revision: D21877178

fbshipit-source-id: dde43e51e96a5c2569c9fe21ab06cc7ea4295866
2020-06-10 19:29:25 -07:00
Zeyi (Rice) Fan
3754c14ec3 batch imports blobs from Rust stores from EdenAPI
Summary:
NOTE: This stack works together, they are separated for easier reviewing. Check D21723465 if you want to read this stack in one place.

This diff finally connects EdenAPI with EdenFS. Previously we only had basic EdenAPI implemented but the performance was not acceptable. This is largely due to overheads in talking with the remote server. Now EdenFS is able to import multiple files at once, we efficiently use EdenAPI to import these data now.

Reviewed By: chadaustin

Differential Revision: D21576569

fbshipit-source-id: a45e832ec63d057730138551393ff7547fa2c22f
2020-06-10 19:29:25 -07:00
Zeyi (Rice) Fan
854637e854 implement batch blob import for HgNativeBackingStore
Summary:
NOTE: This stack works together, they are separated for easier reviewing. Check D21723465 if you want to read this stack in one place.

This diff encapsulates the newly added batch blob import API in backingstore crate, and expose it to EdenFS. It converts incoming complex data structures down to primitive data types that can go through FFI boundary.

Reviewed By: xavierd

Differential Revision: D21697578

fbshipit-source-id: 8f5505ef4cab342dfa710798a04df4e0e94055d9
2020-06-10 19:29:25 -07:00
Zeyi (Rice) Fan
cfa5945749 implement batch blob fetching API in backingstore crate
Summary:
NOTE: This stack works together, they are separated for easier reviewing. Check D21723465 if you want to read this stack in one place.

This diff implements getBlobBatch in `backingstore` crate that is able to process multiple blob import request at once. This will help EdenFS to process blob import request efficiently. See following diffs in the stack for usage.

To import a list of import requests, the function first check if the file exists locally. When it is already in local store, the function will call the provided `resolve` function to send the blob back. Then it proceeds to send **ONE** request to remote store (in our case, EdenAPI) for all these missing files if this import permits remote importing.

We use the callback style `resolve` parameter because we want to awake waiting threads as soon as the blob is ready, so we don't waste time on unnecessary waiting.

Reviewed By: xavierd

Differential Revision: D21697580

fbshipit-source-id: b550accf6f6163cf6f2e9be6b628e46f44076c37
2020-06-10 19:29:24 -07:00
Jun Wu
18e012bb19 setup: remove .pyc if .py is deleted
Summary: This avoids issues importing stale .pyc files.

Reviewed By: singhsrb

Differential Revision: D21847270

fbshipit-source-id: cd788e8f7bf95d026248febaae6e67db0d2beca1
2020-06-10 19:29:24 -07:00
Jun Wu
92e7b5feb2 visibility: turn on visibility by default
Summary:
It was turned on in production (facebook.rc) except for hg servers.
This mainly affects tests.

Reviewed By: markbt

Differential Revision: D21894313

fbshipit-source-id: 5f12620cfc11bb243e96fba12a07cbf0241c738b
2020-06-10 19:29:24 -07:00
Mateusz Kwapich
41b87a449b hgsql: check if paths are not too long before inserting to DB
Summary:
This is a followup from s195788 - this little check should be enough to prevent
us from having the paths in our DB being truncated on insert.

Reviewed By: markbt

Differential Revision: D21904281

fbshipit-source-id: c9306e0cca4a2e009bb50bc287190d8f7ad12be4
2020-06-10 19:29:23 -07:00
Chad Austin
11d569b04d refactor EdenClient construction
Summary:
I am planning to start migrating Eden's CLI to the new Python 3 Thrift
implementation. In preparation, slightly clean up the interface and
implementation of our Python 2 Thrift wrapper.

Reviewed By: genevievehelsel

Differential Revision: D21854539

fbshipit-source-id: d398dd3f324c12288871cf0c9db41e64ed4cf7ed
2020-06-10 19:29:23 -07:00
Jun Wu
476afcb2f6 visibility: stop logging "repo visibility is tracked through visible heads"
Summary:
Visibleheads (and even narrow-heads) are enabled by default except for hg
servers. No need to log them specially.

Reviewed By: markbt

Differential Revision: D21894308

fbshipit-source-id: 7ffe0977e51c17e743b62da0e2bfbe7618c64610
2020-06-10 19:29:22 -07:00
Jun Wu
1586c31ebb visibility: skip unknown nodes in some places
Summary: This is required to make some tests pass.

Reviewed By: markbt

Differential Revision: D21894312

fbshipit-source-id: 481bcc42f8f7fbb5c1707e66da31aee29932484c
2020-06-10 19:29:22 -07:00
Jun Wu
d6ed467b66 convert: use unfiltered repo
Summary: This avoids some issues.

Reviewed By: markbt

Differential Revision: D21894316

fbshipit-source-id: 98c75704bb3ace9fc9ac912711a8cd2d77dfeaf0
2020-06-10 19:29:22 -07:00
Jun Wu
64585a5895 hgsql: disable conflicting features explicitly
Summary:
If hgsql is enabled, disable visibility and narrow-heads explicitly to avoid
surprises.

Reviewed By: markbt

Differential Revision: D21894320

fbshipit-source-id: 335cf92dc1c62e2801e7407b706f6fc5dd59d5b4
2020-06-10 19:29:21 -07:00
Jun Wu
ae58e90f07 prune: update visibility
Summary: Make `prune` remove visible heads. This affects tests.

Reviewed By: markbt

Differential Revision: D21894322

fbshipit-source-id: 7cfa102b1be72c83a2ccdbc2d396a74ec1de2cfe
2020-06-10 19:29:21 -07:00
Jun Wu
20ea1b6543 debugobsolete: update visibility
Summary: Make `debugobsolete` also update visibility. This affects many tests.

Reviewed By: markbt

Differential Revision: D21894310

fbshipit-source-id: eba6ecb07fdd8f5a13085434b303581ec5acf463
2020-06-10 19:29:21 -07:00
Jun Wu
0fbd279db9 test-check-code: skip checking Python code in tests/
Summary: This makes tests more stable when changed.

Reviewed By: markbt

Differential Revision: D21894314

fbshipit-source-id: 73c36f79763643ccbe5dd52522fa8f22fa17a08a
2020-06-10 19:29:20 -07:00
Jun Wu
b5e2c381f0 tests: remove test-obsolete-divergent.t
Summary: We don't use obsmarker but mutation records. Therefore, remove the test.

Reviewed By: markbt

Differential Revision: D21894315

fbshipit-source-id: a1ccd8f78bea8adcba419b0d8ec99d52cd14d4e4
2020-06-10 19:29:20 -07:00
Jun Wu
6384b6aaba tests: remove test-obsolete-changeset-exchange-t.py
Summary:
We don't use obsmarker exchange but mutation record exchange.
Therefore, remove the test.

Reviewed By: markbt

Differential Revision: D21894311

fbshipit-source-id: 73d1f8031b2f601d133a98ffaa92a890bb59a656
2020-06-10 19:29:20 -07:00
Stanislau Hlebik
f6ab4bb8bd mononoke: log the name of fetched undesired file
Summary: Let's log the name as well - it will help with investigation.

Reviewed By: farnz

Differential Revision: D21906595

fbshipit-source-id: 51eb49354017c17ba3304f0a66c95dfc3c695e6a
2020-06-10 19:29:19 -07:00
Stanislau Hlebik
ceed8ea37f mononoke: add must_use to FilenodeResult
Summary: Let's make sure it's always processed

Reviewed By: krallin

Differential Revision: D21904402

fbshipit-source-id: da95273d10ecf69ad99cf6fe5e41bb6bb20e8d59
2020-06-10 19:29:19 -07:00
Lukas Piatkowski
e38fc40b9f mononoke: replace direct usages of ServiceData by dynamic singleton counters
Summary: The replacement will make lfs_server, mononoke_api, edenapi_server and walker OSS buildable.

Reviewed By: krallin

Differential Revision: D21884324

fbshipit-source-id: e6cdf8356b13056a9944ab9da18dc15977b6a2ec
2020-06-10 19:29:19 -07:00
Kostia Balytskyi
4cdc8a994c thrift: sync commitsync.thrift
Summary:
This adds changes, introduced by me in D21841293.

For my stuff: I will only land this once the configerator diff is reviewed.

Reviewed By: farnz

Differential Revision: D21862276

fbshipit-source-id: d4f5ccdd4ef9d62bb1e394d4db36930413633fa6
2020-06-10 19:29:18 -07:00
svcscm
ab45629a95 Updating submodules
Summary:
GitHub commits:

35ff8b2660

Reviewed By: yns88

fbshipit-source-id: 5b860b40e8e6274ca5cd704b674f9d1c83f66b6c
2020-06-10 19:29:18 -07:00
Xavier Deguillard
16bbe5baa2 win: only inherit the pipe handles
Summary:
The CreateProcess API allows inheritable handles to be available in the spawned
process by passing a flag to it. What the documentation for this API leave to
the imagination is what happens when processes are spawned concurrently in
multiple threads and handles are opened and made inheritable while doing this.
The answer is obvious but the consequences aren't: they are inherited.

When anonymous Pipes are used, one end needs to be inheritable for the spawned
process to being able use it, but if one is created concurrently with spawning
a process, that other process may have an open handle to that unrelated pipe.
And since to detect that a pipe is closed, all handles to the other end needs
to be closed, this can lead to never being able to detect that it is closed...

This scenario is exactly what is happening in eden when spawning the Mercurial
process, and when one of these processes would die, eden would just hang trying
to write to the pipe, not knowing that the process was already gone. To unblock
eden, all the hg.real processes had to be killed, as this would close all the
pipe handles, and then eden would detect that the pipe was closed and re-spawn
Mercurial (only for the exact same thing to happen).

In order to fix this, we need to tell CreateProcess to only inherit the pipes
handles, and nothing else.

Reviewed By: wez

Differential Revision: D21895537

fbshipit-source-id: 3c84a1d0316b50b5750f554fa20f72f59a718882
2020-06-10 19:29:18 -07:00
svcscm
1269504e22 Updating submodules
Summary:
GitHub commits:

13b17f8c84
e7e25f3f57

Reviewed By: yns88

fbshipit-source-id: 82f07237d9ce6db323550ac21ab0bfd05f14f0e5
2020-06-10 19:29:17 -07:00
Chad Austin
e2d26877d6 enable py3 thrift language
Summary:
The old `py` Thrift language support doesn't correctly handle string
vs. bytes, which causes an exception to be thrown when deserializing
paths or blobs that aren't UTF-8.

We will eventually want to migrate to the py3 language implementation,
which supports streaming.

Reviewed By: genevievehelsel

Differential Revision: D21693082

fbshipit-source-id: 0ea10fd3960f5acba353bccb83b5cf539e7eeffb
2020-06-10 19:29:17 -07:00
Chad Austin
a96f374228 fix EDEN_TEST_NO_CLEANUP and add EDEN_TEST_NO_CLEANUP_ON_FAILURE
Summary:
It looks like a refactoring broke the EDEN_TEST_NO_CLEANUP feature
which was useful when trying to debug the eden state directory after a
failure.

While fixing it, I went ahead and added support for only saving the
state directory upon test failure.

Reviewed By: simpkins

Differential Revision: D21780122

fbshipit-source-id: 0cd6e9f274601eebd9b4a6978c0cf61fb1b85545
2020-06-10 19:29:17 -07:00
Stanislau Hlebik
4c15790b84 mononoke: return FilenodeResult from get_all_filenodes_maybe_stale
Summary:
Let's return FilenodeResult from get_all_filenodes_maybe_stale and change
callers to deal with that.

The change is straightforward with the exception of `file_history.rs`.
get_all_filenodes_maybe_stale() is used here to prefetch a lot filenodes in one
go. This diff changes it to return an empty vec in case filenodes are disabled.
Unfortunately this is not a great solution - since prefetched files are empty
get_file_history_using_prefetched() falls back to fetching filenodes
sequentially from the blobstore. that might be too slow, and the next diffs in
the stack will address this problem.

Reviewed By: krallin

Differential Revision: D21881082

fbshipit-source-id: a86dfd48a92182381ab56994f6b0f4b14651ea14
2020-06-10 19:29:16 -07:00
svcscm
e7b1e8a898 Updating submodules
Summary:
GitHub commits:

e4ebb8c078
4479aa0c95
42813c945a
743bf9072d
6818ca11aa
31bd2d790e

Reviewed By: yns88

fbshipit-source-id: 978572ad36b77f0aea8623d816fda90e358ff679
2020-06-10 19:29:16 -07:00
Xavier Deguillard
93ad242d60 packaging: use scheduled tasks
Summary:
In order to start EdenFS automatically at boot, a template service was used
previously, but due to several issues, we decided to move away from it.
Thankfully microsoft supports several other ways of starting tasks at startup,
one of which is the "Task Scheduler" itself.

One of the weird part of the task scheduler is that there isn't a good way
to tell it to not show a console for a non-graphical application, and thus
plainly executing edenfsctl start in it would create a cmd window, which
would then disappear a couple of seconds later. To avoid this, a "graphical"
version of Python is used (pythonw.exe) to start edenfsctl.

Reviewed By: fanzeyi

Differential Revision: D21732281

fbshipit-source-id: 87ef3a2d5569302392bd30a4b9e7fc48807ee316
2020-06-10 19:29:15 -07:00
Durham Goode
823a1ca4a1 configs: prevent infinite loops in dynamicconfig generation
Summary:
There's an issue where hg foo could spawn hg dynamicconfig which could
spawn hg version (via the telemetry wrapper) which could spawn hg dynamicconfig.
If the config generation fails then this could enter an infiniteloop, since the
mtime of the file would not be updated appropriately, so we will always think we
need to regenerate.

Let's prevent this by setting an environment variable when spawning the
background process.

Reviewed By: quark-zju

Differential Revision: D21885363

fbshipit-source-id: ba4938c926d1219985813a521fec412097df4b4a
2020-06-10 19:29:15 -07:00
David Tolnay
cf412e0d6b rustfmt: Use use_try_shorthand default
Summary:
I observed that for whatever reason our setting of `use_try_shorthand = true` in rustfmt.toml was causing entire functions to not get processed by rustfmt. Even files that contain neither `try` nor `?`. Remove it and reformat fbsource.

Documentation of that config:

- https://github.com/rust-lang/rustfmt/blob/master/Configurations.md#use_try_shorthand

We don't particularly care about the value anymore because nobody writes `r#try!(...)` in 2018 edition code.

Minimized:

```
fn f() {
    g(
        )
        // ...
        .h
}
```

This function gets formatted only if use_try_shorthand is not set.

The bug is fixed in the rustfmt 2.0 release candidate.

Reviewed By: jsgf

Differential Revision: D21878162

fbshipit-source-id: b028673c0eb703984d24bf0d2983453fc2a8c212
2020-06-10 19:29:15 -07:00
Mark Thomas
e988481250 config: sync from configerator
Reviewed By: HarveyHunt

Differential Revision: D21883625

fbshipit-source-id: 88fdaf3937bed68971a93308da01dedc413d180b
2020-06-10 19:29:14 -07:00
Katie Mancini
137b6d984f add OS release version to eden rage
Summary:
When I was debugging the multithreaded bug issue it came up that the issue would
only affect certain versions of macos. There may be other bugs that come up
affecting only certain os versions. Having the os version in eden rage could be
helpful to identify such issues.

Reviewed By: chadaustin

Differential Revision: D21776154

fbshipit-source-id: a493e7da1823075ca4a845bd73b21716ce884911
2020-06-10 19:29:14 -07:00
Mateusz Kwapich
11fbd214e5 add common-base subcommand to scsc
Summary: This will allow me to test it easily.

Reviewed By: StanislavGlebik

Differential Revision: D21840079

fbshipit-source-id: 1b3743da9c7908eb0dedd665aa24a4bf7aabd94f
2020-06-10 19:29:14 -07:00
Mateusz Kwapich
b73e82fe60 add commit_common_base_with method
Summary: This method is meant to replace SCMQuery's `mege_base` method.

Reviewed By: StanislavGlebik

Differential Revision: D21840080

fbshipit-source-id: 71336a4f378afc75a5643130cd58ebda88c3cb91
2020-06-10 19:29:13 -07:00
Mateusz Kwapich
9085d631e6 add common_base method
Summary: We need to thread it through this layer to get it to SCS

Reviewed By: StanislavGlebik

Differential Revision: D21840078

fbshipit-source-id: d3c16a4afd87aa844628dd0aab7f85b8d38dadf8
2020-06-10 19:29:13 -07:00
Mateusz Kwapich
0182412c37 add an LCA operatation
Summary:
We need a lowest common ancestor operation for `merge_base` call
implementation.

The `lca` function returns only one of many possible ancestors in some
situation (multiple merges of the same branches). This is done to:
simplify the implementation and hide the complexity from our API users
(people don't really expect to receive more than one node from such APIs).
Mercurial arbitrarily chooses the commit with smallest hash in those situations.

Reviewed By: StanislavGlebik

Differential Revision: D21840081

fbshipit-source-id: 2dfc95a4cf549d8941fc5166e878bfee4b6b2ece
2020-06-10 19:29:13 -07:00
Lukas Piatkowski
ad896878b5 mononoke: add Cargo.toml files for code previously depending on identity_ext
Reviewed By: farnz

Differential Revision: D21864833

fbshipit-source-id: 782175af73f5937534566c99e6dc1e7fcf319f6c
2020-06-10 18:16:04 -07:00
Lukas Piatkowski
f3753fd0bd permission_checker: add methods to parse MononokeIdentity from json and x509
Summary: This methods will replace the fbcode_build provided functions. Also add Cargo files for crates that are now thanks to that buildable in OSS.

Reviewed By: farnz

Differential Revision: D21549860

fbshipit-source-id: 69f4179aa7a9081d33fac1f2f88aa3b32cd31e17/
2020-06-10 18:16:04 -07:00
Stanislau Hlebik
15341a5da2 mononoke add test for get_file_history
Summary: I will modify in the next diffs, it's nice to have some test coverage

Reviewed By: krallin

Differential Revision: D21880996

fbshipit-source-id: 266622982e5d7d6d19ab3ac921ddc51079e51457
2020-06-04 06:42:11 -07:00
Stanislau Hlebik
964832f97e mononoke: rename max_depth to max_legth parameter in get_file_history_using_prefetched
Summary:
The max_depth parameter was confusing - one might have thought that it returns
all entries that are `max_depth` hops away from `startnode`. This is not the
case - in reality it just limits what's the total number of entries can be
returned.
In fact, I think it can be replaced with Stream::take() method, however that's
a larger refactoring, and I'm not going to do it now.

It doesn't matter much because usually we have linear histories, but I think
it's still worth to make it clearer.

Reviewed By: krallin

Differential Revision: D21880220

fbshipit-source-id: d209e1e129383f9181ae11b489992dc4c3ce2d5c
2020-06-04 03:16:22 -07:00
Kostia Balytskyi
6100864f43 thrift: sync changes to repos.thrift from configerator
Summary: This adds changes, introduced by markbt in D21766109.

Reviewed By: markbt

Differential Revision: D21844915

fbshipit-source-id: e8816634b0edb9c5191467e2d105956ddce59538
2020-06-04 01:38:01 -07:00
Thomas Orozco
cb48ff2092 mononoke/revset: buffer loading generations
Summary:
In the hg sync job, we need to load up the ancestors for all bookmarks known to
the server we are pushhing to, and for e.g. fbsource that might be > 10K
bookmarks. If we fetch those 1 by 1 (because e.g. cold cache), that will take a
very long time.

Unfortunately, we don't currently have a way of buffering access to changesets,
so for now let's mitigate by buffering.

Reviewed By: ikostia, HarveyHunt

Differential Revision: D21860228

fbshipit-source-id: 90977a9e00689c1df5ae53d149c267de9b2f973e
2020-06-04 01:24:08 -07:00