Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 29 Jan 2021 14:03:01 +0100] rev 46423
config: use the right API to access subrepository section
Preventing direct access to the underlying dict will help a coming refactoring
of `config`.
Differential Revision: https://phab.mercurial-scm.org/D9921
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 29 Jan 2021 13:03:50 +0100] rev 46422
config: test priority involving the command line
Differential Revision: https://phab.mercurial-scm.org/D9917
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 29 Jan 2021 11:50:33 +0100] rev 46421
config: test priority involving include
Differential Revision: https://phab.mercurial-scm.org/D9916
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 29 Jan 2021 11:42:27 +0100] rev 46420
config: add a test for priority when includes are involved
Differential Revision: https://phab.mercurial-scm.org/D9915
Martin von Zweigbergk <martinvonz@google.com> [Fri, 29 Jan 2021 16:26:53 -0800] rev 46419
errors: use InputError for incorrectly formatted dates
Differential Revision: https://phab.mercurial-scm.org/D9913
Martin von Zweigbergk <martinvonz@google.com> [Fri, 29 Jan 2021 15:56:08 -0800] rev 46418
errors: use StateError more in merge module
Differential Revision: https://phab.mercurial-scm.org/D9912
Martin von Zweigbergk <martinvonz@google.com> [Fri, 29 Jan 2021 12:16:55 -0800] rev 46417
errors: use exit code 40 for when a hook fails
A hook can be used for checking inputs, state, configuration,
security, etc., so it's unclear which of the existing exit codes to
use. Let's instead add one specifically for failed hooks. I picked 40.
Differential Revision: https://phab.mercurial-scm.org/D9910
Augie Fackler <augie@google.com> [Fri, 29 Jan 2021 12:50:10 -0500] rev 46416
context: add missing manifest invalidation after write in overlayworkingctx
This was breaking my merge-diff logic that will be in the next patch.
Differential Revision: https://phab.mercurial-scm.org/D9908
Kyle Lippincott <spectral@google.com> [Wed, 27 Jan 2021 10:29:21 -0800] rev 46415
wix: tell ComponentSearch that it is finding a directory (not a file)
This is to fix an issue we've noticed where fresh installations start at
`C:\Program Files\Mercurial`, and then upgrades "walk up" the tree and end up in
`C:\Program Files` and finally `C:\` (where they stay).
ComponentSearch defaults to finding files, which I think means "it produces a
string like `C:\Program Files\Mercurial`", whereas with the type being
explicitly a directory, it would return `C:\Program Files\Mercurial\` (note the
final trailing backslash). Presumably, a latter step then tries to turn that
file name into a proper directory, by removing everything after the last `\`.
This could likely also be fixed by actually searching for the component for
hg.exe itself. That seemed a lot more complicated, as the GUID for hg.exe isn't
known in this file (it's one of the "auto-derived" ones). We could also consider
adding a Condition that I think could check the Property and ensure it's either
empty or ends in a trailing slash, but that would be an installer runtime check
and I'm not convinced it'd actually be useful.
This will *not* cause existing installations that are in one of the bad
directories to fix themselves. Doing that would require a fair amount more
understanding of wix and windows installer than I have, and it *probably*
wouldn't be possible to be 100% correct about it either (there's nothing
preventing a user from intentionally installing it in C:\, though I don't know
why they would do so).
If someone wants to tackle fixing existing installations, I think that the first
installation is actually the only one that shows up in "Add or Remove Programs",
and that its registry keys still exist. You might be able to find something
under HKEY_USERS that lists both the "good" and the "bad" InstallDirs. Mine was
under `HKEY_USERS\S-1-5-18\Software\Mercurial\InstallDir` (C:\), and
`HKEY_USERS\S-1-5-21-..numbers..\Software\Mercurial\InstallDir` (C:\Program
Files\Mercurial). If you find exactly two, with one being the default path, and
the other being a prefix of it, the user almost certainly hit this bug :D
We had originally thought that this bug might be due to unattended
installations/upgrades, but I no longer think that's the case. We were able to
reproduce the issue by uninstalling all copies of Mercurial I could find,
installing one version (it chose the correct location), and then starting the
installer for a different version (higher or lower didn't matter). I did not
need to deal with an unattended or headless installation/upgrade to trigger the
issue, but it's possible that my system was "primed" for this bug to happen
because of a previous unattended installation/upgrade.
Differential Revision: https://phab.mercurial-scm.org/D9891
Pulkit Goyal <7895pulkit@gmail.com> [Fri, 29 Jan 2021 17:32:09 +0530] rev 46414
merge with stable
Matt Harbison <matt_harbison@yahoo.com> [Wed, 27 Jan 2021 00:54:57 -0500] rev 46413
copyright: update to 2021
Differential Revision: https://phab.mercurial-scm.org/D9885
Simon Sapin <simon.sapin@octobus.net> [Thu, 28 Jan 2021 13:15:34 +0100] rev 46412
persistent-nodemap: Fix Rust declarations for Revlog_CAPI signatures
Use Rust’s `libc::ssize_t` as the closest match to C’s `Py_ssize_t`.
See details in test comment.
Going forward we should find a way to have such Rust declarations
auto-generated from C headers at build time,
or auto-checked against them in a test.
Differential Revision: https://phab.mercurial-scm.org/D9901
Simon Sapin <simon.sapin@octobus.net> [Thu, 28 Jan 2021 13:25:37 +0100] rev 46411
persistent-nodemap: add test case reproducing a Rust panic
Thanks to Mitchell Plamann for reporting this bug.
The next commit fixes it.
Differential Revision: https://phab.mercurial-scm.org/D9900
Martin von Zweigbergk <martinvonz@google.com> [Thu, 28 Jan 2021 00:14:15 -0800] rev 46410
copies: fix an incorrect comment in graftcopies() from recent D9802
I don't think the bit about creating a merge in the filelog was
correct. Or at least I couldn't find a case where it happened.
Differential Revision: https://phab.mercurial-scm.org/D9899
Martin von Zweigbergk <martinvonz@google.com> [Wed, 27 Jan 2021 22:10:57 -0800] rev 46409
narrow: delete a stale TODO about not sending groups the client already has
2c5835b4246b changed the changegroup generation to not send
treemanifests for directories the client had before widening. As that
commit mentions, we had already stopped before that commit to send the
changelog and filelogs for files the client already had.
Differential Revision: https://phab.mercurial-scm.org/D9898
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 16 Jan 2021 00:03:18 +0100] rev 46408
copies: add an devel option to trace all files
Filelog based copy tracing only trace copy for file that have been added. This
is a trade off between skipping some rare copy case in exchange for avoiding
atrocious-to-the-point-of-unusable performance.
The changeset centric copy tracing does not need this trade off and naturally
trace all copy, include the one involving non-new files.
In order to ease the comparison from both algorithm, we add a small devel option
to trace copy for all files in the target revisions.
Differential Revision: https://phab.mercurial-scm.org/D9796
Raphaël Gomès <rgomes@octobus.net> [Thu, 28 Jan 2021 15:26:33 +0100] rev 46407
revlog: prepare pure parser for being overloaded
The current class uses module-level variables which don't allow for reusing the
current logic for a slightly different revlog version.
Differential Revision: https://phab.mercurial-scm.org/D9903
Raphaël Gomès <rgomes@octobus.net> [Thu, 28 Jan 2021 15:12:48 +0100] rev 46406
revlog: use a less probable revlog version for backwards compatibility
This allows us to define a usable v2.
Differential Revision: https://phab.mercurial-scm.org/D9902
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 27 Jan 2021 15:06:02 +0100] rev 46405
clang-format: show required version in skip message
This will help people to configure their black
Differential Revision: https://phab.mercurial-scm.org/D9890
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 27 Jan 2021 15:04:48 +0100] rev 46404
heptapod-ci: indicate which version of clang-format is used for the run
This will help understand possible mismatch
Differential Revision: https://phab.mercurial-scm.org/D9889
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 27 Jan 2021 14:58:24 +0100] rev 46403
black: show required version in skip message
This will help people to configure their black
Differential Revision: https://phab.mercurial-scm.org/D9888
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 27 Jan 2021 14:57:20 +0100] rev 46402
heptapod-ci: indicate which version of black is used for the run
This will help understand possible mismatch
Differential Revision: https://phab.mercurial-scm.org/D9887
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 27 Jan 2021 15:53:32 +0100] rev 46401
heptapod-ci: add a default value for HG_CI_IMAGE_TAG
Differential Revision: https://phab.mercurial-scm.org/D9886
Nikita Slyusarev <nslus@yandex-team.com> [Tue, 12 Jan 2021 00:11:16 +0300] rev 46400
convert: option to set date and time for svn commits
Converting to subversion repository is not preserving original commit dates as
it may break some subversion functionality if commit dates are not monotonically
increasing.
This patch adds `convert.svn.dangerous-set-commit-dates` configuration option
to change this behaviour and enable commit dates convertion for those who want
to take risks.
Subversion always uses commit dates with UTC timezone, so only timestamps
are used.
Test `test-convert-svn-sink.t` uses `svnxml.py` script to dump history of svn
repositories. Atm the script is not printing `date` field from svn log. This
patch changes this to allow checks on correctness of date and time convertion.
Documentation is updated. Additional test case is added to test commit dates
convertion.
Differential Revision: https://phab.mercurial-scm.org/D9721
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 15 Jan 2021 23:58:41 +0100] rev 46399
copies: simplify the conditional for _filter's case 3
The conditional is much simpler and the test are actually happier. This
clarification of the conditional will also be necessary to properly support tracing
more renames in a coming changeset.
Differential Revision: https://phab.mercurial-scm.org/D9795
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 15 Jan 2021 23:49:51 +0100] rev 46398
copies: clarify which case some conditional are handling
This make the function a bit clearer. The middle conditional get no label
because we about about to remove it. See next changeset for details.
Differential Revision: https://phab.mercurial-scm.org/D9794
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 16 Jan 2021 02:18:55 +0100] rev 46397
copies: explicitly filter out existing file in graftcopies
The `graftcopies` function does something very strange (maybe even wrong), it
calls `_filter` with a pair of changeset that does not match the one used to
compute the copies informations.
We are about to do some rework of `_filter` to make it closer to its documented
intent and fix a couple of bug. This means some of the logic that only make
sense for graft need to go somewhere else. We add the extra filtering with
proper documentation to `graftcopies`.
Differential Revision: https://phab.mercurial-scm.org/D9802
Augie Fackler <augie@google.com> [Fri, 22 Jan 2021 15:43:06 -0500] rev 46396
histedit: rip out mysterious catch-all ignore curses.error handler
I have no idea why this was here, and ripping it out doesn't obviously
break anything for me (tests all pass, I can poke around chistedit UI
a bit without issue), so I'm thinking we should rip it out and see if
we get bug reports.
Differential Revision: https://phab.mercurial-scm.org/D9855
Augie Fackler <augie@google.com> [Fri, 22 Jan 2021 15:32:00 -0500] rev 46395
histedit: notice when the main window underflows height and abort
If you try to have a 13-line-tall terminal and use curses histedit, it
fails by spinning in an infinite loop due to the catch-all ignore of
curses errors on line 1682 of histedit.py. We should also fix that
catch-all ignore of curses errors (what other demons lurk here, I
wonder?) but we can trivially catch this case and guide the user to a
happy path. We've seen this mostly in IDE users that have a tendency
to have really tiny embedded terminal windows.
Differential Revision: https://phab.mercurial-scm.org/D9854
Augie Fackler <augie@google.com> [Fri, 22 Jan 2021 15:29:12 -0500] rev 46394
histedit: don't assign to _ for unused values
I don't know what this ignored value is, but we need to not clobber
the _() function from gettext, or we get mysterious crashes instead of
internationalizing some strings in my upcoming patches.
Differential Revision: https://phab.mercurial-scm.org/D9853
Matt Harbison <matt_harbison@yahoo.com> [Tue, 26 Jan 2021 17:25:30 -0500] rev 46393
hghave: list the module needed for the `vcr` check
I'm tired of having to look up modules each time I setup a system, and try to
distinguish between similar package names to get the right one. Now that the
search API has been disabled, it's even harder. There are other python packages
here that should be listed like this, but this is the one that came up missing
today, so it's a start.
Differential Revision: https://phab.mercurial-scm.org/D9879
Joerg Sonnenberger <joerg@bec.de> [Tue, 26 Jan 2021 00:19:36 +0100] rev 46392
debugshell: add a simple command for starting an interactive shell
This simplifies interactive exploration of the Mercurial APIs.
The ui and repo instances are provided as local variables.
Differential Revision: https://phab.mercurial-scm.org/D9866
Simon Sapin <simon.sapin@octobus.net> [Mon, 25 Jan 2021 11:34:23 +0100] rev 46391
rust: replace an unsafe use of transmute with a safe use of bytes-cast
Differential Revision: https://phab.mercurial-scm.org/D9859
Simon Sapin <simon.sapin@octobus.net> [Fri, 15 Jan 2021 16:11:54 +0100] rev 46390
rust: use the bytes-cast crate to parse persistent nodemaps
This crate casts pointers to custom structs, with compile-time safety checks,
for easy and efficient binary data parsing.
See https://crates.io/crates/bytes-cast and
https://docs.rs/bytes-cast/0.1.0/bytes_cast/
Differential Revision: https://phab.mercurial-scm.org/D9788
Matt Harbison <matt_harbison@yahoo.com> [Mon, 25 Jan 2021 19:03:27 -0500] rev 46389
cext: restore the ability to build on Windows with py2
This broke in
e92ca942ddca.
Differential Revision: https://phab.mercurial-scm.org/D9867
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 25 Jan 2021 16:46:51 +0100] rev 46388
command-namespace: use `::` are the command separator
This was discussed on the mailing list / phab and `::` got a couple of positive
feedback.
I dediced to not introduce automatic folding of `::`, I feel like it make sense
for `-`, but I like the expliciteness of `::`.
So I am adding alias for backward compatibility.
Differential Revision: https://phab.mercurial-scm.org/D9872
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 25 Jan 2021 23:13:01 +0100] rev 46387
perf: test the formatting of a command help
Since we are about to addd ':' in command name I want this covered.
Differential Revision: https://phab.mercurial-scm.org/D9871
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 25 Jan 2021 23:08:33 +0100] rev 46386
help: escape ':' (as '\:') when generating command names
We need this before we can use ":" in command names.
Differential Revision: https://phab.mercurial-scm.org/D9870
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 25 Jan 2021 23:07:56 +0100] rev 46385
minirst: respect escaping in definition list key
If we start adding `:` in command names… we need minirst to not choke on them.
Differential Revision: https://phab.mercurial-scm.org/D9869
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 26 Jan 2021 00:45:40 +0100] rev 46384
run-test: avoid byte issue when replacing output file of python test
Otherwise we get error like::
FileNotFoundError: [Errno 2] No such file or directory: "b'…/tests/test-minirst.py'.out"
Differential Revision: https://phab.mercurial-scm.org/D9868
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 25 Jan 2021 16:34:43 +0100] rev 46383
store: use `endswith` to detect revlog extension
Suggested by Gregory Szorc.
Differential Revision: https://phab.mercurial-scm.org/D9865
Augie Fackler <augie@google.com> [Tue, 01 Dec 2020 12:59:33 -0500] rev 46382
black: merge config into main pyproject.toml now that we have it
This means that naive contributors who just run `black` on a source file
will get reasonable behavior as long as they have a recent black. Yay!
Differential Revision: https://phab.mercurial-scm.org/D9834
Augie Fackler <augie@google.com> [Tue, 01 Dec 2020 12:52:04 -0500] rev 46381
pyproject: add config file
This will tell pip et al to call our setup.py for the majority of
packaging concerns, but also gives us a place to put standard config
stuff like black.
Differential Revision: https://phab.mercurial-scm.org/D9833
Pulkit Goyal <7895pulkit@gmail.com> [Thu, 14 Jan 2021 16:37:10 +0530] rev 46380
upgrade: update only requirements if we can
Upgrade operations which involves just upgrading requirements earlier used to go
through whole revlog cloning business.
Now we just upgrade the requirement and skip the cloning part.
Differential Revision: https://phab.mercurial-scm.org/D9775
Pulkit Goyal <7895pulkit@gmail.com> [Thu, 14 Jan 2021 16:34:58 +0530] rev 46379
engine: add `if True` to prepare for next patch
This will help making next patch easier to read.
Differential Revision: https://phab.mercurial-scm.org/D9774
Pulkit Goyal <7895pulkit@gmail.com> [Thu, 14 Jan 2021 17:27:54 +0530] rev 46378
test: unquiet few tests to demonstrate changes in upcoming patches
Upcoming patches will skip revlog cloning for share-safe upgrades.
Differential Revision: https://phab.mercurial-scm.org/D9773
Pulkit Goyal <7895pulkit@gmail.com> [Thu, 14 Jan 2021 16:57:11 +0530] rev 46377
upgrade: mark sharesafe improvement as only touching requirements
Upgrading the repository to use share safe functionality only touches
requirements.
Differential Revision: https://phab.mercurial-scm.org/D9772
Pulkit Goyal <7895pulkit@gmail.com> [Mon, 14 Dec 2020 16:20:00 +0530] rev 46376
actions: calculate what all parts does the operation touches
To make upgrade work less in certain situations, we need to teach it to find out
what all parts of repository current operation is touching.
This patch starts doing that. In next patch we will be setting values in
improvement objects. For now, we assume everything touches everything.
Differential Revision: https://phab.mercurial-scm.org/D9771
Pulkit Goyal <7895pulkit@gmail.com> [Thu, 14 Jan 2021 16:25:40 +0530] rev 46375
upgrade: don't create store backup if `--no-backup` is passed
If the user explicitly mentioned that they don't need backup, then let's not
create it.
Differential Revision: https://phab.mercurial-scm.org/D9770
Victor Stinner <vstinner@python.org> [Mon, 14 Dec 2020 10:44:29 +0100] rev 46374
cext: add Python 3.10 support
* Replace "Py_TYPE(obj) = type;" with "Py_SET_TYPE(obj, type);"
* Add pythoncapi_compat.h header file to get Py_SET_TYPE() on Python
2.7-3.8. Header file added to mercurial/ and
contrib/python-zstandard/zstd/common/.
In Python 3.10, Py_TYPE(obj) must not longer be used as an l-value.
pythoncapi_compat.h comes from:
https://github.com/pythoncapi/pythoncapi_compat
Differential Revision: https://phab.mercurial-scm.org/D9825
Joerg Sonnenberger <joerg@bec.de> [Wed, 20 Jan 2021 14:47:13 +0100] rev 46373
revlog: decouple caching from addrevision callback for addgroup
For changesets, it is useful to cache the content as it will almost
always be processed afterwards. For manifests on the other hand, the
content is often not used directly as there is a fast path for deltas.
Explicitly disable the cache in exchangev2's manifest handling for that
reason.
Differential Revision: https://phab.mercurial-scm.org/D9847
Joerg Sonnenberger <joerg@bec.de> [Fri, 15 Jan 2021 01:58:59 +0100] rev 46372
branchmap: update rev-branch-cache incrementally
Historically, the revision to branch mapping cache was updated on demand
and shared via bundle2 to avoid the cost of rebuilding on first use.
Use the new `register_changeset` callback and update rbc directly on
every change. Make the transfer of the bundle part redundant, but keep
it for the moment to avoid the test churn.
Over all, "hg unbundle" for large bundles is less than 1.8% slower for
different larger repositories and that seems to a reasonable trade off.
Differential Revision: https://phab.mercurial-scm.org/D9781
Joerg Sonnenberger <joerg@bec.de> [Tue, 19 Jan 2021 00:20:53 +0100] rev 46371
repository: introduce register_changeset callback
The new callback is called whenever a changeset is added to the repository
(commit, unbundle or exchange). Since the bulk operations already parse
the changeset (readfiles or full changesetrevision), always use the
latter to avoid redundant lookups. The first consumer of the new
interface needs to look at extra.
Differential Revision: https://phab.mercurial-scm.org/D9780
Joerg Sonnenberger <joerg@bec.de> [Fri, 15 Jan 2021 01:30:08 +0100] rev 46370
changelog: move branchinfo to changelogrevision
The function parses the extra dictionary after looking up the
changelogrevision. To avoid duplicated look up, it is better to provide
it as property of changelogrevision instead. Keep the function for a
release cycle as at least the topic extension depends on it.
Differential Revision: https://phab.mercurial-scm.org/D9779
Dan Villiom Podlaski Christiansen <danchr@gmail.com> [Fri, 22 Jan 2021 11:10:39 +0100] rev 46369
rust: lower compile error on non-linux platforms to a warning
As discussed on D9671#146704 this lowers the error to a warning.
Differential Revision: https://phab.mercurial-scm.org/D9852
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com> [Mon, 18 Jan 2021 10:24:20 +0100] rev 46368
purge: move extension into core mercurial
The motivation is simple: it's nicer to avoid gating basic
functionality.
To reduce the risk of people shooting themselves in the feet, `--confirm` is now
the default, unless the extensions is loaded..
For review of the body of the purge command, use this instead of what
hg/phabricator will show (the block of code is modified, not just
moved):
Differential Revision: https://phab.mercurial-scm.org/D9820
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 18 Jan 2021 10:24:11 +0100] rev 46367
purge: also deal with directory with --confirm
Getting the exact number is simple (you have to project the result of previous
deletion to detect super-directory with only about-to-be-deleted content). So we
use a vaguer message.
Differential Revision: https://phab.mercurial-scm.org/D9819
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 18 Jan 2021 10:24:03 +0100] rev 46366
purge: add a --confirm option
The options provide a prompt to the user before permanent deletion are made.
The prompt is currently not aware of directory deletion. I'll fix this in the
next changesets.
Differential Revision: https://phab.mercurial-scm.org/D9818
Augie Fackler <augie@google.com> [Mon, 11 May 2020 18:45:45 -0400] rev 46365
filemerge: add a hacktastic version of internal:merge3 for merge diffs
This is a version of merge3 that always reports success, so that
conflict markers get preserved without us having to implement conflict
storage for in-memory merge. Credit to martinvonz for the idea. The
only planned consumer of this "merge tool" is my upcoming merge-diffs
functionality, though I suspect it could be useful in other ways.
Differential Revision: https://phab.mercurial-scm.org/D8515
Matt Harbison <matt_harbison@yahoo.com> [Sun, 24 Jan 2021 19:14:50 -0500] rev 46364
packaging: include `windows_curses` when building py2exe
The `_curses.pyd` module was previously being included by py2exe's module
search, but it left out `_curses_panel.pyd`.
Differential Revision: https://phab.mercurial-scm.org/D9857
Matt Harbison <matt_harbison@yahoo.com> [Sun, 24 Jan 2021 19:08:47 -0500] rev 46363
packaging: allow specifying modules to include with py2exe
Maybe this was missing because there wasn't a need for it.
Differential Revision: https://phab.mercurial-scm.org/D9856
Augie Fackler <augie@google.com> [Thu, 28 May 2020 17:31:41 -0400] rev 46362
rebase: add a config knob for forcing in-memory rebasing
Use it in a test case where we know the rebase should proceed without
incident in-memory, so we can see tracebacks rather than
fallbacks. This makes it easier to try and debug when things are
broken.
Differential Revision: https://phab.mercurial-scm.org/D8623
Augie Fackler <augie@google.com> [Mon, 18 May 2020 17:29:53 -0400] rev 46361
cleanup: use mergestate.unresolvedcount() instead of bool(list(unresolved()))
This avoids some pointless copying.
Differential Revision: https://phab.mercurial-scm.org/D8566
Joerg Sonnenberger <joerg@bec.de> [Fri, 15 Jan 2021 01:20:47 +0100] rev 46360
reverse-branch-cache: switch to doubling allocating scheme
In preperation for updating the reverse-branch-cache incrementally
whenever a new changeset comes in, avoid bad performance on resize with
Python 3.7 (and likely other 3.x versions).
Differential Revision: https://phab.mercurial-scm.org/D9778
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 17 Jan 2021 23:21:33 +0100] rev 46359
discovery: add config options to control sample size
This get useful for running analysis of the current algorithm.
Differential Revision: https://phab.mercurial-scm.org/D9813
Joerg Sonnenberger <joerg@bec.de> [Tue, 19 Jan 2021 00:20:42 +0100] rev 46358
exchangev2: avoid second look-up by node
Accessing the revlog by node is slightly more expensive than by
revision, so look up the revision first and use it afterwards.
Differential Revision: https://phab.mercurial-scm.org/D9831
Joerg Sonnenberger <joerg@bec.de> [Tue, 19 Jan 2021 00:18:39 +0100] rev 46357
commit: look-up new revision once
Look-up by node is slightly more expensive, so since it is necessary
more than once, do it explicitly.
Differential Revision: https://phab.mercurial-scm.org/D9830
Martin von Zweigbergk <martinvonz@google.com> [Tue, 19 Jan 2021 14:00:42 -0800] rev 46356
resolve: also detect new :mergediff conflict markers
The conflict markers created by `:mergediff` were not detected as
conflicts, which affects both `commands.resolve.mark-check` and
`mergetools.<tool>.check`. This patch fixes that.
The new regex it uses for finding conflict markers is less restrictive
because it `:mergediff` doesn't follow the `<<<<<<<` and `>>>>>>>`
lines by a space (and a description). Hopefully lines like that don't
give too many false positives. We can add back the space and make
`:mergediff` add trailing spaces if it turns out to be a
problem. OTOH, there will always be some false positives and we have
ways of overriding the checks already.
This patch can go onto the default or stable branch, depending on how
much we care about an experimental feature.
Differential Revision: https://phab.mercurial-scm.org/D9835
Martin von Zweigbergk <martinvonz@google.com> [Mon, 18 Jan 2021 22:32:09 -0800] rev 46355
simplemerge: delete unused find_unconflicted()
The function has been unused ever since it was introduced in
465b9ea02868 (Import 3-way merge code from bzr, 2007-04-16).
Differential Revision: https://phab.mercurial-scm.org/D9832
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 04 Dec 2020 10:11:01 +0100] rev 46354
perf: use the `perf--` prefix for perf command
This is the one command namespace where they should not be any ambiguity about
command that should be in it. The perf extensions is only adding performance
related command.
so this is a good ground to start putting dash folding to the tests.
Differential Revision: https://phab.mercurial-scm.org/D9516
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 24 Jan 2021 18:24:11 -0800] rev 46353
contrib: update PyOxidizer to 0.10.3
This is necessary to work around a bug that caused build failures on
current stable with 0.9.0. This patch was used to build the 5.7rc0 Windows
installers.
Differential Revision: https://phab.mercurial-scm.org/D9858
Raphaël Gomès <rgomes@octobus.net> [Fri, 08 Jan 2021 16:58:23 +0100] rev 46352
contrib: stop building rust for every job
This is just wasteful for all steps that do not use Rust.
Differential Revision: https://phab.mercurial-scm.org/D9717
Matt Harbison <matt_harbison@yahoo.com> [Thu, 21 Jan 2021 23:24:58 -0500] rev 46351
share-safe: fix an abort message that references the experimental requirement
Differential Revision: https://phab.mercurial-scm.org/D9851
Matt Harbison <matt_harbison@yahoo.com> [Thu, 21 Jan 2021 23:22:12 -0500] rev 46350
doc: fix a formatting error in requirements.txt
Differential Revision: https://phab.mercurial-scm.org/D9850
Matt Harbison <matt_harbison@yahoo.com> [Thu, 21 Jan 2021 23:21:45 -0500] rev 46349
doc: drop the `exp-` prefix from the `share-safe` requirement
I can't tell if we should leave the experimental one around for historical
documentation purposes, but I'm not sure if there's value to doing that.
Differential Revision: https://phab.mercurial-scm.org/D9849
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 20 Jan 2021 12:23:40 +0100] rev 46348
share-share: have the hint issue more consistently and point to the right doc
This should help user in trouble to find solution in the documentation.
Differential Revision: https://phab.mercurial-scm.org/D9841
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 20 Jan 2021 12:13:17 +0100] rev 46347
doc: point to the main share-safe doc in the "mismatch" config
User should be able to find their way with that.
Differential Revision: https://phab.mercurial-scm.org/D9840
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 20 Jan 2021 12:12:31 +0100] rev 46346
doc: improves the share-safe documentation
The associated behavior is now clearer and we point to the other configuration
that control the mismatching behavior.
Differential Revision: https://phab.mercurial-scm.org/D9839
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 20 Jan 2021 12:11:41 +0100] rev 46345
doc: remove the section about share-safe from its verbose gating
The feature is no longer experimental.
Differential Revision: https://phab.mercurial-scm.org/D9838
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 20 Jan 2021 12:08:10 +0100] rev 46344
doc: relocate doc for `share.safe-mismatch.source-safe.warn`
The documentation for the option is now right after its parent configuration:
`share.safe-mismatch.source-safe`
Differential Revision: https://phab.mercurial-scm.org/D9837
Matt Harbison <matt_harbison@yahoo.com> [Wed, 20 Jan 2021 00:40:41 -0500] rev 46343
tests: skip a detailed exit status in test-lfs-test-server
The mode of failure here differs between `lfs-test-server` and `hg serve`, and
they each throw a different exception. The `hg serve` case raises a subclass of
`StorageError`, which gets a detailed status. The `lfs-test-server` case raises
a subclass of `Abort`, which does not. Since the exit code isn't currently
conditionizable in the tests, this is the simplest way to avoid the failure.
Differential Revision: https://phab.mercurial-scm.org/D9836
Joerg Sonnenberger <joerg@bec.de> [Wed, 20 Jan 2021 14:57:56 +0100] rev 46342
tests: deal with more timing differences in output
Differential Revision: https://phab.mercurial-scm.org/D9842
Augie Fackler <augie@google.com> [Tue, 19 Jan 2021 12:22:05 -0500] rev 46341
merge with stable
Pulkit Goyal <7895pulkit@gmail.com> [Tue, 19 Jan 2021 22:37:35 +0530] rev 46340
Added signature for changeset
9da65e3cf370
Pulkit Goyal <7895pulkit@gmail.com> [Tue, 19 Jan 2021 22:37:09 +0530] rev 46339
Added tag 5.7rc0 for changeset
9da65e3cf370
Pulkit Goyal <7895pulkit@gmail.com> [Tue, 19 Jan 2021 21:48:43 +0530] rev 46338
merge with stable
Pulkit Goyal <7895pulkit@gmail.com> [Mon, 18 Jan 2021 19:16:49 +0530] rev 46337
share: move share safe functionality out of experimental
The share-safe functionality is complete and all configuration options are
implemented. The behavior is well discussed on mailing list and in reviews.
Let's unmark this as experimental to solve a chichen and egg issue.
Differential Revision: https://phab.mercurial-scm.org/D9823
Pulkit Goyal <7895pulkit@gmail.com> [Fri, 15 Jan 2021 12:08:07 +0530] rev 46336
share: rename share-safe warning config
Config introduced in previous patch was `share.source-safe-mismatch`. Let's
rename the warn as `share.source-safe-mismatch.warn`.
While we are here, made sure we have different configs for upgrade and
downgrade.
Differential Revision: https://phab.mercurial-scm.org/D9786
Pulkit Goyal <7895pulkit@gmail.com> [Mon, 18 Jan 2021 21:37:20 +0530] rev 46335
share: rework config options to be much clearer and easier
Recently I implemented various boolean configs which control how to behave when
there is a share-safe mismatch between source and share repository. Mismatch
means that source supports share-safe where as share does not or vice versa.
However, while discussion and documentation we realized that it's too
complicated and there are some combinations of values which makes no sense.
We decided to introduce a config option with 4 possible values which
makes controlling and understanding things easier.
The config option `share.safe-mismatch.source-{not-}safe` can have
following 4 values:
* abort (default): error out if there is mismatch
* allow: allow to work with respecting share source configuration
* {up|down}grade-abort: try to {up|down}grade, if it fails, abort
* {up|down}grade-allow: try to {up|down}grade, if it fails, continue in allow
mode
I am not sure if I can explain 3 config options which I deleted right now in
just 5 lines which is a sign of how complex they became.
No test changes demonstrate that functionality is same, only names have changed.
Differential Revision: https://phab.mercurial-scm.org/D9785
Pulkit Goyal <7895pulkit@gmail.com> [Mon, 18 Jan 2021 19:16:49 +0530] rev 46334
share: move share safe functionality out of experimental
The share-safe functionality is complete and all configuration options are
implemented. The behavior is well discussed on mailing list and in reviews.
Let's unmark this as experimental to solve a chichen and egg issue.
Differential Revision: https://phab.mercurial-scm.org/D9823
Pulkit Goyal <7895pulkit@gmail.com> [Fri, 15 Jan 2021 12:08:07 +0530] rev 46333
share: rename share-safe warning config
Config introduced in previous patch was `share.source-safe-mismatch`. Let's
rename the warn as `share.source-safe-mismatch.warn`.
While we are here, made sure we have different configs for upgrade and
downgrade.
Differential Revision: https://phab.mercurial-scm.org/D9786
Pulkit Goyal <7895pulkit@gmail.com> [Mon, 18 Jan 2021 21:37:20 +0530] rev 46332
share: rework config options to be much clearer and easier
Recently I implemented various boolean configs which control how to behave when
there is a share-safe mismatch between source and share repository. Mismatch
means that source supports share-safe where as share does not or vice versa.
However, while discussion and documentation we realized that it's too
complicated and there are some combinations of values which makes no sense.
We decided to introduce a config option with 4 possible values which
makes controlling and understanding things easier.
The config option `share.safe-mismatch.source-{not-}safe` can have
following 4 values:
* abort (default): error out if there is mismatch
* allow: allow to work with respecting share source configuration
* {up|down}grade-abort: try to {up|down}grade, if it fails, abort
* {up|down}grade-allow: try to {up|down}grade, if it fails, continue in allow
mode
I am not sure if I can explain 3 config options which I deleted right now in
just 5 lines which is a sign of how complex they became.
No test changes demonstrate that functionality is same, only names have changed.
Differential Revision: https://phab.mercurial-scm.org/D9785
Pulkit Goyal <7895pulkit@gmail.com> [Thu, 14 Jan 2021 21:34:12 +0530] rev 46331
localrepo: disallow share if there is a version mismatch by default
Earlier we used to allow shares which don't use share-safe mechanism to access
repository which uses share-safe mechanism. This defeats the purpose and is bad
behavior. This patch disallows that.
Next patch will introduce a config option to allow that and have clearer
understanding around various options.
Differential Revision: https://phab.mercurial-scm.org/D9784
Pulkit Goyal <7895pulkit@gmail.com> [Mon, 18 Jan 2021 19:50:21 +0530] rev 46330
upgrade: re-read current requirements after taking lock
Since we are writing to repository, it's better to re-read after taking the
lock.
Differential Revision: https://phab.mercurial-scm.org/D9822
Pulkit Goyal <7895pulkit@gmail.com> [Thu, 14 Jan 2021 21:29:46 +0530] rev 46329
upgrade: take lock only for part where it's required
The final config calculation code does not require a lock, only writing it back
does require one.
Differential Revision: https://phab.mercurial-scm.org/D9783
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 18 Jan 2021 19:19:47 +0100] rev 46328
clang-format: reorder includes to appease the formatter
The bad order was introduced in
d0225a22040c.
Differential Revision: https://phab.mercurial-scm.org/D9829
Matt Harbison <matt_harbison@yahoo.com> [Mon, 18 Jan 2021 01:15:10 -0500] rev 46327
run-tests: catch a Windows specific error when testing for a free socket
I'm not sure why this only happens with py3, but this error code doesn't map to
any of the 3 currently being handled, and kills `run-tests.py` before it can run
any tests when it happens:
OSError: [WinError 10013] An attempt was made to access a socket in a way
forbidden by its access permissions
The documentation[1] says this can happen if another process is bound to the
address with exclusive access. This seems to keep it happy.
[1] https://docs.microsoft.com/en-us/windows/win32/winsock/windows-sockets-error-codes-2
Differential Revision: https://phab.mercurial-scm.org/D9816
Matt Harbison <matt_harbison@yahoo.com> [Mon, 18 Jan 2021 00:50:01 -0500] rev 46326
run-tests: work around the Windows firewall popup for server processes
Windows doesn't have a `python3` executable, so
cc0b332ab9fc attempted to work
around the issue by copying the current python to `python3.exe`. That put it in
`_tmpbindir` because of failures in `test-run-tests.t` when using `_bindir`,
which looked like a process was trying to open it to write out a copy while it
was in use. (Interestingly, I couldn't reproduce this running the test by
itself in a loop for a couple of hours, but it happens constantly when running
all tests.) The problem with using `_tmpbindir` is that it is the randomly
generated path for the test run, and instead of Windows Firewall remembering the
executable signature or image hash when allowing the process to open a server
port, it apparently remembers the image path. That means every run will trigger
a popup to allow it, which is bad for firing off a test run and walking away.
I tried to symlink to the python executable, but that currently requires admin
priviledges[1]. This will prompt the first time if the underlying python binary
has never opened a server port, but appears to avoid it on subsequent runs.
[1] https://bugs.python.org/
issue40687
Differential Revision: https://phab.mercurial-scm.org/D9815
Matt Harbison <matt_harbison@yahoo.com> [Sun, 17 Jan 2021 22:25:15 -0500] rev 46325
hghave: split apart testing for the curses module and `tic` executable
ef771d329961 skipped the check for the `tic` executable, because the curses
module alone on Windows is enough to pass the `test-*-curses.t` tests. However,
`test-status-color.t` uses this same check and explicitly invoked the
executable, which fails on Windows. From the cursory searching I did, curses on
unix requires `tic`, which I assume is why they were tied together in the first
place. So this continues to require both to get past the curses guards on non
Windows platforms.
Differential Revision: https://phab.mercurial-scm.org/D9814
Joerg Sonnenberger <joerg@bec.de> [Mon, 18 Jan 2021 13:59:54 +0100] rev 46324
sqlitestore: disable test with chg
There are known issues with transactions not being closed in a timely
fashion, making the test flakey.
Differential Revision: https://phab.mercurial-scm.org/D9821
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 15 Jan 2021 20:26:21 +0100] rev 46323
heptapod-ci: allow testing with docker image other than :latest
The project have a default config of latest for this variable.
Differential Revision: https://phab.mercurial-scm.org/D9792
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 17 Jan 2021 20:27:59 +0100] rev 46322
persistent-nodemap: also exchange the nodemap data over the wire
It appears that 2 bytes are never equals to 3 bytes.
Differential Revision: https://phab.mercurial-scm.org/D9810
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 17 Jan 2021 19:22:30 +0100] rev 46321
persistent-nodemap: catch the right exception on python
On Python 2, Missing file are IOError, not OSError, apparently.
Differential Revision: https://phab.mercurial-scm.org/D9809
Matt Harbison <matt_harbison@yahoo.com> [Sun, 17 Jan 2021 02:50:26 -0500] rev 46320
hghave: adjust the definition of `tic` to allow curses tests on Windows
Might as well pick up the test coverage if it works as-is.
Differential Revision: https://phab.mercurial-scm.org/D9808
Matt Harbison <matt_harbison@yahoo.com> [Wed, 09 Dec 2020 00:51:35 -0500] rev 46319
windows: wrap `os.getcwd()` in `os.path.realpath()` on py3
I noticed various `test-check-*` failures that were printing absolute paths
when repo relative paths were expected. This was due to the drive letter in
`repo.root` being uppercased as it is run through `os.path.realpath()`, and then
the simple string comparison against the (lowercased) `_cwd` member of dirstate
in `dirstate.getcwd()` causing an absolute path to be returned, instead of the
expected `b''`. That in turn causes `scmutil.getuipathfn()` to wrongly use
`repo.pathto()` with an absolute cwd path.
.
Differential Revision: https://phab.mercurial-scm.org/D9806
Matt Harbison <matt_harbison@yahoo.com> [Tue, 01 Dec 2020 21:51:41 -0500] rev 46318
packaging: include `windows-curses` on Windows
Otherwise the interface degrades to the old hunk selection method on Windows
when `ui.tweakdefaults=1`. I've been using this for a couple of months without
any issues, other than it seems to toggle off edit mode for the terminal when
run through MSYS. Using cmd.exe seems to work fine.
Differential Revision: https://phab.mercurial-scm.org/D9805
Matt Harbison <matt_harbison@yahoo.com> [Sat, 16 Jan 2021 20:15:10 -0500] rev 46317
cext: fix compiler error in revlog.c on Windows with py2
Visual Studio 2008 doesn't have <stdint.h>, and we worked around it before with
this header.
Differential Revision: https://phab.mercurial-scm.org/D9804
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 16 Jan 2021 01:02:03 +0100] rev 46316
discovery: add a devel.discovery.exchange-heads
Currently all discovery start with testing local and remote heads. For analysis
purpose we make it possible to disable that initial "handshake" and start
discovery with the whole repository as undecided.
Differential Revision: https://phab.mercurial-scm.org/D9801
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 17 Jan 2021 02:48:15 +0100] rev 46315
test-regression: backing out D9640 (
63c923fd7fa8)
Since D9640 was pushed, we have seen failure on at least:
- test-commit-interactive.t
- test-i18n.t
- test-log.t
The author that change requested it to be removed until he can investigate.
For reference: https://phab.mercurial-scm.org/D9640
Backed out changeset
63c923fd7fa8
Differential Revision: https://phab.mercurial-scm.org/D9803
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 15 Jan 2021 12:41:38 +0100] rev 46314
clone: make sure we warm the cache after a clone
This work around any deviciency/limitation of the clone process. In our case
this ensure the persistent nodemap exist with valid content.
Ideally, the cloning process would also do "the right thing". However since
older server will never be able to do "the right thing". The local workaround
will be necessary anyway.
I am not worried by the performance impact of this as `hg clone` is non-instant
on large repositories where is could matters. Warming the cache if they are
already correct is very fast. And if they are not already warm, this seems like
a good time to do so.
This impact various test as more cache are now warmed sooner, all the change
should be harmless.
Differential Revision: https://phab.mercurial-scm.org/D9789
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 14 Jan 2021 04:56:29 +0100] rev 46313
persistent-nodemap: remove the "experimental" tag to the feature
This has been around for a while and has all the discussed configuration
options.
Differential Revision: https://phab.mercurial-scm.org/D9764
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 13 Jan 2021 23:50:03 +0100] rev 46312
persistent-nodemap: drop the storage.revlog.nodemap.mode config
We now have a new, better, higher level, option. So we can drop the older one as
planned.
Differential Revision: https://phab.mercurial-scm.org/D9763
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 13 Jan 2021 23:41:37 +0100] rev 46311
persistent-nodemap: add a "abort" option to the slow-path config
We make it the default, and document the behavior in the help for the main
config option.
Differential Revision: https://phab.mercurial-scm.org/D9762
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 13 Jan 2021 23:07:41 +0100] rev 46310
persistent-nodemap: add a "warn" option to the slow-path config
And make it the default until we get an abort option.
Differential Revision: https://phab.mercurial-scm.org/D9761
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 13 Jan 2021 18:33:48 +0100] rev 46309
persistent-node: check the value of the slow-path config
We should probably provide some standard for this in config item, but this is a
quest for another adventure.
Differential Revision: https://phab.mercurial-scm.org/D9760
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 14 Jan 2021 01:25:06 +0100] rev 46308
persistent-nodemap: add a revlog.storage.persistent-nodemap.slow-path option
As discussed during the sprint, we want to prevent user to get an unexpected
performance regression when accessing a repository using "persistent-nodemap"
without the associated Rust extension.
We start by adding a config declaration and some documentation.
Since "allow" is the current behavior, we don't need to add any code. The option
possible value will come later.
Note that we already have a `storage.revlog.nodemap.mode` option, but that
option is a bit different. It does some warning and checking at revlog
instantiation time. While we want something done at requirements checking time.
Since we plan for new names and new config value names, we introduce a new
option and will drop the old one later.
Differential Revision: https://phab.mercurial-scm.org/D9758
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 14 Jan 2021 01:12:42 +0100] rev 46307
persistent-nodemap: document storage.revlog.persistent-nodemap.mmap=no
The feature is gaining public facing document, its options too.
Differential Revision: https://phab.mercurial-scm.org/D9757
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 13 Jan 2021 23:51:12 +0100] rev 46306
persistent-nodemap: rename the storage.revlog.nodemap.mmap option
Since the feature is publicly known as "persistent-nodemap" this seems better to
reference it as "persistent-nodemap" in related config too. So we rename the
option to `storage.revlog.persistent-nodemap.mmap`.
Differential Revision: https://phab.mercurial-scm.org/D9756
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 14 Jan 2021 00:56:27 +0100] rev 46305
persistent-nodemap: document the feature in `hg help config.format`
This is necessary before we advertise the feature more.
Differential Revision: https://phab.mercurial-scm.org/D9755
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 14 Jan 2021 00:37:36 +0100] rev 46304
persistent-nodemap: write down the sprint conclusion
This write down the plan for turning feature that are only fast when the rust
extension exists. Future changesets will implement it.
Differential Revision: https://phab.mercurial-scm.org/D9754