mirror of
https://github.com/rust-lang/cargo
synced 2024-08-27 19:29:21 +00:00
Do not call it "Downgrading" when difference is only build metadata
This commit is contained in:
parent
4d1bf29a2c
commit
985e1eeef5
|
@ -152,7 +152,15 @@ pub fn update_lockfile(ws: &Workspace<'_>, opts: &UpdateOptions<'_>) -> CargoRes
|
|||
format!("{} -> v{}", removed[0], added[0].version())
|
||||
};
|
||||
|
||||
if removed[0].version() > added[0].version() {
|
||||
// If versions differ only in build metadata, we call it an "update"
|
||||
// regardless of whether the build metadata has gone up or down.
|
||||
// This metadata is often stuff like git commit hashes, which are
|
||||
// not meaningfully ordered.
|
||||
let removed = removed[0].version();
|
||||
let added = added[0].version();
|
||||
if (removed.major, removed.minor, removed.patch, &removed.pre)
|
||||
> (added.major, added.minor, added.patch, &added.pre)
|
||||
{
|
||||
print_change("Downgrading", msg, &style::WARN)?;
|
||||
} else {
|
||||
print_change("Updating", msg, &style::GOOD)?;
|
||||
|
|
|
@ -423,11 +423,13 @@ fn update_precise_build_metadata() {
|
|||
)
|
||||
.run();
|
||||
|
||||
// This is not considered "Downgrading". Build metadata are not assumed to
|
||||
// be ordered.
|
||||
p.cargo("update serde --precise 0.0.1+first")
|
||||
.with_stderr(
|
||||
"\
|
||||
[UPDATING] `[..]` index
|
||||
[DOWNGRADING] serde v0.0.1+second -> v0.0.1+first
|
||||
[UPDATING] serde v0.0.1+second -> v0.0.1+first
|
||||
",
|
||||
)
|
||||
.run();
|
||||
|
|
Loading…
Reference in a new issue