Show More
@@ -24,7 +24,6 b' use crate::{' | |||||
24 | dirstate::non_normal_entries::{ |
|
24 | dirstate::non_normal_entries::{ | |
25 | NonNormalEntries, NonNormalEntriesIterator, |
|
25 | NonNormalEntries, NonNormalEntriesIterator, | |
26 | }, |
|
26 | }, | |
27 | parsers::dirstate_parents_to_pytuple, |
|
|||
28 | pybytes_deref::PyBytesDeref, |
|
27 | pybytes_deref::PyBytesDeref, | |
29 | }; |
|
28 | }; | |
30 | use hg::{ |
|
29 | use hg::{ | |
@@ -79,7 +78,11 b' py_class!(pub class DirstateMap |py| {' | |||||
79 | (Box::new(map) as _, parents) |
|
78 | (Box::new(map) as _, parents) | |
80 | }; |
|
79 | }; | |
81 | let map = Self::create_instance(py, inner)?; |
|
80 | let map = Self::create_instance(py, inner)?; | |
82 |
let parents = parents.map(|p| |
|
81 | let parents = parents.map(|p| { | |
|
82 | let p1 = PyBytes::new(py, p.p1.as_bytes()); | |||
|
83 | let p2 = PyBytes::new(py, p.p2.as_bytes()); | |||
|
84 | (p1, p2) | |||
|
85 | }); | |||
83 | Ok((map, parents).to_py_object(py).into_object()) |
|
86 | Ok((map, parents).to_py_object(py).into_object()) | |
84 | } |
|
87 | } | |
85 |
|
88 |
@@ -35,7 +35,6 b' pub mod debug;' | |||||
35 | pub mod dirstate; |
|
35 | pub mod dirstate; | |
36 | pub mod discovery; |
|
36 | pub mod discovery; | |
37 | pub mod exceptions; |
|
37 | pub mod exceptions; | |
38 | pub mod parsers; |
|
|||
39 | mod pybytes_deref; |
|
38 | mod pybytes_deref; | |
40 | pub mod revlog; |
|
39 | pub mod revlog; | |
41 | pub mod utils; |
|
40 | pub mod utils; | |
@@ -59,11 +58,6 b' py_module_initializer!(rustext, initrust' | |||||
59 | m.add(py, "discovery", discovery::init_module(py, &dotted_name)?)?; |
|
58 | m.add(py, "discovery", discovery::init_module(py, &dotted_name)?)?; | |
60 | m.add(py, "dirstate", dirstate::init_module(py, &dotted_name)?)?; |
|
59 | m.add(py, "dirstate", dirstate::init_module(py, &dotted_name)?)?; | |
61 | m.add(py, "revlog", revlog::init_module(py, &dotted_name)?)?; |
|
60 | m.add(py, "revlog", revlog::init_module(py, &dotted_name)?)?; | |
62 | m.add( |
|
|||
63 | py, |
|
|||
64 | "parsers", |
|
|||
65 | parsers::init_parsers_module(py, &dotted_name)?, |
|
|||
66 | )?; |
|
|||
67 | m.add(py, "GraphError", py.get_type::<exceptions::GraphError>())?; |
|
61 | m.add(py, "GraphError", py.get_type::<exceptions::GraphError>())?; | |
68 | Ok(()) |
|
62 | Ok(()) | |
69 | }); |
|
63 | }); |
@@ -34,7 +34,7 b' configitem(' | |||||
34 | ) |
|
34 | ) | |
35 |
|
35 | |||
36 | parsers = policy.importmod('parsers') |
|
36 | parsers = policy.importmod('parsers') | |
37 |
|
|
37 | has_rust_dirstate = policy.importrust('dirstate') is not None | |
38 |
|
38 | |||
39 |
|
39 | |||
40 | def pack_dirstate(fakenow, orig, dmap, copymap, pl, now): |
|
40 | def pack_dirstate(fakenow, orig, dmap, copymap, pl, now): | |
@@ -63,7 +63,7 b' def fakewrite(ui, func):' | |||||
63 | # 'fakenow' value and 'touch -t YYYYmmddHHMM' argument easy |
|
63 | # 'fakenow' value and 'touch -t YYYYmmddHHMM' argument easy | |
64 | fakenow = dateutil.parsedate(fakenow, [b'%Y%m%d%H%M'])[0] |
|
64 | fakenow = dateutil.parsedate(fakenow, [b'%Y%m%d%H%M'])[0] | |
65 |
|
65 | |||
66 |
if |
|
66 | if has_rust_dirstate: | |
67 | # The Rust implementation does not use public parse/pack dirstate |
|
67 | # The Rust implementation does not use public parse/pack dirstate | |
68 | # to prevent conversion round-trips |
|
68 | # to prevent conversion round-trips | |
69 | orig_dirstatemap_write = dirstatemapmod.dirstatemap.write |
|
69 | orig_dirstatemap_write = dirstatemapmod.dirstatemap.write | |
@@ -85,7 +85,7 b' def fakewrite(ui, func):' | |||||
85 | finally: |
|
85 | finally: | |
86 | orig_module.pack_dirstate = orig_pack_dirstate |
|
86 | orig_module.pack_dirstate = orig_pack_dirstate | |
87 | dirstate._getfsnow = orig_dirstate_getfsnow |
|
87 | dirstate._getfsnow = orig_dirstate_getfsnow | |
88 |
if |
|
88 | if has_rust_dirstate: | |
89 | dirstatemapmod.dirstatemap.write = orig_dirstatemap_write |
|
89 | dirstatemapmod.dirstatemap.write = orig_dirstatemap_write | |
90 |
|
90 | |||
91 |
|
91 |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
General Comments 0
You need to be logged in to leave comments.
Login now