##// END OF EJS Templates
rhg: simplify the handling of share-safe config mismatch...
Arseniy Alekseyev -
r49664:1d5fd9de default
parent child Browse files
Show More
@@ -6,7 +6,6 b' use crate::dirstate_tree::on_disk::Docke'
6 use crate::dirstate_tree::owning::OwningDirstateMap;
6 use crate::dirstate_tree::owning::OwningDirstateMap;
7 use crate::errors::HgResultExt;
7 use crate::errors::HgResultExt;
8 use crate::errors::{HgError, IoResultExt};
8 use crate::errors::{HgError, IoResultExt};
9 use crate::exit_codes;
10 use crate::lock::{try_with_lock_no_wait, LockError};
9 use crate::lock::{try_with_lock_no_wait, LockError};
11 use crate::manifest::{Manifest, Manifestlog};
10 use crate::manifest::{Manifest, Manifestlog};
12 use crate::revlog::filelog::Filelog;
11 use crate::revlog::filelog::Filelog;
@@ -160,31 +159,8 b' impl Repo {'
160 requirements::load(Vfs { base: &shared_path })?
159 requirements::load(Vfs { base: &shared_path })?
161 .contains(requirements::SHARESAFE_REQUIREMENT);
160 .contains(requirements::SHARESAFE_REQUIREMENT);
162
161
163 if share_safe && !source_is_share_safe {
162 if share_safe != source_is_share_safe {
164 return Err(match config
163 return Err(HgError::unsupported("share-safe mismatch").into());
165 .get(b"share", b"safe-mismatch.source-not-safe")
166 {
167 Some(b"abort") | None => HgError::abort(
168 "abort: share source does not support share-safe requirement\n\
169 (see `hg help config.format.use-share-safe` for more information)",
170 exit_codes::ABORT,
171 ),
172 _ => HgError::unsupported("share-safe downgrade"),
173 }
174 .into());
175 } else if source_is_share_safe && !share_safe {
176 return Err(
177 match config.get(b"share", b"safe-mismatch.source-safe") {
178 Some(b"abort") | None => HgError::abort(
179 "abort: version mismatch: source uses share-safe \
180 functionality while the current share does not\n\
181 (see `hg help config.format.use-share-safe` for more information)",
182 exit_codes::ABORT,
183 ),
184 _ => HgError::unsupported("share-safe upgrade"),
185 }
186 .into(),
187 );
188 }
164 }
189
165
190 if share_safe {
166 if share_safe {
General Comments 0
You need to be logged in to leave comments. Login now