comparison rust/hg-cpython/src/dirstate/status.rs @ 48260:269ff8978086

dirstate: store mtimes with nanosecond precision in memory Keep integer seconds since the Unix epoch, together with integer nanoseconds in the `0 <= n < 1e9` range. For now, nanoseconds are still always zero. This commit is about data structure changes. Differential Revision: https://phab.mercurial-scm.org/D11684
author Simon Sapin <simon.sapin@octobus.net>
date Mon, 18 Oct 2021 11:23:07 +0200
parents f6bb181c75f8
children b80e5e75d51e
comparison
equal deleted inserted replaced
48259:84f6b0c41b90 48260:269ff8978086
7 7
8 //! Bindings for the `hg::status` module provided by the 8 //! Bindings for the `hg::status` module provided by the
9 //! `hg-core` crate. From Python, this will be seen as 9 //! `hg-core` crate. From Python, this will be seen as
10 //! `rustext.dirstate.status`. 10 //! `rustext.dirstate.status`.
11 11
12 use crate::dirstate::item::timestamp;
12 use crate::{dirstate::DirstateMap, exceptions::FallbackError}; 13 use crate::{dirstate::DirstateMap, exceptions::FallbackError};
13 use cpython::exc::OSError; 14 use cpython::exc::OSError;
14 use cpython::{ 15 use cpython::{
15 exc::ValueError, ObjectProtocol, PyBytes, PyErr, PyList, PyObject, 16 exc::ValueError, ObjectProtocol, PyBytes, PyErr, PyList, PyObject,
16 PyResult, PyTuple, Python, PythonObject, ToPyObject, 17 PyResult, PyTuple, Python, PythonObject, ToPyObject,
100 dmap: DirstateMap, 101 dmap: DirstateMap,
101 matcher: PyObject, 102 matcher: PyObject,
102 root_dir: PyObject, 103 root_dir: PyObject,
103 ignore_files: PyList, 104 ignore_files: PyList,
104 check_exec: bool, 105 check_exec: bool,
105 last_normal_time: i64, 106 last_normal_time: (u32, u32),
106 list_clean: bool, 107 list_clean: bool,
107 list_ignored: bool, 108 list_ignored: bool,
108 list_unknown: bool, 109 list_unknown: bool,
109 collect_traversed_dirs: bool, 110 collect_traversed_dirs: bool,
110 ) -> PyResult<PyTuple> { 111 ) -> PyResult<PyTuple> {
112 let last_normal_time = timestamp(py, last_normal_time)?;
111 let bytes = root_dir.extract::<PyBytes>(py)?; 113 let bytes = root_dir.extract::<PyBytes>(py)?;
112 let root_dir = get_path_from_bytes(bytes.data(py)); 114 let root_dir = get_path_from_bytes(bytes.data(py));
113 115
114 let dmap: DirstateMap = dmap.to_py_object(py); 116 let dmap: DirstateMap = dmap.to_py_object(py);
115 let mut dmap = dmap.get_inner_mut(py); 117 let mut dmap = dmap.get_inner_mut(py);