comparison rust/hg-cpython/src/dirstate/dirstate_map.rs @ 43788:1fe2e574616e

rust-dirs: address failing tests for `dirs` impl with a temporary fix https://phab.mercurial-scm.org/D7252 (5d40317d42b7083b49467502549e25f144888cb3) introduced a regression in Rust tests. This is a temporary fix that replicates the behavior of the C and Python impl, pending the resolution of the discussion (in the phabricator link) about how we actually want to solve this problem. Differential Revision: https://phab.mercurial-scm.org/D7503
author Raphaël Gomès <rgomes@octobus.net>
date Fri, 22 Nov 2019 10:39:05 +0100
parents 8418b77132c1
children bc7d8f45c3b6
comparison
equal deleted inserted replaced
43787:be8552f25cab 43788:1fe2e574616e
23 ref_sharing::{PyLeaked, PySharedRefCell}, 23 ref_sharing::{PyLeaked, PySharedRefCell},
24 }; 24 };
25 use hg::{ 25 use hg::{
26 utils::hg_path::{HgPath, HgPathBuf}, 26 utils::hg_path::{HgPath, HgPathBuf},
27 DirsMultiset, DirstateEntry, DirstateMap as RustDirstateMap, 27 DirsMultiset, DirstateEntry, DirstateMap as RustDirstateMap,
28 DirstateParents, DirstateParseError, EntryState, StateMapIter, 28 DirstateMapError, DirstateParents, DirstateParseError, EntryState,
29 PARENT_SIZE, 29 StateMapIter, PARENT_SIZE,
30 }; 30 };
31 31
32 // TODO 32 // TODO
33 // This object needs to share references to multiple members of its Rust 33 // This object needs to share references to multiple members of its Rust
34 // inner struct, namely `copy_map`, `dirs` and `all_dirs`. 34 // inner struct, namely `copy_map`, `dirs` and `all_dirs`.
95 })?, 95 })?,
96 mode: mode.extract(py)?, 96 mode: mode.extract(py)?,
97 size: size.extract(py)?, 97 size: size.extract(py)?,
98 mtime: mtime.extract(py)?, 98 mtime: mtime.extract(py)?,
99 }, 99 },
100 ); 100 ).and(Ok(py.None())).or_else(|e: DirstateMapError| {
101 Ok(py.None()) 101 Err(PyErr::new::<exc::ValueError, _>(py, e.to_string()))
102 })
102 } 103 }
103 104
104 def removefile( 105 def removefile(
105 &self, 106 &self,
106 f: PyObject, 107 f: PyObject,