##// END OF EJS Templates
dirstate: add a synchronisation point before doing a full dirstate read...
marmoute -
r51123:fc8e37c3 stable
parent child Browse files
Show More
@@ -704,6 +704,16 b' coreconfigitem('
704 704 )
705 705 coreconfigitem(
706 706 b'devel',
707 b'sync.dirstate.pre-read-file',
708 default=None,
709 )
710 coreconfigitem(
711 b'devel',
712 b'sync.dirstate.pre-read-file-timeout',
713 default=2,
714 )
715 coreconfigitem(
716 b'devel',
707 717 b'strip-obsmarkers',
708 718 default=True,
709 719 )
@@ -10,6 +10,7 b' from . import ('
10 10 error,
11 11 pathutil,
12 12 policy,
13 testing,
13 14 txnutil,
14 15 util,
15 16 )
@@ -276,7 +277,9 b' class dirstatemap(_dirstatemapcommon):'
276 277 self._opener.join(self._filename)
277 278 )
278 279
280 testing.wait_on_cfg(self._ui, b'dirstate.pre-read-file')
279 281 if self._use_dirstate_v2:
282
280 283 if not self.docket.uuid:
281 284 return
282 285 st = self._opener.read(self.docket.data_filename())
@@ -541,6 +544,7 b' if rustmod is not None:'
541 544 self._opener.join(self._filename)
542 545 )
543 546
547 testing.wait_on_cfg(self._ui, b'dirstate.pre-read-file')
544 548 if self._use_dirstate_v2:
545 549 if self.docket.uuid:
546 550 # TODO: use mmap when possible
@@ -10,6 +10,7 b' use crate::lock::{try_with_lock_no_wait,'
10 10 use crate::manifest::{Manifest, Manifestlog};
11 11 use crate::revlog::filelog::Filelog;
12 12 use crate::revlog::revlog::RevlogError;
13 use crate::utils::debug::debug_wait_for_file_or_print;
13 14 use crate::utils::files::get_path_from_bytes;
14 15 use crate::utils::hg_path::HgPath;
15 16 use crate::utils::SliceExt;
@@ -308,6 +309,10 b' impl Repo {'
308 309 if self.has_dirstate_v2() {
309 310 self.read_docket_and_data_file()
310 311 } else {
312 debug_wait_for_file_or_print(
313 self.config(),
314 "dirstate.pre-read-file",
315 );
311 316 let dirstate_file_contents = self.dirstate_file_contents()?;
312 317 if dirstate_file_contents.is_empty() {
313 318 self.dirstate_parents.set(DirstateParents::NULL);
@@ -324,6 +329,7 b' impl Repo {'
324 329 fn read_docket_and_data_file(
325 330 &self,
326 331 ) -> Result<OwningDirstateMap, DirstateError> {
332 debug_wait_for_file_or_print(self.config(), "dirstate.pre-read-file");
327 333 let dirstate_file_contents = self.dirstate_file_contents()?;
328 334 if dirstate_file_contents.is_empty() {
329 335 self.dirstate_parents.set(DirstateParents::NULL);
@@ -79,3 +79,9 b' pub fn debug_wait_for_file('
79 79 Ok(())
80 80 }
81 81 }
82
83 pub fn debug_wait_for_file_or_print(config: &Config, config_option: &str) {
84 if let Err(e) = debug_wait_for_file(&config, config_option) {
85 eprintln!("{e}");
86 };
87 }
General Comments 0
You need to be logged in to leave comments. Login now