Sat, 09 Apr 2022 14:43:30 +0200 test: accept another error message on lack of TLS client certificate
Julien Cristau <jcristau@debian.org> [Sat, 09 Apr 2022 14:43:30 +0200] rev 49058
test: accept another error message on lack of TLS client certificate Differential Revision: https://phab.mercurial-scm.org/D12492
Sat, 09 Apr 2022 14:41:55 +0200 sslutil: support TLSV1_ALERT_PROTOCOL_VERSION reason code
Julien Cristau <jcristau@debian.org> [Sat, 09 Apr 2022 14:41:55 +0200] rev 49057
sslutil: support TLSV1_ALERT_PROTOCOL_VERSION reason code It looks like python 3.10 returns a different reason code on protocol version mismatch. Differential Revision: https://phab.mercurial-scm.org/D12491
Sat, 09 Apr 2022 14:28:17 +0200 test: override default cipher selection when connecting to TLS 1.0/1.1 servers
Julien Cristau <jcristau@debian.org> [Sat, 09 Apr 2022 14:28:17 +0200] rev 49056
test: override default cipher selection when connecting to TLS 1.0/1.1 servers The default set of ciphers on python 3.10 is incompatible with old TLS versions. Differential Revision: https://phab.mercurial-scm.org/D12490
Sat, 09 Apr 2022 14:23:52 +0200 sslutil: be less strict about which ciphers are allowed when using --insecure
Julien Cristau <jcristau@debian.org> [Sat, 09 Apr 2022 14:23:52 +0200] rev 49055
sslutil: be less strict about which ciphers are allowed when using --insecure Python 3.10 restricted which ciphers are enabled by default, leading to no available ciphers for TLS < 1.2. When using the --insecure flag we allow old TLS, so also adjust the cipher list to give connections a chance to work. On the server side, also loosen the cipher selection in tests (when using the devel.serverexactprotocol option). Differential Revision: https://phab.mercurial-scm.org/D12489
Sat, 09 Apr 2022 14:15:32 +0200 sslutil: avoid deprecation warnings from python 3.10's ssl module
Julien Cristau <jcristau@debian.org> [Sat, 09 Apr 2022 14:15:32 +0200] rev 49054
sslutil: avoid deprecation warnings from python 3.10's ssl module Use ssl.PROTOCOL_TLS_{CLIENT,SERVER} and SSLContext.{min,max}imum_version when supported (3.7+). And, catch deprecation warnings when the user asks for deprecated TLS versions (1.0 and 1.1). Differential Revision: https://phab.mercurial-scm.org/D12488
Wed, 06 Apr 2022 22:29:49 +0200 zeroconf: fix deprecation warning with python 3.10
Julien Cristau <jcristau@debian.org> [Wed, 06 Apr 2022 22:29:49 +0200] rev 49053
zeroconf: fix deprecation warning with python 3.10 threading.condition.notifyAll → threading.condition.notify_all Differential Revision: https://phab.mercurial-scm.org/D12487
Mon, 11 Apr 2022 11:14:55 +0200 test: deal with changed error message on python 3.10
Julien Cristau <jcristau@debian.org> [Mon, 11 Apr 2022 11:14:55 +0200] rev 49052
test: deal with changed error message on python 3.10 Differential Revision: https://phab.mercurial-scm.org/D12493
Mon, 02 Dec 2019 14:45:00 +0100 mail: don't complain about a multi-word email.method
Julien Cristau <jcristau@debian.org> [Mon, 02 Dec 2019 14:45:00 +0100] rev 49051
mail: don't complain about a multi-word email.method I want to be able to set email.method to "ssh relay /usr/sbin/sendmail" without needing an extra trivial shell script. This works fine since we pass the full command to a shell, except for validateconfig trying to find it in $PATH. Differential Revision: https://phab.mercurial-scm.org/D7542
Thu, 07 Apr 2022 15:53:48 +0200 help: set the large-file-limit to 10MB stable
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 07 Apr 2022 15:53:48 +0200] rev 49050
help: set the large-file-limit to 10MB This is a minor increase (5%) and makes the doc much clearer. Differential Revision: https://phab.mercurial-scm.org/D12484
Thu, 07 Apr 2022 15:46:07 +0200 help: clarify the unit of `ui.large-file-limit` config stable
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 07 Apr 2022 15:46:07 +0200] rev 49049
help: clarify the unit of `ui.large-file-limit` config Its might be a bit confusing, especially since `large-file.min-size` uses MB. Differential Revision: https://phab.mercurial-scm.org/D12483
Wed, 06 Apr 2022 18:39:15 +0200 debuglock: ignore ENOENT error when unlocking stable
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 06 Apr 2022 18:39:15 +0200] rev 49048
debuglock: ignore ENOENT error when unlocking This is consistent with the main `lock.release` code. Differential Revision: https://phab.mercurial-scm.org/D12481
Wed, 06 Apr 2022 18:50:20 +0200 run-tests: introduce "forward-slash" version of everything on windows stable
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 06 Apr 2022 18:50:20 +0200] rev 49047
run-tests: introduce "forward-slash" version of everything on windows This should be useful for some shell invocation. Differential Revision: https://phab.mercurial-scm.org/D12480
Wed, 06 Apr 2022 18:44:21 +0200 tests-racy-mutation: pass the editor through config instead of env variable stable
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 06 Apr 2022 18:44:21 +0200] rev 49046
tests-racy-mutation: pass the editor through config instead of env variable On Windows msys seems to do awful mangling of the environment variable content that confuses everything to the death. Going through the config works fine, so we do that instead. Differential Revision: https://phab.mercurial-scm.org/D12479
Mon, 28 Mar 2022 18:53:55 +0200 rust-dirstate: don't return a state for untracked entries
Raphaël Gomès <rgomes@octobus.net> [Mon, 28 Mar 2022 18:53:55 +0200] rev 49045
rust-dirstate: don't return a state for untracked entries This `state` API is a remnant of the former API and is slated for removal at some point. Any caller of this function will expect an entry that is tracked in the larger sense. Differential Revision: https://phab.mercurial-scm.org/D12448
Tue, 22 Mar 2022 16:33:18 +0100 dirstate: remove v1_* methods from Python/C/Rust shared API
Raphaël Gomès <rgomes@octobus.net> [Tue, 22 Mar 2022 16:33:18 +0100] rev 49044
dirstate: remove v1_* methods from Python/C/Rust shared API These methods are used for v1 parsing by their respective implementations, but do not need to be shared between them. Differential Revision: https://phab.mercurial-scm.org/D12447
Mon, 28 Mar 2022 13:01:42 +0200 rust-dirstate-entry: fix typo in panic message
Raphaël Gomès <rgomes@octobus.net> [Mon, 28 Mar 2022 13:01:42 +0200] rev 49043
rust-dirstate-entry: fix typo in panic message Differential Revision: https://phab.mercurial-scm.org/D12446
Mon, 28 Mar 2022 13:00:57 +0200 test-issue660: add dirstate-v2 variant
Raphaël Gomès <rgomes@octobus.net> [Mon, 28 Mar 2022 13:00:57 +0200] rev 49042
test-issue660: add dirstate-v2 variant It's basically a dirstate test, so it makes sense to test out the new version. Differential Revision: https://phab.mercurial-scm.org/D12445
Mon, 28 Mar 2022 13:00:14 +0200 test-issue660: test inside a repository, not the test dir
Raphaël Gomès <rgomes@octobus.net> [Mon, 28 Mar 2022 13:00:14 +0200] rev 49041
test-issue660: test inside a repository, not the test dir This causes an issue with a temporary file showing up in test output when adding a dirstate-v2 variant of this test. Differential Revision: https://phab.mercurial-scm.org/D12444
Wed, 23 Mar 2022 15:15:17 +0100 dirstate: fix some typos in docstrings
Raphaël Gomès <rgomes@octobus.net> [Wed, 23 Mar 2022 15:15:17 +0100] rev 49040
dirstate: fix some typos in docstrings I was passing by and they've been bothering me. :) Differential Revision: https://phab.mercurial-scm.org/D12443
Mon, 04 Apr 2022 13:36:37 +0000 path: explicitly declare the `pushurl` suboption
Raphaël Gomès <rgomes@octobus.net> [Mon, 04 Apr 2022 13:36:37 +0000] rev 49039
path: explicitly declare the `pushurl` suboption This will help documentation and discovery. Differential Revision: https://phab.mercurial-scm.org/D12437
Thu, 07 Apr 2022 15:29:02 +0200 setup: fix incomplete implementation of Command
Raphaël Gomès <rgomes@octobus.net> [Thu, 07 Apr 2022 15:29:02 +0200] rev 49038
setup: fix incomplete implementation of Command `test-install.t` fails without the `get_outputs` method being implemented, which is used when, `self.report` is `True`. When 8d7eaff92f9c introduced this change, they probably ran `test-install.t` without `HGTESTS_ALLOW_NETIO=1`, which does not trigger this codepath. Differential Revision: https://phab.mercurial-scm.org/D12482
Mon, 04 Apr 2022 15:36:32 +0200 path: explicitly declare the `pushrev` suboptions
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 04 Apr 2022 15:36:32 +0200] rev 49037
path: explicitly declare the `pushrev` suboptions This will help documentation and discovery. Differential Revision: https://phab.mercurial-scm.org/D12436
Mon, 04 Apr 2022 15:36:17 +0200 path: explicitly declare the `multi-urls` suboptions
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 04 Apr 2022 15:36:17 +0200] rev 49036
path: explicitly declare the `multi-urls` suboptions This will help documentation and discovery. Differential Revision: https://phab.mercurial-scm.org/D12435
Mon, 04 Apr 2022 15:35:59 +0200 path: explicitly declare the `bookmarks.mode` suboptions
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 04 Apr 2022 15:35:59 +0200] rev 49035
path: explicitly declare the `bookmarks.mode` suboptions This will help documentation and discovery. Differential Revision: https://phab.mercurial-scm.org/D12434
Mon, 04 Apr 2022 18:05:33 -0700 crecord: avoid duplicating lines when reverting noeol->eol change
Kyle Lippincott <spectral@google.com> [Mon, 04 Apr 2022 18:05:33 -0700] rev 49034
crecord: avoid duplicating lines when reverting noeol->eol change When reversing a patch that looks like this while using crecord: ``` @@ -301,4 +302,4 @@ zza zzb zzc zzd -zze \ No newline at end of file +zze ``` we would previously reverse the `-zze` line to be an add, encounter the "no newline" line and stop inspecting lines. This caused us to duplicate the line, producing `zzezze` (still without a newline). `break` is the correct action if we know there will be no lines afterwards, as would be the case in an eol -> noeol transition. It is incorrect if there are lines afterward, such as if both sides are missing the newline or if only the lhs is missing the newline. Differential Revision: https://phab.mercurial-scm.org/D12441
Tue, 05 Apr 2022 11:09:57 -0700 crecord: add test demonstrating issue when reverting noeol->eol change
Kyle Lippincott <spectral@google.com> [Tue, 05 Apr 2022 11:09:57 -0700] rev 49033
crecord: add test demonstrating issue when reverting noeol->eol change Differential Revision: https://phab.mercurial-scm.org/D12440
Mon, 28 Mar 2022 10:43:10 -0700 revert: ask user to confirm before tracking new file when interactive
Martin von Zweigbergk <martinvonz@google.com> [Mon, 28 Mar 2022 10:43:10 -0700] rev 49032
revert: ask user to confirm before tracking new file when interactive If interactively reverting from a commit with `hg revert -i -r`, we would unconditionally add files from that commit that are not already tracked in the working copy. We have prompts for adding back files removed in the working copy, but that's specific to such files and does not apply to adding files from another revision. Differential Revision: https://phab.mercurial-scm.org/D12416
Mon, 28 Mar 2022 10:43:06 -0700 revert: use a `continue` to reduce indentation
Martin von Zweigbergk <martinvonz@google.com> [Mon, 28 Mar 2022 10:43:06 -0700] rev 49031
revert: use a `continue` to reduce indentation I'm about to add more code in the block I'm modifying here. Differential Revision: https://phab.mercurial-scm.org/D12415
Fri, 25 Mar 2022 08:33:03 -0700 stringutil: try to avoid running `splitlines()` only to get first line
Martin von Zweigbergk <martinvonz@google.com> [Fri, 25 Mar 2022 08:33:03 -0700] rev 49030
stringutil: try to avoid running `splitlines()` only to get first line It's wasteful to call `splitlines()` and only get the first line from it. However, Python doesn't seem to provide a built-in way of doing just one split based on the set of bytes used by `splitlines()`. As a workaround, we do an initial split on just LF and then call `splitlines()` on the result. Thanks to Joerg for this suggestion. I didn't bother to also split on CR, so users with old Mac editors (or repos created by such editors) will not get this performance improvement. Differential Revision: https://phab.mercurial-scm.org/D12413
Thu, 24 Mar 2022 22:05:49 -0700 logcmdutil: use new function for getting first line of string
Martin von Zweigbergk <martinvonz@google.com> [Thu, 24 Mar 2022 22:05:49 -0700] rev 49029
logcmdutil: use new function for getting first line of string Differential Revision: https://phab.mercurial-scm.org/D12412
Thu, 24 Mar 2022 22:05:36 -0700 filemerge: use new function for getting first line of string
Martin von Zweigbergk <martinvonz@google.com> [Thu, 24 Mar 2022 22:05:36 -0700] rev 49028
filemerge: use new function for getting first line of string Differential Revision: https://phab.mercurial-scm.org/D12411
Thu, 24 Mar 2022 22:05:27 -0700 absorb: use new function for getting first line of string
Martin von Zweigbergk <martinvonz@google.com> [Thu, 24 Mar 2022 22:05:27 -0700] rev 49027
absorb: use new function for getting first line of string Differential Revision: https://phab.mercurial-scm.org/D12410
Thu, 24 Mar 2022 22:05:13 -0700 extensions: use new function for getting first line of string
Martin von Zweigbergk <martinvonz@google.com> [Thu, 24 Mar 2022 22:05:13 -0700] rev 49026
extensions: use new function for getting first line of string Differential Revision: https://phab.mercurial-scm.org/D12409
Thu, 24 Mar 2022 22:04:38 -0700 bookmarks: use new function for getting first line of string
Martin von Zweigbergk <martinvonz@google.com> [Thu, 24 Mar 2022 22:04:38 -0700] rev 49025
bookmarks: use new function for getting first line of string Differential Revision: https://phab.mercurial-scm.org/D12408
Thu, 24 Mar 2022 20:31:44 -0700 help: use new function for getting first line of string
Martin von Zweigbergk <martinvonz@google.com> [Thu, 24 Mar 2022 20:31:44 -0700] rev 49024
help: use new function for getting first line of string Differential Revision: https://phab.mercurial-scm.org/D12407
Thu, 24 Mar 2022 16:55:09 -0700 histedit: remove an unnecessary default value of `b''` for commit message
Martin von Zweigbergk <martinvonz@google.com> [Thu, 24 Mar 2022 16:55:09 -0700] rev 49023
histedit: remove an unnecessary default value of `b''` for commit message I don't think `ctx.description()` is ever anything falsy other than `b''`. I think the comment added in 4c4232e51167 (histedit: extract common summary code into method, 2016-05-27) is mistaken (I don't see any code following that pattern before the function was added). Differential Revision: https://phab.mercurial-scm.org/D12406
Thu, 24 Mar 2022 16:51:20 -0700 histedit: use new function for getting first line of a string
Martin von Zweigbergk <martinvonz@google.com> [Thu, 24 Mar 2022 16:51:20 -0700] rev 49022
histedit: use new function for getting first line of a string This fixes a crash you can run into if you enter a commit message that's just a "newline-like" byte, like a form feed byte (`hg ci -m \x0f` in Fish). That bug is the motivation for this series. Differential Revision: https://phab.mercurial-scm.org/D12405
Thu, 24 Mar 2022 16:09:12 -0700 templates: extract function to `stringutil` for getting first line of text
Martin von Zweigbergk <martinvonz@google.com> [Thu, 24 Mar 2022 16:09:12 -0700] rev 49021
templates: extract function to `stringutil` for getting first line of text It's surprisingly hard to get the first line from a string, so let's have our own function in `stringutil` for it. Differential Revision: https://phab.mercurial-scm.org/D12404
Thu, 24 Mar 2022 15:41:29 -0700 templates: make `firstline` filter not keep '\v', '\f' and similar
Martin von Zweigbergk <martinvonz@google.com> [Thu, 24 Mar 2022 15:41:29 -0700] rev 49020
templates: make `firstline` filter not keep '\v', '\f' and similar In b288b4bb8448 (hide some functions behind lambdas, so demandload is useful., 2006-02-28), `x.splitlines(1)[0]` was replaced by `x.splitlines(1)[0].rstrip('\r\n')`, i.e. stripping trailing '\r' and '\n'. Combined with the "truthy" `1` passed to `splitlines()` to get it to keep line endings, that results in e.g. trailing '\v' (Line Tabulation) and '\f' (Form Feed) being preserved. I can't see why one would want that, and I doubt that was the intention; I suspect the author just didn't think to instead remove the `1` argument. Perhaps they thought the 1 being passed there - added by themselves in a7e416bf3c1d (improve templating., 2006-02-27) - was to limit the number of splits to 1 (i.e. thinking about it as `maxsplit=1` rather than `keepends=1`). Differential Revision: https://phab.mercurial-scm.org/D12403
Tue, 22 Mar 2022 11:22:09 -0400 pytype: drop py3.6 support
Matt Harbison <matt_harbison@yahoo.com> [Tue, 22 Mar 2022 11:22:09 -0400] rev 49019
pytype: drop py3.6 support Pytype 2022.01.07 only supports 3.7+. Differential Revision: https://phab.mercurial-scm.org/D12400
Sun, 13 Mar 2022 16:14:34 +0100 perf-util: add a `compare-discovery-case` script
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 13 Mar 2022 16:14:34 +0100] rev 49018
perf-util: add a `compare-discovery-case` script This script run the same discovery case using multiple variants of the algorithm and report differences in behavior, especially regarding the numbers of roundtrip. Differential Revision: https://phab.mercurial-scm.org/D12399
Mon, 14 Mar 2022 05:59:20 +0100 discovery: also audit the number of queries done
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 14 Mar 2022 05:59:20 +0100] rev 49017
discovery: also audit the number of queries done In addition to the number of roundtrip, we now also track the number of queries we perform, this is useful to assert the tradeoff between number of roundtrip and the number of queries. Differential Revision: https://phab.mercurial-scm.org/D12398
Sun, 13 Mar 2022 16:10:53 +0100 search-discovery-case: display more information about the interresting case
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 13 Mar 2022 16:10:53 +0100] rev 49016
search-discovery-case: display more information about the interresting case We display information about the total number of revs and the common/missing numbers. This is useful to spot the interresting case. Differential Revision: https://phab.mercurial-scm.org/D12397
Mon, 21 Mar 2022 20:06:51 +0100 subsetmaker: rework the antichain generation to be usable
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 21 Mar 2022 20:06:51 +0100] rev 49015
subsetmaker: rework the antichain generation to be usable Before this, antichain computation can run for 10s of hours without completion in sight. We use a more direct approach in the computation to keep the computation in complexity in check. With good result. We can now have a full antichain computation on mozilla-try in about one minute. Which is usable. Differential Revision: https://phab.mercurial-scm.org/D12396
Sun, 13 Mar 2022 16:24:01 +0100 subsetmaker: use SortedSet for the scratch variant
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 13 Mar 2022 16:24:01 +0100] rev 49014
subsetmaker: use SortedSet for the scratch variant This provides a massive speedup on wide repository with many heads. For example on mozilla-try, this move from un-usable slow to fairly instant. Differential Revision: https://phab.mercurial-scm.org/D12395
Sun, 13 Mar 2022 15:53:29 +0100 subsetmaker: stabilize the computation of `scratch` subset
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 13 Mar 2022 15:53:29 +0100] rev 49013
subsetmaker: stabilize the computation of `scratch` subset `heads` is set, order of the element are not deterministic and we need to stabilize that if we want to get reproducible results. Differential Revision: https://phab.mercurial-scm.org/D12394
Tue, 20 Jul 2021 15:07:10 +0200 revlog: recommit 49fd21f32695 with a fix for issue6528
Joerg Sonnenberger <joerg@bec.de> [Tue, 20 Jul 2021 15:07:10 +0200] rev 49012
revlog: recommit 49fd21f32695 with a fix for issue6528 `filelog.size` currently special cases two forms of metadata encoding: - copy data via the parent order as flag bit - censor data by peaking into the raw delta All other forms of metadata encoding including the empty metadata block are mishandled. In `basefilectx.cmp` the empty metadata block is explicitly checked to compensate for this. Restore 49fd21f32695, but disable it for filelog, so that the original flag bit use contines to work. Document all this mess for now in preparation of a proper rework. Differential Revision: https://phab.mercurial-scm.org/D11203
Fri, 18 Mar 2022 12:23:47 -0700 merge-lists: make it possible to specify pattern to match
Martin von Zweigbergk <martinvonz@google.com> [Fri, 18 Mar 2022 12:23:47 -0700] rev 49011
merge-lists: make it possible to specify pattern to match The `merge-lists` tool doesn't know anything about Python other than its regex that attempts to match import lines. Let's make it possible to pass in a custom regex so it's easy to use the tool for e.g. C/C++ `#include` lines or Rust `use` lines (given the limited). Differential Revision: https://phab.mercurial-scm.org/D12392
Fri, 04 Mar 2022 16:12:56 -0800 contrib: add a partial-merge tool for sorted lists (such as Python imports)
Martin von Zweigbergk <martinvonz@google.com> [Fri, 04 Mar 2022 16:12:56 -0800] rev 49010
contrib: add a partial-merge tool for sorted lists (such as Python imports) This is a pretty naive tool that uses a regular expression for matching lines. It is based on a Google-internal tool that worked in a similar way. For now, the regular expression is hard-coded to attempt to match single-line Python imports. The only commit I've found in the hg core repo where the tool helped was commit 9cd6292abfdf. I think that's because we often use multiple imports per import statement. I think this tool is still a decent first step (especially once the regex is made configurable in the next patch). The merging should ideally use a proper Python parser and do the merge at the AST (or CST?) level, but that's significantly harder, especially if you want to preserve comments and whitespace. It's also less generic. Differential Revision: https://phab.mercurial-scm.org/D12380
Tue, 05 Apr 2022 17:31:18 +0200 branching: merge stable into default
Raphaël Gomès <rgomes@octobus.net> [Tue, 05 Apr 2022 17:31:18 +0200] rev 49009
branching: merge stable into default
Tue, 05 Apr 2022 17:19:29 +0200 Added signature for changeset 5bd6bcd31dd1 stable
Raphaël Gomès <rgomes@octobus.net> [Tue, 05 Apr 2022 17:19:29 +0200] rev 49008
Added signature for changeset 5bd6bcd31dd1
Tue, 05 Apr 2022 17:19:22 +0200 Added tag 6.1.1 for changeset 5bd6bcd31dd1 stable
Raphaël Gomès <rgomes@octobus.net> [Tue, 05 Apr 2022 17:19:22 +0200] rev 49007
Added tag 6.1.1 for changeset 5bd6bcd31dd1
Tue, 05 Apr 2022 17:11:36 +0200 relnotes: add notes for 6.1.1 stable 6.1.1
Raphaël Gomès <rgomes@octobus.net> [Tue, 05 Apr 2022 17:11:36 +0200] rev 49006
relnotes: add notes for 6.1.1 This also fixes the header for 6.1 from 6.1rc0
Tue, 05 Apr 2022 11:09:03 +0200 merge: stable into default
Raphaël Gomès <rgomes@octobus.net> [Tue, 05 Apr 2022 11:09:03 +0200] rev 49005
merge: stable into default
Tue, 05 Apr 2022 10:55:28 +0200 rust-hgpath: add `repr(transparent)` to `HgPath` stable
Raphaël Gomès <rgomes@octobus.net> [Tue, 05 Apr 2022 10:55:28 +0200] rev 49004
rust-hgpath: add `repr(transparent)` to `HgPath` It's been stabilized a long time ago, so let's not rely on an implementation detail now. Differential Revision: https://phab.mercurial-scm.org/D12433
Tue, 05 Apr 2022 10:55:28 +0200 rust-dirstatemap: correctly decrement the copies counter stable
Raphaël Gomès <rgomes@octobus.net> [Tue, 05 Apr 2022 10:55:28 +0200] rev 49003
rust-dirstatemap: correctly decrement the copies counter This was caught when writing unit tests for the `DirstateMap`. We were always setting `had_copy_source` to `false` since we erased the value just before. Differential Revision: https://phab.mercurial-scm.org/D12432
Tue, 05 Apr 2022 10:55:28 +0200 rust-dirstatemap: properly decrement counter for tracked descendants stable
Raphaël Gomès <rgomes@octobus.net> [Tue, 05 Apr 2022 10:55:28 +0200] rev 49002
rust-dirstatemap: properly decrement counter for tracked descendants I found this bug when writing unit tests after the fact for the `DirstateMap`. We never decremented the tracked descendants counter since we were always resetting the node data before reading it. This also drops the use of `state`, in favor of the new API to get that information. Differential Revision: https://phab.mercurial-scm.org/D12431
Tue, 05 Apr 2022 10:55:28 +0200 rust-dirstate: panic if the DirstateMap counters go below 0 stable
Raphaël Gomès <rgomes@octobus.net> [Tue, 05 Apr 2022 10:55:28 +0200] rev 49001
rust-dirstate: panic if the DirstateMap counters go below 0 When modifying the API I hit some... interesting errors (trying to allocate 178GB of RAM, for example) because I failed to keep the counters correctly updated. This counter underflow is likely to happen when code is changed around and can have up to eat-your-dirstate level of consequences, which is not nice. The very small runtime cost of checking these counters should really not be an issue and will help us uncover bugs when/if they do appear in the future. Differential Revision: https://phab.mercurial-scm.org/D12430
Tue, 05 Apr 2022 10:55:28 +0200 rust: fix unsound `OwningDirstateMap` stable
Raphaël Gomès <rgomes@octobus.net> [Tue, 05 Apr 2022 10:55:28 +0200] rev 49000
rust: fix unsound `OwningDirstateMap` As per the previous patch, `OwningDirstateMap` is unsound. Self-referential structs are difficult to implement correctly in Rust since the compiler is free to move structs around as much as it wants to. They are also very rarely needed in practice, so the state-of-the-art on how they should be done within the Rust rules is still a bit new. The crate `ouroboros` is an attempt at providing a safe way (in the Rust sense) of declaring self-referential structs. It is getting a lot attention and was improved very quickly when soundness issues were found in the past: rather than relying on our own (limited) review circle, we might as well use the de-facto common crate to fix this problem. This will give us a much better chance of finding issues should any new ones be discovered as well as the benefit of fewer `unsafe` APIs of our own. I was starting to think about how I would present a safe API to the old struct but soon realized that the callback-based approach was already done in `ouroboros`, along with a lot more care towards refusing incorrect structs. In short: we don't return a mutable reference to the `DirstateMap` anymore, we expect users of its API to pass a `FnOnce` that takes the map as an argument. This allows our `OwningDirstateMap` to control the input and output lifetimes of the code that modifies it to prevent such issues. Changing to `ouroboros` meant changing every API with it, but it is relatively low churn in the end. It correctly identified the example buggy modification of `copy_map_insert` outlined in the previous patch as violating the borrow rules. Differential Revision: https://phab.mercurial-scm.org/D12429
Tue, 05 Apr 2022 10:55:27 +0200 rust: explain why the current `OwningDirstateMap` is unsound stable
Raphaël Gomès <rgomes@octobus.net> [Tue, 05 Apr 2022 10:55:27 +0200] rev 48999
rust: explain why the current `OwningDirstateMap` is unsound See inline comments. Differential Revision: https://phab.mercurial-scm.org/D12428
(0) -30000 -10000 -3000 -1000 -300 -100 -60 +60 +100 +300 +1000 tip