Commit graph

19 commits

Author SHA1 Message Date
Adrian
3e297a6803
Update test for override respects spec metadata 2023-11-29 18:47:27 +02:00
Eric Huss
0afd943dad Fix some test output validation. 2023-11-15 15:10:18 -08:00
Ed Page
1e34066360 test(replace): Clarify name for remaining new test 2023-10-17 10:09:45 -05:00
Ed Page
7502318a85 fix(replace): Error, rather than assert, on version mismatch 2023-10-17 10:09:45 -05:00
Ed Page
0ec3274326 fix(spec): Ensure PackageIdSpec respects version 'build' field 2023-10-17 10:09:41 -05:00
Ed Page
ae068fbf4c test(replace): Show behavior post-#12614
PR #12614
- Changed ignored replaces to not-ignored
- Has bugs in matching replaces
2023-10-16 11:09:27 -05:00
Ed Page
4bf1af0cd0 fix(update): Make -p more convenient by being positional
Generally, cargo avoids positional arguments.  Mostly for the commands
that might forward arguments to another command, like `cargo test`.
It also allows some flexibility in turning flags into options.

For `cargo add` and `cargo remove`, we decided to accept positionals
because the motivations didn't seem to apply as much (similar to `cargo
install`).

This applies the pattern to `cargo update` as well which is in the same
category of commands as `cargo add` and `cargo remove`.

As for `--help` formatting, I'm mixed on whether `[SPEC]...` should be at the top like
other positionals or should be relegated to "Package selection".  I went
with the latter mostly to make it easier to visualize the less common
choice.

Switching to a positional for `cargo update` (while keeping `-p` for
backwards compatibility) was referenced in #12425.
2023-08-23 11:57:36 -05:00
Scott Schafer
6282282fb0 chore: update replace tests to use check 2023-02-20 12:22:29 -06:00
Ed Page
cdec3838a8 Extend pkgid syntax with @ support
In addition to `foo:1.2.3`, we now support `foo@1.2.3` for pkgids.  We
are also making it the default way of rendering pkgid's for the user.

With cargo-add in #10472, we've decided to only use `@` in it and to add
it as an alternative to `:` in the rest of cargo.  `cargo-add`
originally used `@`.  When preparing it for merge, I switched to `:` to
be consistent with pkgids. When discussing this, it was felt `@` has
precedence in too many tools to switch to `:` but that we should instead
switch pkgid's to use `@`, in a backwards compatible way.

See also https://internals.rust-lang.org/t/feedback-on-cargo-add-before-its-merged/16024/26?u=epage
2022-04-19 16:00:15 -05:00
bors
9535dc3dfd Auto merge of #9681 - hi-rustin:rustin-patch-reject, r=ehuss
Warning when using features in replace

close https://github.com/rust-lang/cargo/issues/3034
close https://github.com/rust-lang/cargo/issues/2582

r? `@ehuss`
2021-07-23 18:53:25 +00:00
hi-rustin
771356d821 Warning when using features in replace
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2021-07-23 15:00:50 +08:00
Weihang Lo
8c75e2ffa0
Update tests to use registry names 2021-07-22 00:50:30 +08:00
hi-rustin
add4ffc200 Reject when using features in replace
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2021-07-12 14:56:24 +08:00
Eric Huss
6f8c7d5a87 Normalize raw string indentation. 2020-09-26 17:59:58 -07:00
Alex Crichton
6514c289d2 Improve git error messages a bit
This commit is targeted at further improving the error messages
generated from git errors. For authentication errors the actual URL
fetched is now printed out as well if it's different from the original
URL. This should help handle `insteadOf` logic where SSH urls are used
instead of HTTPS urls and users can know to track that down.

Otherwise the logic about recommending `net.git-fetch-with-cli` was
tweaked a bit and moved to the same location as the rest of our error
reporting.

Note that a change piggy-backed here as well is that `Caused by:` errors
are now automatically all tabbed over a bit instead of only having the
first line tabbed over. This required a good number of tests to be
updated, but it's just an updated in renderings.
2020-06-25 08:47:15 -07:00
Daniel Wagner-Hall
556c236f9a Bump to semver 0.10 for VersionReq::is_exact
This stops using `to_string` as a proxy for this now-provided precise API.

This reverts commit b71927224f and bupms the
dependency version in Cargo.toml.
2020-05-25 11:11:45 +01:00
Eric Huss
1eca786d7f Add path to the failure to load a dependency. 2020-02-27 08:17:18 -08:00
Eric Huss
a07fec1b7b Provide extra context on a query failure. 2020-02-25 10:17:11 -08:00
Eric Huss
83571aee56 Minor testsuite organization. 2019-11-24 18:42:45 -08:00
Renamed from tests/testsuite/overrides.rs (Browse further)