Mercurial > hg
comparison rust/hg-core/src/dirstate/parsers.rs @ 46601:755c31a1caf9
rhg: Add support for the blackbox extension
Only `command` and `commandfinish` events are logged.
The `dirty`, `logsource`, `track` and `ignore` configuration items
are not supported yet.
To indicate commands executed without Python, a `(rust) ` prefix is added
in corresponding log messages.
Differential Revision: https://phab.mercurial-scm.org/D10012
author | Simon Sapin <simon.sapin@octobus.net> |
---|---|
date | Tue, 16 Feb 2021 13:08:37 +0100 |
parents | 98a455a62699 |
children | 441024b279a6 |
comparison
equal
deleted
inserted
replaced
46600:36f3a64846c8 | 46601:755c31a1caf9 |
---|---|
23 type ParseResult<'a> = ( | 23 type ParseResult<'a> = ( |
24 &'a DirstateParents, | 24 &'a DirstateParents, |
25 Vec<(&'a HgPath, DirstateEntry)>, | 25 Vec<(&'a HgPath, DirstateEntry)>, |
26 Vec<(&'a HgPath, &'a HgPath)>, | 26 Vec<(&'a HgPath, &'a HgPath)>, |
27 ); | 27 ); |
28 | |
29 pub fn parse_dirstate_parents( | |
30 contents: &[u8], | |
31 ) -> Result<&DirstateParents, HgError> { | |
32 let (parents, _rest) = DirstateParents::from_bytes(contents) | |
33 .map_err(|_| HgError::corrupted("Too little data for dirstate."))?; | |
34 Ok(parents) | |
35 } | |
28 | 36 |
29 #[timed] | 37 #[timed] |
30 pub fn parse_dirstate(mut contents: &[u8]) -> Result<ParseResult, HgError> { | 38 pub fn parse_dirstate(mut contents: &[u8]) -> Result<ParseResult, HgError> { |
31 let mut copies = Vec::new(); | 39 let mut copies = Vec::new(); |
32 let mut entries = Vec::new(); | 40 let mut entries = Vec::new(); |