Mercurial > hg
comparison rust/hg-core/src/dirstate_tree/dirstate_map.rs @ 47101:5d62243c7732
rust: Add a Timestamp struct instead of abusing Duration
`SystemTime` would be the standard library type semantically appropriate
instead of `Duration`.
But since the value is coming from Python as a plain integer and used in
dirstate packing code as an integer, let’s make a type that contains a single
integer instead of using one with sub-second precision.
Differential Revision: https://phab.mercurial-scm.org/D10485
author | Simon Sapin <simon.sapin@octobus.net> |
---|---|
date | Mon, 12 Apr 2021 14:43:45 +0200 |
parents | caa3031c9ed5 |
children | d6c94ca40863 |
comparison
equal
deleted
inserted
replaced
47100:caa3031c9ed5 | 47101:5d62243c7732 |
---|---|
1 use std::collections::BTreeMap; | 1 use std::collections::BTreeMap; |
2 use std::path::PathBuf; | 2 use std::path::PathBuf; |
3 use std::time::Duration; | |
4 | 3 |
5 use super::path_with_basename::WithBasename; | 4 use super::path_with_basename::WithBasename; |
6 use crate::dirstate::parsers::parse_dirstate_entries; | 5 use crate::dirstate::parsers::parse_dirstate_entries; |
7 use crate::dirstate::parsers::parse_dirstate_parents; | 6 use crate::dirstate::parsers::parse_dirstate_parents; |
7 use crate::dirstate::parsers::Timestamp; | |
8 | 8 |
9 use crate::matchers::Matcher; | 9 use crate::matchers::Matcher; |
10 use crate::revlog::node::NULL_NODE; | 10 use crate::revlog::node::NULL_NODE; |
11 use crate::utils::hg_path::{HgPath, HgPathBuf}; | 11 use crate::utils::hg_path::{HgPath, HgPathBuf}; |
12 use crate::CopyMapIter; | 12 use crate::CopyMapIter; |
326 } | 326 } |
327 | 327 |
328 fn pack( | 328 fn pack( |
329 &mut self, | 329 &mut self, |
330 _parents: DirstateParents, | 330 _parents: DirstateParents, |
331 _now: Duration, | 331 _now: Timestamp, |
332 ) -> Result<Vec<u8>, DirstateError> { | 332 ) -> Result<Vec<u8>, DirstateError> { |
333 let _ = self.iter_node_data_mut(); | 333 let _ = self.iter_node_data_mut(); |
334 todo!() | 334 todo!() |
335 } | 335 } |
336 | 336 |