Commit Graph

13 Commits

Author SHA1 Message Date
Durham Goode
d596d1284a checkout: allow resuming an interrupted checkout
Summary:
Updates native checkout to store which files have already been written
in .hg/upgradeprogress. Then enables it to load that file and skip writing those
files if they're already on disk and their mtime and size match the previously
written values. In theory we could record and check file hashes as well, but
that'd likely slow things down quite a bit.

Future diffs will add:
- Recording and checking the hgid that was written before vs what is about to be
  written. Just an hgid comparison, not a full hash computation.
- Some UX to inform the user when hg checkout can be continued, and possibly to
  implement 'hg checkout --continue'.

Reviewed By: andll

Differential Revision: D26830249

fbshipit-source-id: 88a75080966dae5241550ed7eedbc057c65966dd
2021-04-02 12:58:35 -07:00
Gus Wynn
fc46c24e8f update tokio to 1.4.0
Summary:
https://github.com/tokio-rs/tokio/releases/tag/tokio-1.4.0
I want the `biased;` option in `tokio::select!`

Reviewed By: ahornby

Differential Revision: D27435341

fbshipit-source-id: c29ca954c319327f62466131ae04483ad091bf49
2021-03-31 10:44:20 -07:00
Thomas Orozco
f5f78c4906 third-party/rust: update tokio & tokio-stream
Summary:
Pulling this for those 2 PRs:

- https://github.com/tokio-rs/tokio/pull/3547
- https://github.com/tokio-rs/tokio/pull/3576

Reviewed By: ahornby

Differential Revision: D26944216

fbshipit-source-id: ad67afa69cb291cfb1622cf4b2a10727a13d19cd
2021-03-10 11:01:28 -08:00
Thomas Orozco
2a803fc10d third-party/rust: update futures
Summary:
Those newer versions of Futures have compatibility improvements with Tokio,
notably:

- https://github.com/rust-lang/futures-rs/pull/2333
- https://github.com/rust-lang/futures-rs/pull/2358

Reviewed By: farnz

Differential Revision: D26778794

fbshipit-source-id: 5a9dc002083e5edfa5c614d8d2242e586a93fcf6
2021-03-04 06:42:55 -08:00
Andrey Chursin
341952f4cd checkout: introduce CheckoutPlan::with_sparse_profile_change
Summary:
This method updates checkout plan to account for sparse profile change
The logic is somewhat similar to sparse.py, except it is smaller because it does not account for merges

Reviewed By: DurhamG

Differential Revision: D26670413

fbshipit-source-id: 54294ad7f1c61e39400450ff139f40ac8fffdd62
2021-03-01 20:25:17 -08:00
Lukas Piatkowski
cd0b6d50e2 autocargo v1: changes to match autocargo v2 generation results.
Summary:
The changes (and fixes) needed were:
- Ignore rules that are not rust_library or thrift_library (previously only ignore rust_bindgen_library, so that binary and test dependencies were incorrectly added to Cargo.toml)
- Thrift package name to match escaping logic of `tools/build_defs/fbcode_macros/build_defs/lib/thrift/rust.bzl`
- Rearrange some attributes, like features, authors, edition etc.
- Authors to use " instead of '
- Features to be sorted
- Sort all dependencies as one instead of grouping third party and fbcode dependencies together
- Manually format certain entries from third-party/rust/Cargo.toml, since V2 formats third party dependency entries and V1 just takes them as is.

Reviewed By: zertosh

Differential Revision: D26544150

fbshipit-source-id: 19d98985bd6c3ac901ad40cff38ee1ced547e8eb
2021-02-19 11:03:55 -08:00
Lukas Piatkowski
87ddbe2f74 autocargo v1: update autocargo field format to allow transition to autocargo v2
Summary:
Autocargo V2 will use a more structured format for autocargo field
with the help of `cargo_toml` crate it will be easy to deserialize and handle
it.

Also the "include" field is apparently obsolete as it is used for cargo-publish (see https://doc.rust-lang.org/cargo/reference/manifest.html#the-exclude-and-include-fields). From what I know this might be often wrong, especially if someone tries to publish a package from fbcode, then the private facebook folders might be shipped. Lets just not set it and in the new system one will be able to set it explicitly via autocargo parameter on a rule.

Reviewed By: ahornby

Differential Revision: D26339606

fbshipit-source-id: 510a01a4dd80b3efe58a14553b752009d516d651
2021-02-12 23:28:25 -08:00
Andrey Chursin
0b03898f89 checkout: add genereated test cases
Summary: This diff adds auto-generated test cases to checkout code. It generates partially overlapping trees and tests transitions between them

Reviewed By: quark-zju

Differential Revision: D26384962

fbshipit-source-id: 6140bbb7ff8b87843a2235f8325f57829cdd8cae
2021-02-11 19:10:25 -08:00
Andrey Chursin
38499b36e0 checkout: introduce file system tests
Summary: This diff contains basic test setup for checkout tests - we compare transition between two trees without dirty changes

Reviewed By: quark-zju

Differential Revision: D26359502

fbshipit-source-id: ef670c944200bae1652863c91ada92c6fecce4ac
2021-02-11 19:10:24 -08:00
Andrey Chursin
45e4a30651 checkout: basic CheckoutPlan::apply implementation
Summary:
Basic implementation only process file updates for now.
See todos on CheckoutPlan::apply for more detail

Reviewed By: quark-zju

Differential Revision: D26209984

fbshipit-source-id: fcfbf568359d553a51ea02ea194634048d093d0e
2021-02-02 23:14:34 -08:00
Andrey Chursin
6be082f3bd checkout: implement CheckoutPlan::from_diff
Reviewed By: quark-zju

Differential Revision: D26191428

fbshipit-source-id: d26dd58a1bd9a3bab27f38abbd15f0405c646294
2021-02-02 15:34:33 -08:00
Andrey Chursin
a0fd97854b checkout: data structure for CheckoutPlan
Reviewed By: quark-zju

Differential Revision: D26189792

fbshipit-source-id: 9afa1682055d088e5c6e4c166f73d6e0b836806a
2021-02-02 15:34:32 -08:00
Andrey Chursin
e921b0b5f0 checkout: create empty checkout crate
Reviewed By: quark-zju

Differential Revision: D26185951

fbshipit-source-id: 9b483c309f2b6ceed42b9eb1d1670bfe7b80be7b
2021-02-01 21:56:14 -08:00