Martin von Zweigbergk <martinvonz@google.com> [Thu, 14 Jan 2021 11:53:55 -0800] rev 46262
error: use detailed exit code 10 for command errors
Command errors (unknown or ambiguous commands, or bad command
arguments or options) are handled in the `dispatch` module. Most other
errors are handled in the `scmutil` module. This patch therefore has
to duplicate a little bit of code from the `scmutil` module. It's just
a few lines, however, so it seems fine to me. It's a pretty common
category of errors, so it's important to have them respect
`ui.detailed-exit-code`.
Differential Revision: https://phab.mercurial-scm.org/D9777
Martin von Zweigbergk <martinvonz@google.com> [Wed, 13 Jan 2021 22:37:21 -0800] rev 46261
errors: raise InputError when non-existent help section requested
Differential Revision: https://phab.mercurial-scm.org/D9776
Augie Fackler <augie@google.com> [Fri, 15 Jan 2021 12:56:25 -0500] rev 46260
revlog: migrate from PyEval_CallObject to PyObject_Call
The former was deprecated in 3.9.0.
Differential Revision: https://phab.mercurial-scm.org/D9791
Augie Fackler <augie@google.com> [Fri, 15 Jan 2021 12:52:52 -0500] rev 46259
fuzz: fix Makefile default PYTHON_CONFIG_FLAGS to be modern
This is actually what we already do on oss-fuzz, so it's more correct as tests
go.
Differential Revision: https://phab.mercurial-scm.org/D9790
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 14 Jan 2021 06:52:36 +0100] rev 46258
tests: wider work around matching in test-narrow-shallow.t
Since
issue6150 is still not fixed, we have to accommodate a larger array of
possible results. Otherwise we get frequent flakiness of local and CI runs.
Differential Revision: https://phab.mercurial-scm.org/D9766
Augie Fackler <augie@google.com> [Wed, 13 Jan 2021 15:44:24 -0500] rev 46257
fuzz: try and ensure fuzzer tests run against the right python-config
Also only under python 3.
Differential Revision: https://phab.mercurial-scm.org/D9752
Raphaël Gomès <rgomes@octobus.net> [Fri, 08 Jan 2021 16:25:18 +0100] rev 46256
contrib: remove testing for `dirstate-tree` Rust feature
This feature will be replaced in a few months, and served more as a
proof-of-concept. Keeping it in CI when no one is using it anymore is just
wasteful.
Differential Revision: https://phab.mercurial-scm.org/D9716
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 13 Jan 2021 17:21:51 +0100] rev 46255
perf: don't turn byte to string when formatting perfbranchmap
I am not sure why this `str` all is there is the first place.
Differential Revision: https://phab.mercurial-scm.org/D9751
Joerg Sonnenberger <joerg@bec.de> [Fri, 18 Dec 2020 14:45:28 +0100] rev 46254
branchmap: avoid ancestor computations in absence of non-continous branches
The branchhead computation is one of the more heavy operations for
bigger repositories as it has to scan all changesets and potentially
involves the expensive computation of the ancestor sets. Redo the
computation to handle the common cases directly and use tighter
conditions for when the ancestor scan is necessary. Most importantly,
avoid it completely if the non-continous branches are processed in one
update as seen in the initial computation after a clone.
For the Mercurial repository, it gives a small 2-3% performance boost.
For the NetBSD test repository, it cuts the time in half.
Differential Revision: https://phab.mercurial-scm.org/D9631
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 12 Jan 2021 19:49:18 +0100] rev 46253
persistent-nodemap: also list related file as part of the store
This make sure they are will be selected during upgrade, and copy based clone.
Differential Revision: https://phab.mercurial-scm.org/D9749
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 13 Jan 2021 12:50:47 +0100] rev 46252
upgrade: explicitly test for revlog index
We do not want to exclude `.d` we want to only include `.i`. We are about to add
more extension type (for the persistent nodemap: `.n`, `.nd`) so lets make the
list explicit instead.
Differential Revision: https://phab.mercurial-scm.org/D9748
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 12 Jan 2021 19:47:34 +0100] rev 46251
persistent-nodemap: highlight that node is not sent when streaming
We have a local work-around, however having that data sent in the first place
would be better. So we start with a test that monitor what is sent, and notice
they are not.
Differential Revision: https://phab.mercurial-scm.org/D9736
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 12 Jan 2021 18:13:55 +0100] rev 46250
persistent-nodemap: test it (does not) exist after a stream clone
This is currently buggy. We add a test before fixing the bug.
Differential Revision: https://phab.mercurial-scm.org/D9734
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 12 Jan 2021 18:19:17 +0100] rev 46249
persistent-nodemap: test it (does not) exist after a local clone
This is currently buggy. We add a test before fixing the bug.
Differential Revision: https://phab.mercurial-scm.org/D9733
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 12 Jan 2021 18:19:01 +0100] rev 46248
persistent-nodemap: test that is it present after a clone
The persistent nodemap is actually missing after local and stream
clone. We start by adding a test for the case that works so that we
can compare output after the fix.
Differential Revision: https://phab.mercurial-scm.org/D9732
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 12 Jan 2021 23:27:24 +0100] rev 46247
narrow: overwrite readfast in excludeddirmanifestctx
The excludeddirmanifestctx does not have underlying storage (because it is
excluded) so the implementation of the `readfast` trying to access it crash.
This was reveled while running some cache warning code on narrow repositories.
That code will be introduced further down in the series.
Differential Revision: https://phab.mercurial-scm.org/D9731
Kyle Lippincott <spectral@google.com> [Mon, 11 Jan 2021 17:46:55 -0800] rev 46246
patch: handle filenames with trailing spaces
I have no idea if this is *actually* supported by the patch file format, but at
least when reading from a patch file created by running `hg shelve`, it is
written out such that there's a trailing space after the second (`b`) filename.
When we read the patch file, we remove the space before parsing the filenames,
so it doesn't end up matching the other sources of what files are in the shelve.
We observed this internally due to a wrapper around unshelve that called into
patch.changedfiles, but `hg patch` is able to reproduce the issue as well, so
I've included both tests.
Differential Revision: https://phab.mercurial-scm.org/D9729
Dan Villiom Podlaski Christiansen <danchr@gmail.com> [Tue, 29 Dec 2020 23:15:26 +0100] rev 46245
rust: fix testing with $TMPDIR ≠ /tmp
Differential Revision: https://phab.mercurial-scm.org/D9670
Dan Villiom Podlaski Christiansen <danchr@gmail.com> [Mon, 11 Jan 2021 15:16:36 +0100] rev 46244
ci: avoid a global before_script definition
This removes the implicit assumption that all jobs are test runs.
Differential Revision: https://phab.mercurial-scm.org/D9723
Dan Villiom Podlaski Christiansen <danchr@gmail.com> [Mon, 21 Dec 2020 15:50:01 +0100] rev 46243
setup: when possible, build and bundle man pages
This makes it so the manual pages are built as part of the Python
build, and includes them in any wheel generated. This should make
Python wheels a much more useful and complete way of distributing
Mercurial binaries.
Differential Revision: https://phab.mercurial-scm.org/D9640
Pulkit Goyal <7895pulkit@gmail.com> [Tue, 08 Dec 2020 16:41:13 +0530] rev 46242
scmutil: improve documentation of writereporequirements()
This makes it easier to understand the difference between `writerequires()`
and `writereporequirements()`.
Differential Revision: https://phab.mercurial-scm.org/D9568
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 20 Nov 2020 08:02:25 +0100] rev 46241
command: automatically create alias for command using '-' in names
As discussed during the "5.6 Sprint" ignoring dash in command name open the way
to using them more. We can now move existing command to more readable (dash
using) names without breaking any compatibility.
Differential Revision: https://phab.mercurial-scm.org/D9515
Joerg Sonnenberger <joerg@bec.de> [Mon, 28 Dec 2020 01:05:09 +0100] rev 46240
worker: POSIX only supports workers from main thread (
issue6460)
The POSIX backend sets signal handlers for SIGINT (maybe avoidable) and
SIGCHLD (necessary for waitpid). Python up to 3.9 only allow this from
the main thread, so disable the worker feature otherwise.
Differential Revision: https://phab.mercurial-scm.org/D9660
Pulkit Goyal <7895pulkit@gmail.com> [Fri, 08 Jan 2021 21:47:31 +0530] rev 46239
sharesafe: introduce config to disallow outdated shares if upgrade fails
After this patch, we have config option to control all aspects of shares
when share source is upgraded or downgraded.
Differential Revision: https://phab.mercurial-scm.org/D9692
Pulkit Goyal <7895pulkit@gmail.com> [Fri, 08 Jan 2021 21:34:16 +0530] rev 46238
sharesafe: make warning about outdated share configurable
If the source repository upgrades to use sharesafe mode, we show a warning in
shares. This patch makes that warning configurable and some might not want their
users see this warning.
Differential Revision: https://phab.mercurial-scm.org/D9691
Pulkit Goyal <7895pulkit@gmail.com> [Fri, 08 Jan 2021 18:07:33 +0530] rev 46237
debuglock: rename flag names to better clarity
`--force-lock` sounds as if we are taking the lock however in reality it's the
opposite.
Differential Revision: https://phab.mercurial-scm.org/D9690
Pulkit Goyal <7895pulkit@gmail.com> [Wed, 06 Jan 2021 18:31:16 +0530] rev 46236
sharesafe: add functionality to automatically downgrade shares
Reasoning is same as previous patch which adds automatic upgrade support.
Downgrade is required as if automatic upgrade is enabled, all shares upgrade and
then source repository downgrades, shares won't work. We need to downgrade them.
Differential Revision: https://phab.mercurial-scm.org/D9680
Pulkit Goyal <7895pulkit@gmail.com> [Wed, 06 Jan 2021 16:18:06 +0530] rev 46235
sharesafe: introduce functionality to automatically upgrade shares
In past few months, we have developed a `share-safe` mode for sharing repository
in which share source requirements and config values are shared with the shares.
To get it rolling, an important task is to get these shares automatically
upgraded. We are focusing on an installation where shares are created by scripts
and test jobs. It will be difficult to manually upgrade these and we need some
functionality to do so automatically.
This patch introduces a config option to deal with it. If all of the following
conditions are met, we upgrade the share repository automatically:
* If the config option is enabled
* Share source repository is share-safe enabled
* Share is not share-safe enabled
* Any command is run in the share
Upgrading the share is pretty easy as it involves only editing the requirements
file.
Differential Revision: https://phab.mercurial-scm.org/D9679
Pulkit Goyal <7895pulkit@gmail.com> [Wed, 06 Jan 2021 16:01:19 +0530] rev 46234
localrepo: move storevfs calculation out of if statement
In next patch, we will need this variable in else statement too. So, let's take
it out.
Differential Revision: https://phab.mercurial-scm.org/D9681
Dan Villiom Podlaski Christiansen <danchr@gmail.com> [Mon, 11 Jan 2021 13:48:13 +0100] rev 46233
setup: don't import distutils prior to checking FORCE_SETUPTOOLS
I've seen warnings about importing distutils before setuptools,
although I can't reproduce them at the moment.
Differential Revision: https://phab.mercurial-scm.org/D9722
Pulkit Goyal <7895pulkit@gmail.com> [Wed, 13 Jan 2021 15:42:15 +0530] rev 46232
largefiles: remove unused imports
This fixes test-check-pyflakes.t
Differential Revision: https://phab.mercurial-scm.org/D9747
Pulkit Goyal <7895pulkit@gmail.com> [Fri, 08 Jan 2021 23:08:39 +0530] rev 46231
upgrade: don't perform anything if nothing to do
Before this patch, upgrade will process everything, re-clone all revlogs, write
requirements file again even there is no change to be made.
This patch makes it exit earlier.
Differential Revision: https://phab.mercurial-scm.org/D9695
Pulkit Goyal <7895pulkit@gmail.com> [Fri, 08 Jan 2021 23:06:38 +0530] rev 46230
downgrade: if a compression is removed, consider that too
For compression format variant, the result of `fromrepo()` and `fromconfig()` is
not a boolean and we have to actually equate those to find change.
Differential Revision: https://phab.mercurial-scm.org/D9693
Pulkit Goyal <7895pulkit@gmail.com> [Thu, 31 Dec 2020 14:28:00 +0530] rev 46229
engine: prevent a function call for each store file
Python function calls are not cheap. Instead of calling the function once for
each file in store, we use a dedicated function which filters and yields the
required files.
Differential Revision: https://phab.mercurial-scm.org/D9673
Simon Sapin <simon.sapin@octobus.net> [Tue, 12 Jan 2021 18:36:22 +0100] rev 46228
rhg: use a release-mode executable in tests
This allows the rhg build for test-rhg.t to share compiled dependencies
such as hg-core with the hg-cpython build for other tests.
For context, my wrapper script for the typical edit-compile-test
cycle now looks like this:
(cd rust && cargo +nightly-2020-10-04 fmt)
(cd rust && cargo build --release -p rhg)
make --silent local PURE=--rust
python test/run-tests.py --local "$@"
Differential Revision: https://phab.mercurial-scm.org/D9728
Dan Villiom Podlaski Christiansen <danchr@gmail.com> [Wed, 30 Dec 2020 00:14:28 +0100] rev 46227
rust: fix file folding map
The file folding map, frequently used on macOS, had two issues:
* the means for converting it to Python didn't work
* a minor typo when copying the python code, where `!=` became `==`
With this, the rust code passes all tests on macOS.
Test Plan:
I'm currently doing a full test run on a case-insensitive file system. If it passes, perhaps we can change the platform check from an error to a warning?
Differential Revision: https://phab.mercurial-scm.org/D9671
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 12 Jan 2021 22:43:55 +0100] rev 46226
test: replace a many occurence of `python` with `$PYTHON`
Otherwise this can use the wrong python version, or worse, not find any python
at all.
Differential Revision: https://phab.mercurial-scm.org/D9730
Martin von Zweigbergk <martinvonz@google.com> [Tue, 12 Jan 2021 17:32:08 -0800] rev 46225
tests: make test-subrepo-git.t compatible with git's master->main rename
Git is about to change the default branch from "master" to
"main". Recent versions has started warning about that, which makes
tests fail. I assume the tests would fail in a different way once the
default has changed. To make us compatible with that name change,
let's set configure the default to be "master". That value makes the
tests still work on older Git version (those where the default branch
name is not configurable).
Differential Revision: https://phab.mercurial-scm.org/D9746
Jun Wu <quark@fb.com> [Tue, 12 Jan 2021 14:45:32 -0800] rev 46224
revlog: use size_t for nodetree capacity
This allows handling revlog containing more than
33554432 (INT_MAX /
sizeof(nodetreenode)) revisions on x64 platforms.
Differential Revision: https://phab.mercurial-scm.org/D9745
Pulkit Goyal <7895pulkit@gmail.com> [Fri, 08 Jan 2021 22:38:33 +0530] rev 46223
upgrade: demonstrate that a no-op upgrade still performs everything
An upgrade operation which is not adding or removing anything should ideally
error out. However, it does the whole cloning and everything. Next patch will
fix it.
Differential Revision: https://phab.mercurial-scm.org/D9694
Pulkit Goyal <7895pulkit@gmail.com> [Thu, 31 Dec 2020 19:42:10 +0530] rev 46222
upgrade: migrated -> upgraded in ui messages
Differential Revision: https://phab.mercurial-scm.org/D9676
Pulkit Goyal <7895pulkit@gmail.com> [Thu, 31 Dec 2020 19:24:23 +0530] rev 46221
upgrade: remove unnecessary `is None` check
`upgrade_engine.upgrade()` always return the `backuppath` value and there are
not early returns. Hence I don't see how `backuppath` can be None.
Adding extra unncessary safe checks hides unknown bugs. Hence removing it.
Differential Revision: https://phab.mercurial-scm.org/D9675
Pulkit Goyal <7895pulkit@gmail.com> [Thu, 31 Dec 2020 14:45:16 +0530] rev 46220
engine: refactor code to replace stores in separate function
In not all upgrades, we need to change the whole store. For example, when
upgrading repository to share-safe mode, we don't touch revlogs at all hence
store cloning and copying is not required.
The store replacing code needs to be made aware about what all has changed and
hence only copy/rename those things. To kickstart that, this patch moves
existing logic into a separate function.
Differential Revision: https://phab.mercurial-scm.org/D9674
Pulkit Goyal <7895pulkit@gmail.com> [Thu, 31 Dec 2020 14:10:25 +0530] rev 46219
engine: make hook point for extension a public function
Well there are no private public functions in Python, but we generally treat
functions and variables starting with `_` as private ones.
A function which needs to be overrided in extension should be a public one.
Differential Revision: https://phab.mercurial-scm.org/D9672
Pulkit Goyal <7895pulkit@gmail.com> [Wed, 30 Dec 2020 16:39:35 +0530] rev 46218
engine: prevent multiple checking of re-delta-multibase
The _perform_clone function is called for each revlog cloned, hence we should
prevent this function call overhead.
Differential Revision: https://phab.mercurial-scm.org/D9669
Pulkit Goyal <7895pulkit@gmail.com> [Wed, 30 Dec 2020 16:33:49 +0530] rev 46217
engine: pass upgrade operation inside `_perform_clone()`
Same as previous patch.
Differential Revision: https://phab.mercurial-scm.org/D9668
Pulkit Goyal <7895pulkit@gmail.com> [Wed, 30 Dec 2020 16:29:33 +0530] rev 46216
engine: pass upgrade operation inside _clonerevlogs()
Better to pass the operation instead of passing three of it's members (one of
the them is a function call) separately.
This will also be useful in future when we will like to control which things are
upgraded.
Differential Revision: https://phab.mercurial-scm.org/D9667
Pulkit Goyal <7895pulkit@gmail.com> [Wed, 30 Dec 2020 16:20:25 +0530] rev 46215
actions: store deltareuse mode of whole operation in UpgradeOperation
UpgradeOperation should provide easy access to all the things related to the
current operation. Clients should not need to compute them.
Differential Revision: https://phab.mercurial-scm.org/D9666
Pulkit Goyal <7895pulkit@gmail.com> [Wed, 30 Dec 2020 16:11:24 +0530] rev 46214
engine: refactor how total dstsize is calculated
Instead of increasing it with each revlog, we just get the sum of total
destination changelog, manifest and filelogs sizes.
Differential Revision: https://phab.mercurial-scm.org/D9665
Pulkit Goyal <7895pulkit@gmail.com> [Wed, 16 Dec 2020 14:00:41 +0530] rev 46213
upgrade: introduce post upgrade and downgrade message for improvements
For certain imporvements, we will like to show a message after the operation
completed. This patch introduces that functionality.
Right now it's only used by share-safe feature.
Differential Revision: https://phab.mercurial-scm.org/D9619
Pulkit Goyal <7895pulkit@gmail.com> [Wed, 16 Dec 2020 15:04:17 +0530] rev 46212
actions: introduce function to calculate downgrades
An upgrade operation can also downgrade/remove some format variants. Before this
patch there was no clean way to find out all such variants which will be
removed. This patch adds a function for that.
It will be used in next patch.
Differential Revision: https://phab.mercurial-scm.org/D9618
Pulkit Goyal <7895pulkit@gmail.com> [Wed, 16 Dec 2020 14:55:27 +0530] rev 46211
debugupgraderepo: minor documentation fix
When we specify `--no-changelog --no-manifest --no-filelog` we skip all revlog
optimization instead of all filelog optimization.
Also while I was here, for consistency, I did `optimisation` -> `optimization`
to make it consistent with rest of occurrences.
Note: I am not native speaker and I only changed it because of consistency. I
don't know which one is correct.
Differential Revision: https://phab.mercurial-scm.org/D9617
Pulkit Goyal <7895pulkit@gmail.com> [Wed, 16 Dec 2020 14:16:10 +0530] rev 46210
upgrade: rename actions to upgrade_actions
The `actions` were a list of optimizations and format upgrades which will be
upgraded. This does not include things which will be downgraded.
Let's rename the variable for clarity. It now makes obvious that we don't have
any concrete information on what things are downgraded.
Differential Revision: https://phab.mercurial-scm.org/D9616
Pulkit Goyal <7895pulkit@gmail.com> [Wed, 16 Dec 2020 14:06:24 +0530] rev 46209
upgrade: move optimization addition to determineactions()
The documentation of `determineactions()` mention that it is given a list
returned from `findoptimizations()` however it was not true before this patch.
The code extending actions with optimizations also mentioned about it that this
should be in determineactions.
So let's do what comments at couple of places say.
Differential Revision: https://phab.mercurial-scm.org/D9615
Pulkit Goyal <7895pulkit@gmail.com> [Wed, 16 Dec 2020 12:39:15 +0530] rev 46208
upgrade: drop support for old style optimization names
Old style optimization names like `redeltaparent` were converted into
`re-delta-parent` more than two years ago. The old names were kept around for
sometime because of BC reasons.
Refer
5608b5a6c3231c4ec771171cc3079142c7672be6. The commit states the map is
there for a while and we can drop them as the underlying command is a debug
command.
Differential Revision: https://phab.mercurial-scm.org/D9614
Pulkit Goyal <7895pulkit@gmail.com> [Mon, 14 Dec 2020 16:15:01 +0530] rev 46207
upgrade: add a missing space in status message
Found while reading the code to refactor.
Differential Revision: https://phab.mercurial-scm.org/D9583
Pulkit Goyal <7895pulkit@gmail.com> [Wed, 30 Dec 2020 14:56:34 +0530] rev 46206
actions: rename DEFICIENCY constant to FORMAT_VARIANT
It was not obvious what does deficieny means and every format change can't be a
deficiency. There are some format changes like compression levels, share-safe
which can't be understood at deficiencies.
This patch renames the constant to make things clearer.
Differential Revision: https://phab.mercurial-scm.org/D9664
Pulkit Goyal <7895pulkit@gmail.com> [Mon, 14 Dec 2020 16:03:15 +0530] rev 46205
upgrade: rename finddeficiences() to find_format_upgrades()
It was not obvious what does deficieny means and every format upgrade can't be a
deficiency. There are some format upgrades like compression levels, share-safe
which can't be understood at deficiencies.
A change can be an upgrade or downgrade, however this `finddeficiences()` only
used to find upgrades.
This patch renames the function and related variables to make things more
clearer. The ui message also got improved which is a good thing.
Next patch will rename deficiency in general across the upgrade code.
Differential Revision: https://phab.mercurial-scm.org/D9582
msuozzo@google.com [Sat, 02 Jan 2021 01:48:12 -0500] rev 46204
beautifygraph: change the current commit symbol
The existing "circle with vertical fill" character renders as full width in
many terminals making the beautified symbols have uneven size. Additionally,
the proposed "fisheye" character is the logic 'active' version of the current
merge symbol, "bullseye."
Differential Revision: https://phab.mercurial-scm.org/D9678
Augie Fackler <augie@google.com> [Mon, 11 Jan 2021 14:10:31 -0500] rev 46203
merge with stable