diff --git a/Makefile b/Makefile --- a/Makefile +++ b/Makefile @@ -133,7 +133,7 @@ rust-tests: cd $(HGROOT)/rust/hg-cpython \ && $(CARGO) test --quiet --all \ - --no-default-features --features "$(py_feature)" + --no-default-features --features "$(py_feature) $(HG_RUST_FEATURES)" check-code: hg manifest | xargs python contrib/check-code.py diff --git a/contrib/heptapod-ci.yml b/contrib/heptapod-ci.yml --- a/contrib/heptapod-ci.yml +++ b/contrib/heptapod-ci.yml @@ -41,6 +41,12 @@ variables: PYTHON: python3 +rust-cargo-test-py3-dirstate-tree: + <<: *rust_cargo_test + variables: + PYTHON: python3 + HG_RUST_FEATURES: dirstate-tree + test-py2: <<: *runtests variables: @@ -82,6 +88,15 @@ PYTHON: python3 TEST_HGMODULEPOLICY: "rust+c" +test-py3-rust-dirstate-tree: + <<: *runtests + variables: + HGWITHRUSTEXT: cpython + RUNTEST_ARGS: "--rust --blacklist /tmp/check-tests.txt" + PYTHON: python3 + TEST_HGMODULEPOLICY: "rust+c" + HG_RUST_FEATURES: "dirstate-tree" + test-py2-chg: <<: *runtests variables: diff --git a/rust/README.rst b/rust/README.rst --- a/rust/README.rst +++ b/rust/README.rst @@ -34,6 +34,15 @@ One day we may use this environment variable to switch to new experimental binding crates like a hypothetical ``HGWITHRUSTEXT=hpy``. +Special features +================ + +You might want to check the `features` section in ``hg-cpython/Cargo.toml``. +It may contain features that might be interesting to try out. + +To use features from the Makefile, use the `HG_RUST_FEATURES` environment +variable: for instance `HG_RUST_FEATURES="some-feature other-feature"` + Profiling ========= diff --git a/rust/hg-core/Cargo.toml b/rust/hg-core/Cargo.toml --- a/rust/hg-core/Cargo.toml +++ b/rust/hg-core/Cargo.toml @@ -40,3 +40,9 @@ clap = "*" pretty_assertions = "0.6.1" tempfile = "3.1.0" + +[features] +# Use a (still unoptimized) tree for the dirstate instead of the current flat +# dirstate. This is not yet recommended for performance reasons. A future +# version might make it the default, or make it a runtime option. +dirstate-tree = [] diff --git a/rust/hg-core/src/dirstate.rs b/rust/hg-core/src/dirstate.rs --- a/rust/hg-core/src/dirstate.rs +++ b/rust/hg-core/src/dirstate.rs @@ -11,6 +11,7 @@ pub mod dirs_multiset; pub mod dirstate_map; +#[cfg(feature = "dirstate-tree")] pub mod dirstate_tree; pub mod parsers; pub mod status; diff --git a/rust/hg-cpython/Cargo.toml b/rust/hg-cpython/Cargo.toml --- a/rust/hg-cpython/Cargo.toml +++ b/rust/hg-cpython/Cargo.toml @@ -10,6 +10,7 @@ [features] default = ["python27"] +dirstate-tree = ["hg-core/dirstate-tree"] # Features to build an extension module: python27 = ["cpython/python27-sys", "cpython/extension-module-2-7"]