-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
auto merge of #700 : alexcrichton/cargo/issue-697, r=brson
When a source has multiple crates inside of it, `cargo update -p foo` would previously not actually update anything because the extra crates were continuing to lock the source to the same revision. This change updates the "avoid me" logic to avoid *sources*, not *packages*. Closes #697
- Loading branch information
Showing
2 changed files
with
51 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1387,3 +1387,43 @@ following: | |
foo:0.[..].0 | ||
")); | ||
}) | ||
|
||
test!(update_one_dep_in_repo_with_many_deps { | ||
let foo = git_repo("foo", |project| { | ||
project.file("Cargo.toml", r#" | ||
[package] | ||
name = "foo" | ||
version = "0.5.0" | ||
authors = ["[email protected]"] | ||
"#) | ||
.file("src/lib.rs", "") | ||
.file("a/Cargo.toml", r#" | ||
[package] | ||
name = "a" | ||
version = "0.5.0" | ||
authors = ["[email protected]"] | ||
"#) | ||
.file("a/src/lib.rs", "") | ||
}).assert(); | ||
|
||
let p = project("project") | ||
.file("Cargo.toml", format!(r#" | ||
[project] | ||
name = "project" | ||
version = "0.5.0" | ||
authors = [] | ||
[dependencies.foo] | ||
git = '{}' | ||
[dependencies.a] | ||
git = '{}' | ||
"#, foo.url(), foo.url()).as_slice()) | ||
.file("src/main.rs", "fn main() {}"); | ||
|
||
assert_that(p.cargo_process("generate-lockfile"), execs().with_status(0)); | ||
assert_that(p.process(cargo_dir().join("cargo")).arg("update") | ||
.arg("-p").arg("foo"), | ||
execs().with_status(0) | ||
.with_stdout(format!("\ | ||
Updating git repository `{}` | ||
", foo.url()))); | ||
}) |