[Updated] D9132: rust: introduce `dirstate-tree` cargo feature
Alphare (Raphaël Gomès)
phabricator at mercurial-scm.org
Thu Oct 1 04:58:23 UTC 2020
Closed by commit rHGe604a3c03ab9: rust: introduce `dirstate-tree` cargo feature (authored by Alphare).
This revision was automatically updated to reflect the committed changes.
This revision was not accepted when it landed; it landed in state "Needs Review".
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST UPDATE
https://phab.mercurial-scm.org/D9132?vs=22954&id=22962
CHANGES SINCE LAST ACTION
https://phab.mercurial-scm.org/D9132/new/
REVISION DETAIL
https://phab.mercurial-scm.org/D9132
AFFECTED FILES
Makefile
contrib/heptapod-ci.yml
rust/README.rst
rust/hg-core/Cargo.toml
rust/hg-core/src/dirstate.rs
rust/hg-cpython/Cargo.toml
CHANGE DETAILS
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"]
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-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/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/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/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
To: Alphare, #hg-reviewers
Cc: mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mercurial-scm.org/pipermail/mercurial-patches/attachments/20201001/27b5ffb5/attachment-0001.html>
More information about the Mercurial-patches
mailing list