lfs: add a switch to `hg verify` to ignore the content of blobs
Trying to validate the fulltext of an external revision causes missing blobs to
be downloaded and cached. Since the downloads aren't batch prefetched[1] and
aren't compressed, this can be expensive both in terms of time and space.
I made this a tri-state instead of a simple bool because there's an existing
(undocumented) config to handle this, and it would be weird if `hg verify` were
to suddenly start ignoring that config but an `hg recover` initiated verify
honors it. Since this uses the same config setting, it too will skip
rename verification (which requires fulltext, but not for LFS).
[1] https://www.mercurial-scm.org/pipermail/mercurial-devel/2018-April/116118.html
Differential Revision: https://phab.mercurial-scm.org/D7708
revlog: run rustfmt nightly
I'm a little nervous about folding this back (might be nightly rustfmt
mismatches?) so I want someone to review this.
Differential Revision: https://phab.mercurial-scm.org/D7813
examples: specify rustfmt nightly using a $() construct
This is ugly, but it's how we have to configure rustfmt for now as we
require nightly rustfmt.
Differential Revision: https://phab.mercurial-scm.org/D7812
hg-core: rustfmt path.rs
The file as vendored does not conform to our source formatting
conventions. Let's reformat it so it does.
# skip-blame automated code reformatting
Differential Revision: https://phab.mercurial-scm.org/D7580
hg-core: vendor Facebook's path utils module
The added file was imported from
https://github.com/facebookexperimental/eden/blob/
d1d8fb939a39aa331ae7f162c39cbcaa511d474b/eden/scm/lib/util/src/path.rs
without modifications. The file is not yet integrated into our project. This
will be done in subsequent commits.
Differential Revision: https://phab.mercurial-scm.org/D7573
revlog-native: introduced ABI version in capsule
Concerns that an inconsistency could arise between the actual contents
of the capsule in revlog.c and the Rust consumer have been raised after
the switch to the array of data and function pointers in
f384d68d8ea8.
It has been suggested that the `version` from parsers.c could be use for
this. In this change, we introduce instead a separate ABI version number,
which should have the following advantages:
- no need to change the consuming Rust code for changes that have nothing
to do with the contents of the capsule
- the version number in parsers.c is not explicitely flagged as ABI. It's
not obvious to me whether an ABI change that would be invisible to Python
would warrant an increment
The drawback is that developers now have to consider two version numbers.
We expect the added cost of the check to be negligible because it occurs
at instantiation of `CIndex` only, which in turn is tied to instantiation
of Python objects such as `LazyAncestors` and `MixedIndex`. Frequent calls
to `Cindex::new` should also probably hit the CPU branch predictor.
Differential Revision: https://phab.mercurial-scm.org/D7856
phases: make phasecache._phasesets immutable
Previously, some code paths would mutate the cache itself, which
could give weird results if multiple revsets got evaluated through
that path.
Differential Revision: https://phab.mercurial-scm.org/D7854
phases: reduce code duplication in phasecache.getrevset
This is a functional NOP other than reducing some of the duplication
in that method.
Differential Revision: https://phab.mercurial-scm.org/D7853
scmutil: fix an unbound variable with progressbar debug enabled
Differential Revision: https://phab.mercurial-scm.org/D7852
hgext: replace references to hashlib.sha1 with hashutil.sha1
When in a non-pure build of Mercurial, this will provide protections
against SHA1 collision attacks.
Differential Revision: https://phab.mercurial-scm.org/D7851