Show More
@@ -187,8 +187,8 b' impl Repo {' | |||
|
187 | 187 | Self::read_dirstate_data_file_uuid, |
|
188 | 188 | ), |
|
189 | 189 | dirstate_map: LazyCell::new(Self::new_dirstate_map), |
|
190 |
changelog: LazyCell::new( |
|
|
191 |
manifestlog: LazyCell::new( |
|
|
190 | changelog: LazyCell::new(Self::new_changelog), | |
|
191 | manifestlog: LazyCell::new(Self::new_manifestlog), | |
|
192 | 192 | }; |
|
193 | 193 | |
|
194 | 194 | requirements::check(&repo)?; |
@@ -344,6 +344,13 b' impl Repo {' | |||
|
344 | 344 | self.dirstate_map.get_mut_or_init(self) |
|
345 | 345 | } |
|
346 | 346 | |
|
347 | fn new_changelog(&self) -> Result<Changelog, HgError> { | |
|
348 | let use_nodemap = self | |
|
349 | .requirements | |
|
350 | .contains(requirements::NODEMAP_REQUIREMENT); | |
|
351 | Changelog::open(&self.store_vfs(), use_nodemap) | |
|
352 | } | |
|
353 | ||
|
347 | 354 | pub fn changelog(&self) -> Result<Ref<Changelog>, HgError> { |
|
348 | 355 | self.changelog.get_or_init(self) |
|
349 | 356 | } |
@@ -352,6 +359,13 b' impl Repo {' | |||
|
352 | 359 | self.changelog.get_mut_or_init(self) |
|
353 | 360 | } |
|
354 | 361 | |
|
362 | fn new_manifestlog(&self) -> Result<Manifestlog, HgError> { | |
|
363 | let use_nodemap = self | |
|
364 | .requirements | |
|
365 | .contains(requirements::NODEMAP_REQUIREMENT); | |
|
366 | Manifestlog::open(&self.store_vfs(), use_nodemap) | |
|
367 | } | |
|
368 | ||
|
355 | 369 | pub fn manifestlog(&self) -> Result<Ref<Manifestlog>, HgError> { |
|
356 | 370 | self.manifestlog.get_or_init(self) |
|
357 | 371 | } |
@@ -1,10 +1,9 b'' | |||
|
1 | 1 | use crate::errors::HgError; |
|
2 | use crate::repo::Repo; | |
|
3 | use crate::requirements; | |
|
4 | 2 | use crate::revlog::revlog::{Revlog, RevlogEntry, RevlogError}; |
|
5 | 3 | use crate::revlog::Revision; |
|
6 | 4 | use crate::revlog::{Node, NodePrefix}; |
|
7 | 5 | use crate::utils::hg_path::HgPath; |
|
6 | use crate::vfs::Vfs; | |
|
8 | 7 | use itertools::Itertools; |
|
9 | 8 | use std::ascii::escape_default; |
|
10 | 9 | use std::fmt::{Debug, Formatter}; |
@@ -17,16 +16,9 b' pub struct Changelog {' | |||
|
17 | 16 | |
|
18 | 17 | impl Changelog { |
|
19 | 18 | /// Open the `changelog` of a repository given by its root. |
|
20 |
pub fn open( |
|
|
21 |
let |
|
|
22 | .requirements() | |
|
23 | .contains(requirements::NODEMAP_REQUIREMENT); | |
|
24 | let revlog = Revlog::open( | |
|
25 | &repo.store_vfs(), | |
|
26 | "00changelog.i", | |
|
27 | None, | |
|
28 | use_nodemap, | |
|
29 | )?; | |
|
19 | pub fn open(store_vfs: &Vfs, use_nodemap: bool) -> Result<Self, HgError> { | |
|
20 | let revlog = | |
|
21 | Revlog::open(store_vfs, "00changelog.i", None, use_nodemap)?; | |
|
30 | 22 | Ok(Self { revlog }) |
|
31 | 23 | } |
|
32 | 24 |
@@ -1,11 +1,10 b'' | |||
|
1 | 1 | use crate::errors::HgError; |
|
2 | use crate::repo::Repo; | |
|
3 | use crate::requirements; | |
|
4 | 2 | use crate::revlog::revlog::{Revlog, RevlogError}; |
|
5 | 3 | use crate::revlog::Revision; |
|
6 | 4 | use crate::revlog::{Node, NodePrefix}; |
|
7 | 5 | use crate::utils::hg_path::HgPath; |
|
8 | 6 | use crate::utils::SliceExt; |
|
7 | use crate::vfs::Vfs; | |
|
9 | 8 | |
|
10 | 9 | /// A specialized `Revlog` to work with `manifest` data format. |
|
11 | 10 | pub struct Manifestlog { |
@@ -15,16 +14,9 b' pub struct Manifestlog {' | |||
|
15 | 14 | |
|
16 | 15 | impl Manifestlog { |
|
17 | 16 | /// Open the `manifest` of a repository given by its root. |
|
18 |
pub fn open( |
|
|
19 |
let |
|
|
20 | .requirements() | |
|
21 | .contains(requirements::NODEMAP_REQUIREMENT); | |
|
22 | let revlog = Revlog::open( | |
|
23 | &repo.store_vfs(), | |
|
24 | "00manifest.i", | |
|
25 | None, | |
|
26 | use_nodemap, | |
|
27 | )?; | |
|
17 | pub fn open(store_vfs: &Vfs, use_nodemap: bool) -> Result<Self, HgError> { | |
|
18 | let revlog = | |
|
19 | Revlog::open(store_vfs, "00manifest.i", None, use_nodemap)?; | |
|
28 | 20 | Ok(Self { revlog }) |
|
29 | 21 | } |
|
30 | 22 |
General Comments 0
You need to be logged in to leave comments.
Login now