Details
Details
- Reviewers
Alphare - Group Reviewers
hg-reviewers
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Branch
- default
- Lint
No Linters Available - Unit
No Unit Test Coverage
| Alphare |
| hg-reviewers |
| No Linters Available |
| No Unit Test Coverage |
| Path | Packages | |||
|---|---|---|---|---|
| M | rust/hg-core/src/revlog/filelog.rs (7 lines) |
| Commit | Parents | Author | Summary | Date |
|---|---|---|---|---|
| 3d39bebf9ff6 | 695404f6755b | Martin von Zweigbergk | Thu, Apr 14, 12:09 PM |
| Status | Author | Revision | |
|---|---|---|---|
| Needs Review | martinvonz | ||
| Needs Review | martinvonz | ||
| Accepted | martinvonz | ||
| Accepted | martinvonz | ||
| Needs Review | martinvonz | ||
| Needs Review | martinvonz | ||
| Needs Review | martinvonz | ||
| Needs Review | martinvonz | ||
| Needs Review | martinvonz | ||
| Closed | martinvonz | ||
| Accepted | martinvonz | ||
| Accepted | martinvonz | ||
| Needs Review | martinvonz | ||
| Accepted | martinvonz | ||
| Accepted | martinvonz | ||
| Closed | martinvonz | ||
| Closed | martinvonz | ||
| Closed | martinvonz | ||
| Closed | martinvonz |
| use crate::errors::HgError; | use crate::errors::HgError; | ||||
| use crate::repo::Repo; | use crate::repo::Repo; | ||||
| use crate::requirements; | |||||
| use crate::revlog::path_encode::path_encode; | use crate::revlog::path_encode::path_encode; | ||||
| use crate::revlog::revlog::RevlogEntry; | use crate::revlog::revlog::RevlogEntry; | ||||
| use crate::revlog::revlog::{Revlog, RevlogError}; | use crate::revlog::revlog::{Revlog, RevlogError}; | ||||
| use crate::revlog::NodePrefix; | use crate::revlog::NodePrefix; | ||||
| use crate::revlog::Revision; | use crate::revlog::Revision; | ||||
| use crate::utils::files::get_path_from_bytes; | use crate::utils::files::get_path_from_bytes; | ||||
| use crate::utils::hg_path::HgPath; | use crate::utils::hg_path::HgPath; | ||||
| use crate::utils::SliceExt; | use crate::utils::SliceExt; | ||||
| use std::path::PathBuf; | use std::path::PathBuf; | ||||
| /// A specialized `Revlog` to work with file data logs. | /// A specialized `Revlog` to work with file data logs. | ||||
| pub struct Filelog { | pub struct Filelog { | ||||
| /// The generic `revlog` format. | /// The generic `revlog` format. | ||||
| revlog: Revlog, | revlog: Revlog, | ||||
| } | } | ||||
| impl Filelog { | impl Filelog { | ||||
| pub fn open(repo: &Repo, file_path: &HgPath) -> Result<Self, HgError> { | pub fn open(repo: &Repo, file_path: &HgPath) -> Result<Self, HgError> { | ||||
| let index_path = store_path(file_path, b".i"); | let index_path = store_path(file_path, b".i"); | ||||
| let data_path = store_path(file_path, b".d"); | let data_path = store_path(file_path, b".d"); | ||||
| let use_nodemap = repo | let revlog = Revlog::open(repo, index_path, Some(&data_path), false)?; | ||||
| .requirements() | |||||
| .contains(requirements::NODEMAP_REQUIREMENT); | |||||
| let revlog = | |||||
| Revlog::open(repo, index_path, Some(&data_path), use_nodemap)?; | |||||
| Ok(Self { revlog }) | Ok(Self { revlog }) | ||||
| } | } | ||||
| /// The given node ID is that of the file as found in a filelog, not of a | /// The given node ID is that of the file as found in a filelog, not of a | ||||
| /// changeset. | /// changeset. | ||||
| pub fn data_for_node( | pub fn data_for_node( | ||||
| &self, | &self, | ||||
| file_node: impl Into<NodePrefix>, | file_node: impl Into<NodePrefix>, | ||||