Show More
@@ -1,4 +1,5 b'' | |||
|
1 | 1 | use crate::errors::{HgError, HgResultExt}; |
|
2 | use crate::requirements; | |
|
2 | 3 | use bytes_cast::{unaligned, BytesCast}; |
|
3 | 4 | use memmap::Mmap; |
|
4 | 5 | use std::path::{Path, PathBuf}; |
@@ -38,6 +39,14 b' impl NodeMapDocket {' | |||
|
38 | 39 | repo: &Repo, |
|
39 | 40 | index_path: &Path, |
|
40 | 41 | ) -> Result<Option<(Self, Mmap)>, RevlogError> { |
|
42 | if !repo | |
|
43 | .requirements() | |
|
44 | .contains(requirements::NODEMAP_REQUIREMENT) | |
|
45 | { | |
|
46 | // If .hg/requires does not opt it, don’t try to open a nodemap | |
|
47 | return Ok(None); | |
|
48 | } | |
|
49 | ||
|
41 | 50 | let docket_path = index_path.with_extension("n"); |
|
42 | 51 | let docket_bytes = if let Some(bytes) = |
|
43 | 52 | repo.store_vfs().read(&docket_path).io_not_found_as_none()? |
@@ -88,6 +97,8 b' impl NodeMapDocket {' | |||
|
88 | 97 | Err(HgError::corrupted("persistent nodemap too short").into()) |
|
89 | 98 | } |
|
90 | 99 | } else { |
|
100 | // Even if .hg/requires opted in, some revlogs are deemed small | |
|
101 | // enough to not need a persistent nodemap. | |
|
91 | 102 | Ok(None) |
|
92 | 103 | } |
|
93 | 104 | } |
General Comments 0
You need to be logged in to leave comments.
Login now