Move existing_vcs_repo to the util::vcs module
Rather than being in cargo_new publically exposed and used by cargo fix.
Just a proposal, as it looked weird to me.
now that we respect gitignore tests can be simplified
There are a lot of test that used a tempfile to avoid the fact that cargo would not init a git in the test folder. (or because they were copy/pasted from one that did.) Now that #5733 landed we can remove them all.
Fix `test --doc` with incompatible lib types.
When I recently changed the doctest handling, I forgot to check the lib type in
the `test --doc` scenario.
I also added the package name to a nearby error message, since it can be
confusing in a workspace setting.
Fix HgRepo::discover
Replace the duplicate .cwd call with an invocation taken from
https://stackoverflow.com/a/3138925/463761
Match the semantics of the other vcs calls, which is invoke from 'cwd'
targeting 'path'. Looks a little confusing because hg takes a '--cwd'
argument.
Respect .gitignore during `cargo new`
When running `cargo new`, we check to see if you are inside a git repository. If you are, we do not initialize a new git repo for your project unless you specifically asked for it using --vcs. (See #1210 for more background).
This commit changes that behavior to *also* create a new repo if the project would be an ignored path in the parent repository. This way, if your home directory is a git repository, as long as you have ignored the directory you are creating a new project in, we will instantiate a git repository without you having to specifically request it.
When running `cargo new`, we check to see if you are inside a git
repository. If you are, we do not initialize a new git repo for
your project unless you specifically asked for it using --vcs.
(See #1210 for more background).
This commit changes that behavior to *also* create a new repo if
the project would be an ignored path in the parent repository.
This way, if your home directory is a git repository, as long as
you have ignored the directory you are creating a new project in,
we will instantiate a git repository without you having to
specifically request it.
Replace the duplicate .cwd call with an invocation taken from
https://stackoverflow.com/a/3138925/463761
Match the semantics of the other vcs calls, which is invoke from 'cwd'
targeting 'path'. Looks a little confusing because hg takes a '--cwd'
argument.
When I recently changed the doctest handling, I forgot to check the lib type in
the `test --doc` scenario.
I also added the package name to a nearby error message, since it can be
confusing in a workspace setting.
Update replaced registry before search
Close#5550.
It seems that updating the replaced registry before search has not been well considered in cargo and I have to add a function to trait `core::source::Source` to get the replaced `SourceId`.
I am not sure whether this is a good design, any advice is welcome.
Minimal versions build
This is a conceptual rebase of #5275, to reiterate:
Big thanks to @klausi for doing most of the work!
Thanks to @matklad for pointing out that we could finish it.
I don't know if I have the Travis config quite correct, advice definitely wellcome!
edit: closes#5275
Looks like cargo traverses the filesystem & fails if it runs into a
Cargo.toml that doesn't declare a target. I couldn't find a nice way to
re-engineer the test to avoid this issue. So I'll leave that as someone
else's exercise.