139 requirements::load(Vfs { base: &shared_path })? |
139 requirements::load(Vfs { base: &shared_path })? |
140 .contains(requirements::SHARESAFE_REQUIREMENT); |
140 .contains(requirements::SHARESAFE_REQUIREMENT); |
141 |
141 |
142 if share_safe && !source_is_share_safe { |
142 if share_safe && !source_is_share_safe { |
143 return Err(match config |
143 return Err(match config |
144 .get(b"safe-mismatch", b"source-not-safe") |
144 .get(b"share", b"safe-mismatch.source-not-safe") |
145 { |
145 { |
146 Some(b"abort") | None => HgError::abort( |
146 Some(b"abort") | None => HgError::abort( |
147 "share source does not support share-safe requirement", |
147 "abort: share source does not support share-safe requirement\n\ |
|
148 (see `hg help config.format.use-share-safe` for more information)", |
148 ), |
149 ), |
149 _ => HgError::unsupported("share-safe downgrade"), |
150 _ => HgError::unsupported("share-safe downgrade"), |
150 } |
151 } |
151 .into()); |
152 .into()); |
152 } else if source_is_share_safe && !share_safe { |
153 } else if source_is_share_safe && !share_safe { |
153 return Err( |
154 return Err( |
154 match config.get(b"safe-mismatch", b"source-safe") { |
155 match config.get(b"share", b"safe-mismatch.source-safe") { |
155 Some(b"abort") | None => HgError::abort( |
156 Some(b"abort") | None => HgError::abort( |
156 "version mismatch: source uses share-safe \ |
157 "abort: version mismatch: source uses share-safe \ |
157 functionality while the current share does not", |
158 functionality while the current share does not\n\ |
|
159 (see `hg help config.format.use-share-safe` for more information)", |
158 ), |
160 ), |
159 _ => HgError::unsupported("share-safe upgrade"), |
161 _ => HgError::unsupported("share-safe upgrade"), |
160 } |
162 } |
161 .into(), |
163 .into(), |
162 ); |
164 ); |