Skip to content

Commit bec36fc

Browse files
committed
fix(update): Remove locking message for --precise
We aren't locking to latest. We could customize the message for precise but it seemed a bit excessive.
1 parent e772fc9 commit bec36fc

File tree

7 files changed

+12
-23
lines changed

7 files changed

+12
-23
lines changed

src/cargo/ops/cargo_generate_lockfile.rs

+11-2
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,13 @@ pub fn update_lockfile(ws: &Workspace<'_>, opts: &UpdateOptions<'_>) -> CargoRes
170170
true,
171171
)?;
172172

173-
print_lockfile_updates(ws, &previous_resolve, &resolve, &mut registry)?;
173+
print_lockfile_updates(
174+
ws,
175+
&previous_resolve,
176+
&resolve,
177+
opts.precise.is_some(),
178+
&mut registry,
179+
)?;
174180
if opts.dry_run {
175181
opts.gctx
176182
.shell()
@@ -356,11 +362,14 @@ fn print_lockfile_updates(
356362
ws: &Workspace<'_>,
357363
previous_resolve: &Resolve,
358364
resolve: &Resolve,
365+
precise: bool,
359366
registry: &mut PackageRegistry<'_>,
360367
) -> CargoResult<()> {
361368
let diff = PackageDiff::diff(&previous_resolve, &resolve);
362369
let num_pkgs: usize = diff.iter().map(|d| d.added.len()).sum();
363-
status_locking(ws, num_pkgs)?;
370+
if !precise {
371+
status_locking(ws, num_pkgs)?;
372+
}
364373

365374
let mut unchanged_behind = 0;
366375
for diff in diff {

tests/testsuite/artifact_dep.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1590,6 +1590,7 @@ fn index_version_filtering() {
15901590
.with_stderr(
15911591
"\
15921592
[UPDATING] [..]
1593+
[LOCKING] 2 packages to latest compatible versions
15931594
[ADDING] artifact v1.0.0
15941595
[UPDATING] bar v1.0.0 -> v1.0.1",
15951596
)

tests/testsuite/git.rs

-1
Original file line numberDiff line numberDiff line change
@@ -799,7 +799,6 @@ Caused by:
799799
.arg(&old_head.to_string())
800800
.with_stderr(
801801
"\
802-
[LOCKING] 1 package to latest compatible version
803802
[UPDATING] bar v0.5.0 [..]",
804803
)
805804
.run();

tests/testsuite/offline.rs

-1
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,6 @@ fn main(){
702702
.with_status(0)
703703
.with_stderr(
704704
"\
705-
[LOCKING] 1 package to latest compatible version
706705
[DOWNGRADING] present_dep v1.2.9 -> v1.2.3
707706
",
708707
)

tests/testsuite/precise_pre_release.rs

-3
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ fn update_pre_release() {
6565
.masquerade_as_nightly_cargo(&["precise-pre-release"])
6666
.with_stderr(
6767
r#"[UPDATING] `dummy-registry` index
68-
[LOCKING] 1 package to latest compatible version
6968
[UPDATING] my-dependency v0.1.1 -> v0.1.2-pre.0
7069
"#,
7170
)
@@ -99,7 +98,6 @@ fn update_pre_release_differ() {
9998
.masquerade_as_nightly_cargo(&["precise-pre-release"])
10099
.with_stderr(
101100
r#"[UPDATING] `dummy-registry` index
102-
[LOCKING] 1 package to latest compatible version
103101
[DOWNGRADING] my-dependency v0.1.2 -> v0.1.2-pre.0
104102
"#,
105103
)
@@ -109,7 +107,6 @@ fn update_pre_release_differ() {
109107
.masquerade_as_nightly_cargo(&["precise-pre-release"])
110108
.with_stderr(
111109
r#"[UPDATING] `dummy-registry` index
112-
[LOCKING] 1 package to latest compatible version
113110
[UPDATING] my-dependency v0.1.2-pre.0 -> v0.1.2-pre.1
114111
"#,
115112
)

tests/testsuite/registry.rs

-2
Original file line numberDiff line numberDiff line change
@@ -996,7 +996,6 @@ fn update_lockfile() {
996996
.with_stderr(
997997
"\
998998
[UPDATING] `[..]` index
999-
[LOCKING] 1 package to latest compatible version
1000999
[UPDATING] bar v0.0.1 -> v0.0.2
10011000
",
10021001
)
@@ -3776,7 +3775,6 @@ fn differ_only_by_metadata_with_lockfile() {
37763775
.with_stderr(
37773776
"\
37783777
[UPDATING] [..] index
3779-
[LOCKING] 1 package to latest compatible version
37803778
[..] baz v0.0.1+c -> v0.0.1+b
37813779
",
37823780
)

tests/testsuite/update.rs

-14
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,6 @@ fn update_precise() {
405405
.with_stderr(
406406
"\
407407
[UPDATING] `[..]` index
408-
[LOCKING] 1 package to latest compatible version
409408
[DOWNGRADING] serde v0.2.1 -> v0.2.0
410409
[NOTE] pass `--verbose` to see 1 unchanged dependencies behind latest
411410
",
@@ -496,7 +495,6 @@ fn update_precise_build_metadata() {
496495
.with_stderr(
497496
"\
498497
[UPDATING] `[..]` index
499-
[LOCKING] 1 package to latest compatible version
500498
[UPDATING] serde v0.0.1+first -> v0.0.1+second
501499
",
502500
)
@@ -508,7 +506,6 @@ fn update_precise_build_metadata() {
508506
.with_stderr(
509507
"\
510508
[UPDATING] `[..]` index
511-
[LOCKING] 1 package to latest compatible version
512509
[UPDATING] serde v0.0.1+second -> v0.0.1+first
513510
",
514511
)
@@ -546,7 +543,6 @@ fn update_precise_do_not_force_update_deps() {
546543
.with_stderr(
547544
"\
548545
[UPDATING] `[..]` index
549-
[LOCKING] 1 package to latest compatible version
550546
[UPDATING] serde v0.2.1 -> v0.2.2
551547
[NOTE] pass `--verbose` to see 1 unchanged dependencies behind latest
552548
",
@@ -702,7 +698,6 @@ fn update_precise_first_run() {
702698
.with_stderr(
703699
"\
704700
[UPDATING] `[..]` index
705-
[LOCKING] 1 package to latest compatible version
706701
[DOWNGRADING] serde v0.2.1 -> v0.2.0
707702
",
708703
)
@@ -857,7 +852,6 @@ fn update_precise_first_run() {
857852
.with_stderr(
858853
"\
859854
[UPDATING] `[..]` index
860-
[LOCKING] 0 packages to latest compatible versions
861855
",
862856
)
863857
.run();
@@ -1024,7 +1018,6 @@ required by package `foo v0.1.0 ([ROOT]/foo)`
10241018
.with_stderr(
10251019
"\
10261020
[UPDATING] [..] index
1027-
[LOCKING] 1 package to latest compatible version
10281021
[UPDATING] bar v0.1.0+extra-stuff.0 -> v0.1.1+extra-stuff.1
10291022
",
10301023
)
@@ -1047,7 +1040,6 @@ required by package `foo v0.1.0 ([ROOT]/foo)`
10471040
.with_stderr(
10481041
"\
10491042
[UPDATING] [..] index
1050-
[LOCKING] 1 package to latest compatible version
10511043
[UPDATING] bar v0.1.1+extra-stuff.1 -> v0.1.3
10521044
",
10531045
)
@@ -1379,7 +1371,6 @@ fn update_precise_git_revisions() {
13791371
.with_stderr(format!(
13801372
"\
13811373
[UPDATING] git repository `{url}`
1382-
[LOCKING] 1 package to latest compatible version
13831374
[UPDATING] git v0.5.0 ([..]) -> #{}",
13841375
&tag_commit_id[..8],
13851376
))
@@ -1393,7 +1384,6 @@ fn update_precise_git_revisions() {
13931384
.with_stderr(format!(
13941385
"\
13951386
[UPDATING] git repository `{url}`
1396-
[LOCKING] 1 package to latest compatible version
13971387
[UPDATING] git v0.5.0 ([..]) -> #{short_id}",
13981388
))
13991389
.run();
@@ -1408,7 +1398,6 @@ fn update_precise_git_revisions() {
14081398
.with_stderr(format!(
14091399
"\
14101400
[UPDATING] git repository `{url}`
1411-
[LOCKING] 1 package to latest compatible version
14121401
[UPDATING] git v0.5.0 ([..]) -> #{}",
14131402
&tag_commit_id[..8],
14141403
))
@@ -1427,7 +1416,6 @@ fn update_precise_git_revisions() {
14271416
.with_stderr(format!(
14281417
"\
14291418
[UPDATING] git repository `{url}`
1430-
[LOCKING] 1 package to latest compatible version
14311419
[UPDATING] git v0.5.0 ([..]) -> #{}",
14321420
&head_id[..8],
14331421
))
@@ -1487,7 +1475,6 @@ Caused by:
14871475
[UPDATING] `dummy-registry` index
14881476
[WARNING] selected package `[email protected]` was yanked by the author
14891477
[NOTE] if possible, try a compatible non-yanked version
1490-
[LOCKING] 1 package to latest compatible version
14911478
[UPDATING] bar v0.1.0 -> v0.1.1
14921479
",
14931480
)
@@ -1531,7 +1518,6 @@ fn precise_yanked_multiple_presence() {
15311518
[UPDATING] `dummy-registry` index
15321519
[WARNING] selected package `[email protected]` was yanked by the author
15331520
[NOTE] if possible, try a compatible non-yanked version
1534-
[LOCKING] 1 package to latest compatible version
15351521
[UPDATING] bar v0.1.0 -> v0.1.1
15361522
",
15371523
)

0 commit comments

Comments
 (0)