Mercurial > public > mercurial-scm > hg-stable
diff rust/hg-core/src/repo.rs @ 49701:6cce0afc1454 stable
rust-dirstate: remember the data file uuid dirstate was loaded with
This will be used in the next patch to fix a race condition.
author | Rapha?l Gom?s <rgomes@octobus.net> |
---|---|
date | Mon, 12 Dec 2022 17:08:12 +0100 |
parents | 491f3dd080eb |
children | 07d030b38097 |
line wrap: on
line diff
--- a/rust/hg-core/src/repo.rs Wed Mar 01 02:38:20 2023 +0100 +++ b/rust/hg-core/src/repo.rs Mon Dec 12 17:08:12 2022 +0100 @@ -383,6 +383,7 @@ self.dirstate_parents.set(docket.parents()); self.dirstate_data_file_uuid .set(Some(docket.uuid.to_owned())); + let uuid = docket.uuid.to_owned(); let data_size = docket.data_size(); let context = "between reading dirstate docket and data file"; @@ -415,16 +416,16 @@ } Err(e) => return Err(e.into()), }; - OwningDirstateMap::new_v2(contents, data_size, metadata) + OwningDirstateMap::new_v2(contents, data_size, metadata, uuid) } else { match self .hg_vfs() .mmap_open(docket.data_filename()) .io_not_found_as_none() { - Ok(Some(data_mmap)) => { - OwningDirstateMap::new_v2(data_mmap, data_size, metadata) - } + Ok(Some(data_mmap)) => OwningDirstateMap::new_v2( + data_mmap, data_size, metadata, uuid, + ), Ok(None) => { // Race where the data file was deleted right after we // read the docket, try again