Commit graph

29 commits

Author SHA1 Message Date
Connor Worley
a1559be493 Implementation of shallow libgit2 fetches behind an unstable flag 2024-01-11 17:08:21 +09: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
Sebastian Thiel
2f45cb54fa
Assure that git-dependencies will get the correct storage, without ever unshallowing them.
This is an improvement over the previous version which would use unshallowing that effectively
makes a shallow repo *not* shallow.

Furthermore, we will now only fetch a single commit, each time we fetch, which should be faster
for the server as well as for the client.

We also make it possible to fetch individual commits that would be specified via Cargo.lock.
2023-04-27 18:49:59 +02:00
Dirkjan Ochtman
20a5d2b82f Accurately show status when downgrading dependencies 2023-03-13 13:29:30 +01:00
Arlo Siemsen
65e449ecda Improve error for missing crate in --offline mode for sparse index
This changes sparse registries to instead return not found when a non-cached crate is requested in offline mode.

The resolver can then suggest removing the --offline flag if resolution
fails.
2023-03-01 14:45:09 -06:00
Scott Schafer
e3d3bb6b04 chore: update offline tests to use check 2023-02-20 12:21:27 -06:00
Scott Schafer
ab18bd40d5 refactor(testsuite): Replace [project] with [package] 2022-09-26 09:51:16 -06:00
hi-rustin
7363f43d02 Add offline_and_locked_and_no_frozen test
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2022-03-27 11:13:24 +08:00
Arlo Siemsen
412b633914 HTTP registry implementation 2022-03-20 18:02:09 -07:00
Weihang Lo
8c75e2ffa0
Update tests to use registry names 2021-07-22 00:50:30 +08:00
Eric Huss
dd8fa9183d Adjust error message with offline and frozen. 2021-07-01 16:59:19 -07:00
Revantus
61a8f711df Fix offline tests. Rename to cached/not_cached. 2021-03-18 08:33:55 -06:00
Revantus
8ae547233f Remove eager fail for update --offline 2021-03-18 08:04:42 -06:00
Revantus
06eed4afe4 Allowing update --offline with precise flags
Adding additional test for updating against changed offline
dependancies.

rust-lang/cargo#9248
2021-03-14 07:17:59 -06: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
Eric Huss
944f5049f1 Re-implement proc-macro feature decoupling. 2020-03-22 15:08:02 -07: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
14379767ee Remove --offline empty index error. 2019-12-03 11:52:10 -08:00
Eric Huss
83571aee56 Minor testsuite organization. 2019-11-24 18:42:45 -08:00
Alex Crichton
9115b2c326 Extract support directory to its own crate
Extract out all our test support code to its own standalone crate so it
can be shared between multiple test suites if necessary.
2019-09-16 11:47:09 -07:00
Eric Huss
3c20a24335 Clean up some git test support functions. 2019-08-12 22:25:36 -07:00
Jethro Beekman
0e0d968825 Update #[test] attribute on all tests in the testsuite
sed -i 's/^#\[test\]/#[cargo_test]/' $(rg -l '^#\[test\]')

Manual fixes:
* proc_macro::proc_macro_doctest
2019-06-07 12:41:26 -07:00
Eric Huss
309eb874fd Stabilize offline mode. 2019-05-12 10:49:45 -07:00
k-nasa
63a9c7aa6d $cargo fmt --all 2019-05-02 06:39:15 +09:00
Eric Huss
c6fad3af85 Tweak the error message when updating an empty registry while offline. 2019-04-28 20:04:32 -07:00
Eric Huss
c2d12c6ccc Add some help with updating the registry in offline mode.
This makes two changes:

- If an index has never been downloaded, and `-Z offline` is used, provide a
  suggestion to run without `-Z offline`.

- If an index needs to be updated, and the network appears to be down, suggest
  running with `-Z offline`.
2019-04-28 19:45:01 -07:00
Eric Huss
80b9d329ba Move offline tests to a dedicated file. 2019-04-28 19:45:01 -07:00