mirror of https://github.com/rust-lang/cargo
refactor(resolve): Pull put locking message
This commit is contained in:
parent
17a11e493c
commit
cb2bdea521
|
@ -212,9 +212,7 @@ fn print_lockfile_generation(
|
||||||
// just ourself, nothing worth reporting
|
// just ourself, nothing worth reporting
|
||||||
return Ok(());
|
return Ok(());
|
||||||
}
|
}
|
||||||
ws.gctx()
|
status_locking(ws, num_pkgs)?;
|
||||||
.shell()
|
|
||||||
.status("Locking", format!("{num_pkgs} packages"))?;
|
|
||||||
|
|
||||||
for diff in diff {
|
for diff in diff {
|
||||||
fn format_latest(version: semver::Version) -> String {
|
fn format_latest(version: semver::Version) -> String {
|
||||||
|
@ -271,10 +269,7 @@ fn print_lockfile_sync(
|
||||||
if num_pkgs == 0 {
|
if num_pkgs == 0 {
|
||||||
return Ok(());
|
return Ok(());
|
||||||
}
|
}
|
||||||
let plural = if num_pkgs == 1 { "" } else { "s" };
|
status_locking(ws, num_pkgs)?;
|
||||||
ws.gctx()
|
|
||||||
.shell()
|
|
||||||
.status("Locking", format!("{num_pkgs} package{plural}"))?;
|
|
||||||
|
|
||||||
for diff in diff {
|
for diff in diff {
|
||||||
fn format_latest(version: semver::Version) -> String {
|
fn format_latest(version: semver::Version) -> String {
|
||||||
|
@ -488,6 +483,14 @@ fn print_lockfile_updates(
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn status_locking(ws: &Workspace<'_>, num_pkgs: usize) -> CargoResult<()> {
|
||||||
|
let plural = if num_pkgs == 1 { "" } else { "s" };
|
||||||
|
ws.gctx()
|
||||||
|
.shell()
|
||||||
|
.status("Locking", format!("{num_pkgs} package{plural}"))?;
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
fn is_latest(candidate: &semver::Version, current: &semver::Version) -> bool {
|
fn is_latest(candidate: &semver::Version, current: &semver::Version) -> bool {
|
||||||
current < candidate
|
current < candidate
|
||||||
// Only match pre-release if major.minor.patch are the same
|
// Only match pre-release if major.minor.patch are the same
|
||||||
|
|
Loading…
Reference in New Issue