Show More
@@ -305,14 +305,31 b' impl Repo {' | |||
|
305 | 305 | } |
|
306 | 306 | |
|
307 | 307 | fn new_dirstate_map(&self) -> Result<OwningDirstateMap, DirstateError> { |
|
308 | if self.has_dirstate_v2() { | |
|
309 | self.read_docket_and_data_file() | |
|
310 | } else { | |
|
308 | 311 | let dirstate_file_contents = self.dirstate_file_contents()?; |
|
309 | 312 | if dirstate_file_contents.is_empty() { |
|
310 | 313 | self.dirstate_parents.set(DirstateParents::NULL); |
|
311 | if self.has_dirstate_v2() { | |
|
312 | self.dirstate_data_file_uuid.set(None); | |
|
314 | Ok(OwningDirstateMap::new_empty(Vec::new())) | |
|
315 | } else { | |
|
316 | let (map, parents) = | |
|
317 | OwningDirstateMap::new_v1(dirstate_file_contents)?; | |
|
318 | self.dirstate_parents.set(parents); | |
|
319 | Ok(map) | |
|
320 | } | |
|
321 | } | |
|
313 | 322 | } |
|
314 | Ok(OwningDirstateMap::new_empty(Vec::new())) | |
|
315 | } else if self.has_dirstate_v2() { | |
|
323 | ||
|
324 | fn read_docket_and_data_file( | |
|
325 | &self, | |
|
326 | ) -> Result<OwningDirstateMap, DirstateError> { | |
|
327 | let dirstate_file_contents = self.dirstate_file_contents()?; | |
|
328 | if dirstate_file_contents.is_empty() { | |
|
329 | self.dirstate_parents.set(DirstateParents::NULL); | |
|
330 | self.dirstate_data_file_uuid.set(None); | |
|
331 | return Ok(OwningDirstateMap::new_empty(Vec::new())); | |
|
332 | } | |
|
316 | 333 |
|
|
317 | 334 |
|
|
318 | 335 |
|
@@ -321,8 +338,7 b' impl Repo {' | |||
|
321 | 338 |
|
|
322 | 339 |
|
|
323 | 340 |
|
|
324 | let mut map = | |
|
325 | if crate::vfs::is_on_nfs_mount(docket.data_filename()) { | |
|
341 | let mut map = if crate::vfs::is_on_nfs_mount(docket.data_filename()) { | |
|
326 | 342 |
|
|
327 | 343 |
|
|
328 | 344 |
|
@@ -354,12 +370,6 b' impl Repo {' | |||
|
354 | 370 |
|
|
355 | 371 | |
|
356 | 372 |
|
|
357 | } else { | |
|
358 | let (map, parents) = | |
|
359 | OwningDirstateMap::new_v1(dirstate_file_contents)?; | |
|
360 | self.dirstate_parents.set(parents); | |
|
361 | Ok(map) | |
|
362 | } | |
|
363 | 373 | } |
|
364 | 374 | |
|
365 | 375 | pub fn dirstate_map( |
General Comments 0
You need to be logged in to leave comments.
Login now