##// END OF EJS Templates
rust: add `dirstate_tree` module...
rust: add `dirstate_tree` module Mercurial needs to represent the filesystem hierarchy on which it operates, for example in the dirstate. Its current on-disk representation is an unsorted, flat structure that gets transformed in the current Rust code into a `HashMap`. This loses the hierarchical information of the dirstate, leading to some unfortunate performance and algorithmic compromises. This module adds an implementation of a radix tree that is specialized for representing the dirstate: its unit is the path component. I have made no efforts to optimize either its memory footprint or its insertion speed: they're pretty bad for now. Following will be a few patches that modify the dirstate.status logic to use that new hierarchical information, fixing issue 6335 in the same swing. Differential Revision: https://phab.mercurial-scm.org/D9085

File last commit:

r45223:26ce8e75 merge 5.4rc0 stable
r46136:b51167d7 default
Show More
main.rs
38 lines | 1.4 KiB | application/rls-services+xml | RustLexer
use pyembed::MainPythonInterpreter;
// Include an auto-generated file containing the default
// `pyembed::PythonConfig` derived by the PyOxidizer configuration file.
//
// If you do not want to use PyOxidizer to generate this file, simply
// remove this line and instantiate your own instance of
// `pyembed::PythonConfig`.
include!(env!("PYOXIDIZER_DEFAULT_PYTHON_CONFIG_RS"));
fn main() {
// The following code is in a block so the MainPythonInterpreter is destroyed in an
// orderly manner, before process exit.
let code = {
// Load the default Python configuration as derived by the PyOxidizer config
// file used at build time.
let config = default_python_config();
// Construct a new Python interpreter using that config, handling any errors
// from construction.
match MainPythonInterpreter::new(config) {
Ok(mut interp) => {
// And run it using the default run configuration as specified by the
// configuration. If an uncaught Python exception is raised, handle it.
// This includes the special SystemExit, which is a request to terminate the
// process.
interp.run_as_main()
}
Err(msg) => {
eprintln!("{}", msg);
1
}
}
};
// And exit the process according to code execution results.
std::process::exit(code);
}