This is the new API
Details
Details
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Branch
- default
- Lint
No Linters Available - Unit
No Unit Test Coverage
( )
No Linters Available |
No Unit Test Coverage |
Path | Packages | |||
---|---|---|---|---|
M | rust/hg-core/src/dirstate_tree/dirstate_map.rs (2 lines) | |||
M | rust/hg-core/src/dirstate_tree/on_disk.rs (2 lines) | |||
M | rust/hg-core/src/operations/list_tracked_files.rs (2 lines) | |||
M | rust/hg-core/src/repo.rs (2 lines) |
Commit | Parents | Author | Summary | Date |
---|---|---|---|---|
a4308ec870a8 | e63d1203a7b5 | Raphaël Gomès | Tue, Apr 12, 11:26 AM |
Status | Author | Revision | |
---|---|---|---|
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare |
let mut map = Self::empty(on_disk); | let mut map = Self::empty(on_disk); | ||||
if map.on_disk.is_empty() { | if map.on_disk.is_empty() { | ||||
return Ok((map, None)); | return Ok((map, None)); | ||||
} | } | ||||
let parents = parse_dirstate_entries( | let parents = parse_dirstate_entries( | ||||
map.on_disk, | map.on_disk, | ||||
|path, entry, copy_source| { | |path, entry, copy_source| { | ||||
let tracked = entry.state().is_tracked(); | let tracked = entry.tracked(); | ||||
let node = Self::get_or_insert_node_inner( | let node = Self::get_or_insert_node_inner( | ||||
map.on_disk, | map.on_disk, | ||||
&mut map.unreachable_bytes, | &mut map.unreachable_bytes, | ||||
&mut map.root, | &mut map.root, | ||||
path, | path, | ||||
WithBasename::to_cow_borrowed, | WithBasename::to_cow_borrowed, | ||||
|ancestor| { | |ancestor| { | ||||
if tracked { | if tracked { |
.map_err(|_| DirstateV2ParseError)?; | .map_err(|_| DirstateV2ParseError)?; | ||||
fn recur<'on_disk>( | fn recur<'on_disk>( | ||||
on_disk: &'on_disk [u8], | on_disk: &'on_disk [u8], | ||||
nodes: ChildNodes, | nodes: ChildNodes, | ||||
f: &mut impl FnMut(&'on_disk HgPath), | f: &mut impl FnMut(&'on_disk HgPath), | ||||
) -> Result<(), DirstateV2ParseError> { | ) -> Result<(), DirstateV2ParseError> { | ||||
for node in read_nodes(on_disk, nodes)? { | for node in read_nodes(on_disk, nodes)? { | ||||
if let Some(entry) = node.entry()? { | if let Some(entry) = node.entry()? { | ||||
if entry.state().is_tracked() { | if entry.tracked() { | ||||
f(node.full_path(on_disk)?) | f(node.full_path(on_disk)?) | ||||
} | } | ||||
} | } | ||||
recur(on_disk, node.children, f)? | recur(on_disk, node.children, f)? | ||||
} | } | ||||
Ok(()) | Ok(()) | ||||
} | } | ||||
recur(on_disk, meta.root_nodes, &mut f) | recur(on_disk, meta.root_nodes, &mut f) |
if let Some(meta) = &self.v2_metadata { | if let Some(meta) = &self.v2_metadata { | ||||
for_each_tracked_path(&self.content, meta, |path| { | for_each_tracked_path(&self.content, meta, |path| { | ||||
files.push(path) | files.push(path) | ||||
})? | })? | ||||
} else { | } else { | ||||
let _parents = parse_dirstate_entries( | let _parents = parse_dirstate_entries( | ||||
&self.content, | &self.content, | ||||
|path, entry, _copy_source| { | |path, entry, _copy_source| { | ||||
if entry.state().is_tracked() { | if entry.tracked() { | ||||
files.push(path) | files.push(path) | ||||
} | } | ||||
Ok(()) | Ok(()) | ||||
}, | }, | ||||
)?; | )?; | ||||
} | } | ||||
} | } | ||||
files.par_sort_unstable(); | files.par_sort_unstable(); |
.data_for_rev(revision)? | .data_for_rev(revision)? | ||||
.manifest_node()? | .manifest_node()? | ||||
.into(), | .into(), | ||||
) | ) | ||||
} | } | ||||
pub fn has_subrepos(&self) -> Result<bool, DirstateError> { | pub fn has_subrepos(&self) -> Result<bool, DirstateError> { | ||||
if let Some(entry) = self.dirstate_map()?.get(HgPath::new(".hgsub"))? { | if let Some(entry) = self.dirstate_map()?.get(HgPath::new(".hgsub"))? { | ||||
Ok(entry.state().is_tracked()) | Ok(entry.tracked()) | ||||
} else { | } else { | ||||
Ok(false) | Ok(false) | ||||
} | } | ||||
} | } | ||||
pub fn filelog(&self, path: &HgPath) -> Result<Filelog, HgError> { | pub fn filelog(&self, path: &HgPath) -> Result<Filelog, HgError> { | ||||
Filelog::open(self, path) | Filelog::open(self, path) | ||||
} | } |