File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -155,6 +155,14 @@ impl PackageId {
155
155
PackageId :: pure ( self . inner . name , self . inner . version . clone ( ) , source)
156
156
}
157
157
158
+ pub fn map_source ( self , to_replace : SourceId , replace_with : SourceId ) -> Self {
159
+ if self . source_id ( ) == to_replace {
160
+ self . with_source_id ( replace_with)
161
+ } else {
162
+ self
163
+ }
164
+ }
165
+
158
166
pub fn stable_hash ( self , workspace : & Path ) -> PackageIdStableHash < ' _ > {
159
167
PackageIdStableHash ( self , workspace)
160
168
}
Original file line number Diff line number Diff line change @@ -120,7 +120,14 @@ impl<'cfg> SourceConfigMap<'cfg> {
120
120
)
121
121
}
122
122
}
123
- let new_src = new_id. load ( self . config , yanked_whitelist) ?;
123
+
124
+ let new_src = new_id. load (
125
+ self . config ,
126
+ & yanked_whitelist
127
+ . iter ( )
128
+ . map ( |p| p. map_source ( id, new_id) )
129
+ . collect ( ) ,
130
+ ) ?;
124
131
let old_src = id. load ( self . config , yanked_whitelist) ?;
125
132
if !new_src. supports_checksums ( ) && old_src. supports_checksums ( ) {
126
133
failure:: bail!(
You can’t perform that action at this time.
0 commit comments