Augie Fackler <augie@google.com> [Wed, 08 Jan 2020 14:37:01 -0500] rev 44069
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
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 07 Dec 2019 13:13:48 -0800] rev 44068
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
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 07 Dec 2019 10:26:28 -0800] rev 44067
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
Georges Racinet <georges.racinet@octobus.net> [Tue, 14 Jan 2020 12:04:12 +0100] rev 44066
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
Rodrigo Damazio Bovendorp <rdamazio@google.com> [Mon, 13 Jan 2020 19:11:44 -0800] rev 44065
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
Rodrigo Damazio Bovendorp <rdamazio@google.com> [Mon, 13 Jan 2020 19:06:36 -0800] rev 44064
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
Matt Harbison <matt_harbison@yahoo.com> [Mon, 13 Jan 2020 17:18:03 -0500] rev 44063
scmutil: fix an unbound variable with progressbar debug enabled
Differential Revision: https://phab.mercurial-scm.org/D7852
Augie Fackler <augie@google.com> [Mon, 13 Jan 2020 14:12:31 -0500] rev 44062
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
Augie Fackler <augie@google.com> [Mon, 13 Jan 2020 17:16:54 -0500] rev 44061
sslutil: migrate to hashutil.sha1 instead of hashlib.sha1
This is a straight-line replacement like the others, but I split it
out since it's used in a network context and I'm not sure this is
appropriate (we should probably drop support for sha1
fingerprints over TLS) and wanted this to be easily dropped.
Differential Revision: https://phab.mercurial-scm.org/D7850
Augie Fackler <augie@google.com> [Mon, 13 Jan 2020 17:15:14 -0500] rev 44060
core: migrate uses of hashlib.sha1 to hashutil.sha1
Differential Revision: https://phab.mercurial-scm.org/D7849
Augie Fackler <augie@google.com> [Mon, 13 Jan 2020 17:14:19 -0500] rev 44059
hashutil: new package for hashing-related features
Right now this just tries to use our sha1dc and if it's missing (eg a
--pure build) we fall back to hashlib. I imagine in the future we'll
want some other things in here for detecting what hasher is in use as
we transition off sha1.
Differential Revision: https://phab.mercurial-scm.org/D7848
Augie Fackler <augie@google.com> [Wed, 08 Jan 2020 15:59:52 -0500] rev 44058
sha1dc: initial implementation of Python extension
A future change will use this when available to avoid sha1 collision
issues until we can get moved to something else.
Differential Revision: https://phab.mercurial-scm.org/D7815
Augie Fackler <augie@google.com> [Wed, 08 Jan 2020 15:09:01 -0500] rev 44057
sha1dc: import latest version from github
After the recent SHA1 news, the attacks are serious enough we should
be more proactive. This code will at least allow detection of attacks
early. It's already widely deployed in Git.
This is git revision
855827c583bc30645ba427885caa40c5b81764d2 of the
sha1collisiondetection repo[0], with most of the files omitted. A
follow-up change will introduce Python bindings for this code.
0: https://github.com/cr-marcstevens/sha1collisiondetection
Differential Revision: https://phab.mercurial-scm.org/D7814
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 11 Jan 2020 05:44:58 +0100] rev 44056
transaction: add a `hasfinalize` method
The method allow code to check if an existing callback exists. It allow them to
skip potentially expensive setup for a callback.
Differential Revision: https://phab.mercurial-scm.org/D7832
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 11 Jan 2020 04:57:29 +0100] rev 44055
changelog: fix the diverted opener to accept more kwargs
The current code prevent the use of `atomictemp` file with the changelog
opener. I do not see a good reason for this limitation.
Differential Revision: https://phab.mercurial-scm.org/D7831