git: correctly handle p1() on dirstate when underlying git repo is empty
This shows up in my next change, which ends up making an empty git
repo and then running hg.
Differential Revision: https://phab.mercurial-scm.org/D8271
rust: clean remains of direct-ffi code
Since
b55bec1ea972, the cext entry poitn have been removed, so we drop the code
for consistency.
run-tests: add option for running with and without Rust extensions
This provide a simple and clear way to run the test with or without rust.
run-tests: rename "pure" variable to setup_opts
There are more useful flag than just `--pure`. We clarify the variable name
before adding more options.
setup-rust: add a --no-rust flag
This new flag will make sure the rust extension will not be build. If neither
`--rust` nor `--no-rust` is specified the `HGWITHRUSTEXT` is used.
cext: drop the WITH_RUST block
These were used by the `direct-ffi` mode that just got dropped.
setup: use printf instead of print
Yuya Nishihara pointed `printf` to me, so I will respect the cargo cult.
git: don't fail import when pygit2 is not install
`test-duplicateoptions.py` was failing on py2 for be because I didn't
have pygit2 installed. It failed because we depend on pygit2 at import
time. This patch makes it so we successfully load the git extension
even if pygit2 doesn't exist -- we just won't be able to use it in
that case.
Differential Revision: https://phab.mercurial-scm.org/D8268
hghave: add a check for pygit2
This will make it easy to use availability of pygit2 as in conditions
such as `#if pygit2` and `(pygit2 !)`. It also makes it a little
clearer why the test case skipped (when that happens).
Differential Revision: https://phab.mercurial-scm.org/D8267