From b21dce3513d5fc4cbe12d7c203fc761cd378c666 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Sat, 9 Dec 2017 16:30:25 +0100 Subject: [PATCH 1/2] Add precision on overriding a repository [patch] --- src/doc/src/reference/specifying-dependencies.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/doc/src/reference/specifying-dependencies.md b/src/doc/src/reference/specifying-dependencies.md index e58fa915c0b..7fb0225d8c5 100644 --- a/src/doc/src/reference/specifying-dependencies.md +++ b/src/doc/src/reference/specifying-dependencies.md @@ -332,6 +332,17 @@ the new `uuid` crate applies to *both* our dependency on `uuid` and the version for this entire crate graph, 1.0.1, and it'll be pulled from the git repository. +#### Overriding repository URL + +In case the dependency you want to override isn't loaded from `crates.io`, you'll have to change a bit how you use `[patch]`: + +``` +[patch."https://github.com/your/repository"] +my-library = { path = "../my-library/path" } +``` + +And that's it! + ### Prepublishing a breaking change As a final scenario, let's take a look at working with a new major version of a From fb12480a57e14bf0a508659a089889d5a7bd1b4b Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Sat, 9 Dec 2017 16:34:48 +0100 Subject: [PATCH 2/2] Fix incoherence --- src/doc/src/reference/specifying-dependencies.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/doc/src/reference/specifying-dependencies.md b/src/doc/src/reference/specifying-dependencies.md index 7fb0225d8c5..fd94f611220 100644 --- a/src/doc/src/reference/specifying-dependencies.md +++ b/src/doc/src/reference/specifying-dependencies.md @@ -325,18 +325,18 @@ uuid = "1.0" uuid = { git = 'https://github.com/rust-lang-nursery/uuid' } ``` -Remember that `[patch]` is only applicable at the *top level* so we consumers of -`my-library` have to repeat the `[patch]` section if necessary. Here, though, -the new `uuid` crate applies to *both* our dependency on `uuid` and the -`my-library -> uuid` dependency. The `uuid` crate will be resolved to one -version for this entire crate graph, 1.0.1, and it'll be pulled from the git +Remember that `[patch]` is applicable *transitively* but can only be defined at +the *top level* so we consumers of `my-library` have to repeat the `[patch]` section +if necessary. Here, though, the new `uuid` crate applies to *both* our dependency on +`uuid` and the `my-library -> uuid` dependency. The `uuid` crate will be resolved to +one version for this entire crate graph, 1.0.1, and it'll be pulled from the git repository. #### Overriding repository URL In case the dependency you want to override isn't loaded from `crates.io`, you'll have to change a bit how you use `[patch]`: -``` +```toml [patch."https://github.com/your/repository"] my-library = { path = "../my-library/path" } ```