From 71240ba74ef8a0cb925e62e485859a4df0c87b20 Mon Sep 17 00:00:00 2001 From: UebelAndre Date: Thu, 22 Dec 2022 08:48:52 -0800 Subject: [PATCH 1/2] crate_universe re-pinning now defaults to "workspace" --- crate_universe/private/crates_repository.bzl | 4 ++-- crate_universe/private/crates_vendor.bzl | 4 ++-- crate_universe/src/metadata.rs | 8 ++++---- crate_universe/version.bzl | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/crate_universe/private/crates_repository.bzl b/crate_universe/private/crates_repository.bzl index f7144a82c7..de224c7e64 100644 --- a/crate_universe/private/crates_repository.bzl +++ b/crate_universe/private/crates_repository.bzl @@ -180,8 +180,8 @@ that is called behind the scenes to update dependencies. | Value | Cargo command | | --- | --- | -| Any of [`true`, `1`, `yes`, `on`] | `cargo update` | -| `workspace` | `cargo update --workspace` | +| Any of [`true`, `1`, `yes`, `on`, `workspace`] | `cargo update --workspace` | +| Any of [`full`, `eager`, `all`] | `cargo update` | | `package_name` | `cargo upgrade --package package_name` | | `package_name@1.2.3` | `cargo upgrade --package package_name --precise 1.2.3` | diff --git a/crate_universe/private/crates_vendor.bzl b/crate_universe/private/crates_vendor.bzl index 5a96b9bc26..80c39c16ed 100644 --- a/crate_universe/private/crates_vendor.bzl +++ b/crate_universe/private/crates_vendor.bzl @@ -329,8 +329,8 @@ call against the generated workspace. The following table describes how to contr | Value | Cargo command | | --- | --- | -| Any of [`true`, `1`, `yes`, `on`] | `cargo update` | -| `workspace` | `cargo update --workspace` | +| Any of [`true`, `1`, `yes`, `on`, `workspace`] | `cargo update --workspace` | +| Any of [`full`, `eager`, `all`] | `cargo update` | | `package_name` | `cargo upgrade --package package_name` | | `package_name@1.2.3` | `cargo upgrade --package package_name --precise 1.2.3` | diff --git a/crate_universe/src/metadata.rs b/crate_universe/src/metadata.rs index 37d496185d..5565f0c7da 100644 --- a/crate_universe/src/metadata.rs +++ b/crate_universe/src/metadata.rs @@ -100,11 +100,11 @@ impl FromStr for CargoUpdateRequest { fn from_str(s: &str) -> Result { let lower = s.to_lowercase(); - if ["1", "yes", "true", "on"].contains(&lower.as_str()) { + if ["eager", "full", "all"].contains(&lower.as_str()) { return Ok(Self::Eager); } - if ["workspace", "minimal"].contains(&lower.as_str()) { + if ["1", "yes", "true", "on", "workspace", "minimal"].contains(&lower.as_str()) { return Ok(Self::Workspace); } @@ -361,7 +361,7 @@ mod test { #[test] fn deserialize_cargo_update_request_for_eager() { - for value in ["1", "yes", "true", "on"] { + for value in ["all", "full", "eager"] { let request = CargoUpdateRequest::from_str(value).unwrap(); assert_eq!(request, CargoUpdateRequest::Eager); @@ -370,7 +370,7 @@ mod test { #[test] fn deserialize_cargo_update_request_for_workspace() { - for value in ["workspace", "minimal"] { + for value in ["1", "true", "yes", "on", "workspace", "minimal"] { let request = CargoUpdateRequest::from_str(value).unwrap(); assert_eq!(request, CargoUpdateRequest::Workspace); diff --git a/crate_universe/version.bzl b/crate_universe/version.bzl index 0a1ad0461d..15f630f8d7 100644 --- a/crate_universe/version.bzl +++ b/crate_universe/version.bzl @@ -1,3 +1,3 @@ """ Version info for the `cargo-bazel` repository """ -VERSION = "0.6.0" +VERSION = "0.7.0" From 2b085faa20f7260cc33579cae0a86b1e608b5813 Mon Sep 17 00:00:00 2001 From: UebelAndre Date: Tue, 3 Jan 2023 07:51:55 -0800 Subject: [PATCH 2/2] Regenerate documentation --- docs/crate_universe.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/crate_universe.md b/docs/crate_universe.md index 695febbfc6..736cc95b6a 100644 --- a/docs/crate_universe.md +++ b/docs/crate_universe.md @@ -263,8 +263,8 @@ that is called behind the scenes to update dependencies. | Value | Cargo command | | --- | --- | -| Any of [`true`, `1`, `yes`, `on`] | `cargo update` | -| `workspace` | `cargo update --workspace` | +| Any of [`true`, `1`, `yes`, `on`, `workspace`] | `cargo update --workspace` | +| Any of [`full`, `eager`, `all`] | `cargo update` | | `package_name` | `cargo upgrade --package package_name` | | `package_name@1.2.3` | `cargo upgrade --package package_name --precise 1.2.3` | @@ -372,8 +372,8 @@ call against the generated workspace. The following table describes how to contr | Value | Cargo command | | --- | --- | -| Any of [`true`, `1`, `yes`, `on`] | `cargo update` | -| `workspace` | `cargo update --workspace` | +| Any of [`true`, `1`, `yes`, `on`, `workspace`] | `cargo update --workspace` | +| Any of [`full`, `eager`, `all`] | `cargo update` | | `package_name` | `cargo upgrade --package package_name` | | `package_name@1.2.3` | `cargo upgrade --package package_name --precise 1.2.3` |