Mon, 28 Oct 2024 11:45:02 +0100 branching: merge stable into default default tip
Raphaël Gomès <rgomes@octobus.net> [Mon, 28 Oct 2024 11:45:02 +0100] rev 52140
branching: merge stable into default
Mon, 28 Oct 2024 11:40:49 +0100 Added signature for changeset eae3ec345e5e stable
Raphaël Gomès <rgomes@octobus.net> [Mon, 28 Oct 2024 11:40:49 +0100] rev 52139
Added signature for changeset eae3ec345e5e
Mon, 28 Oct 2024 11:40:25 +0100 Added tag 6.8.2 for changeset eae3ec345e5e stable
Raphaël Gomès <rgomes@octobus.net> [Mon, 28 Oct 2024 11:40:25 +0100] rev 52138
Added tag 6.8.2 for changeset eae3ec345e5e
Mon, 28 Oct 2024 11:39:03 +0100 relnotes: add 6.8.2 stable 6.8.2
Raphaël Gomès <rgomes@octobus.net> [Mon, 28 Oct 2024 11:39:03 +0100] rev 52137
relnotes: add 6.8.2
Fri, 25 Oct 2024 17:33:47 +0200 evolution: stop wrongly flagging unrelated part of a split as divergent stable
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 25 Oct 2024 17:33:47 +0200] rev 52136
evolution: stop wrongly flagging unrelated part of a split as divergent Before this change, divergence introduced by successors of a split would "spill" to other unrelated successors of the split that were not ambiguous. This small changes fixes it. Thanks goes to Manuel Jacobs for the discussion leading to this realization that a new simple and correct definition could be found.
Sun, 27 Oct 2024 17:29:18 -0400 tests: skip doctests that use `time.tzset()` on Windows
Matt Harbison <matt_harbison@yahoo.com> [Sun, 27 Oct 2024 17:29:18 -0400] rev 52135
tests: skip doctests that use `time.tzset()` on Windows There's no way to conditionally skip the tests for a function (see the inline feature request). That leaves us with the choice to either put the whole `mercurial.utils.dateutil` module in the skip list of this script (but then this script prints out the module as unexpectedly not tested, and misses a bunch of tests that can be run), blacklist the test entirely (but that makes it harder to work with on Windows), or use this hack to look for the statement that is broken, and skip the test currently attached to one function. (It appears that an example in the list of examples corresponds to a single `>>>` block, and the `test` itself corresponds to a single function. So prescan the examples, and skip all of them when the statement is found in any, since the setup of setting the timezone has an effect on subsequent examples.)
Mon, 07 Oct 2024 12:08:48 +0100 tests: hopefully fix `test-doctest.py` on Windows and more
Arseniy Alekseyev <aalekseyev@janestreet.com> [Mon, 07 Oct 2024 12:08:48 +0100] rev 52134
tests: hopefully fix `test-doctest.py` on Windows and more 1. Shell syntax understood by `shell=True` depends on the platform. Instead, pass `shell=False` and call `sh` explicitly to interpret the command correctly. 2. Stop setting `HGRCPATH=/dev/null`, so the setting `experimental.evolution=createmarkers` is set correctly. The reason I set HGRCPATH to /dev/null previously is because of misunderstanding where I thought the Python script had no HGRC to edit. As it turns out, there is in fact a valid temporary HGRC pointed to by HGRCPATH in this context so we don't seem to need this. /shrug
Sat, 26 Oct 2024 13:56:46 -0400 hghave: make the description for "clang-format" ascii
Matt Harbison <matt_harbison@yahoo.com> [Sat, 26 Oct 2024 13:56:46 -0400] rev 52133
hghave: make the description for "clang-format" ascii test-fix-clang-format.t suddenly started failing on Windows by wiping the whole file content, and replacing with an error: $TESTTMP.sh: $TESTTMP.sh: cannot execute binary file Odd, because I don't have `clang-format` installed, so the test should be skipped. The problem started with 73cf8b56c2f5, and I noticed that running `hghave` manually resulted in a `SyntaxError` (so I can't see how this isn't broken everywhere, but maybe it's because I'm using py3.9 on Windows): $ py hghave --list Traceback (most recent call last): File "hghave", line 8, in <module> import hghave File "c:\Users\Matt\hg\tests\hghave.py", line 627 SyntaxError: Non-ASCII character '\xe2' in file c:\Users\Matt\hg\tests\hghave.py on line 627, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
Sat, 26 Oct 2024 23:33:19 +0200 branching: merge stable into default
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 26 Oct 2024 23:33:19 +0200] rev 52132
branching: merge stable into default Hopefully this will bring the last changes necessary to make the 3.13 tests green (on Linux).
Fri, 25 Oct 2024 23:46:20 -0400 tests: enable pytype checking on `mercurial/wireprotov1peer.py`
Matt Harbison <matt_harbison@yahoo.com> [Fri, 25 Oct 2024 23:46:20 -0400] rev 52131
tests: enable pytype checking on `mercurial/wireprotov1peer.py`
Fri, 25 Oct 2024 23:45:05 -0400 typing: suppress bogus pytype errors in `mercurial/wireprotov1peer.py`
Matt Harbison <matt_harbison@yahoo.com> [Fri, 25 Oct 2024 23:45:05 -0400] rev 52130
typing: suppress bogus pytype errors in `mercurial/wireprotov1peer.py` Fixes: File "/mnt/c/Users/Matt/hg/mercurial/wireprotov1peer.py", line 100, in result: No attribute '_peerexecutor' on unsentfuture [attribute-error] File "/mnt/c/Users/Matt/hg/mercurial/wireprotov1peer.py", line 278, in close: No attribute 'shutdown' on None [attribute-error] Called from (traceback): line 123, in __exit__ File "/mnt/c/Users/Matt/hg/mercurial/wireprotov1peer.py", line 278, in close: No attribute 'shutdown' on None [attribute-error] In Optional[concurrent.futures.thread.ThreadPoolExecutor] We drop the zope decorator on `peerexecutor`, because otherwise it triggers this error: File "/tmp/mercurial-ci/mercurial/wireprotov1peer.py", line 111, in <module>: Invalid type annotation [invalid-annotation] Must be constant Not sure why, because the decorated classes usually get typed as `Any`, which would also be fine here.
Fri, 25 Oct 2024 23:09:10 -0400 tests: enable pytype checking on `mercurial/wireprotoframing.py`
Matt Harbison <matt_harbison@yahoo.com> [Fri, 25 Oct 2024 23:09:10 -0400] rev 52129
tests: enable pytype checking on `mercurial/wireprotoframing.py`
Fri, 25 Oct 2024 23:07:34 -0400 typing: suppress bogus pytype errors in `mercurial/wireprotoframing.py`
Matt Harbison <matt_harbison@yahoo.com> [Fri, 25 Oct 2024 23:07:34 -0400] rev 52128
typing: suppress bogus pytype errors in `mercurial/wireprotoframing.py` This fixes: File "/mnt/c/Users/Matt/hg/mercurial/wireprotoframing.py", line 480, in createalternatelocationresponseframe: unsupported operand type(s) for item assignment: bytes [unsupported-operands] No attribute '__setitem__' on bytes File "/mnt/c/Users/Matt/hg/mercurial/wireprotoframing.py", line 510, in createcommanderrorresponse: unsupported operand type(s) for item assignment: bytes [unsupported-operands] No attribute '__setitem__' on bytes File "/mnt/c/Users/Matt/hg/mercurial/wireprotoframing.py", line 776, in __init__: Can't find module 'mercurial.zstd'. [import-error] File "/mnt/c/Users/Matt/hg/mercurial/wireprotoframing.py", line 804, in __init__: Can't find module 'mercurial.zstd'. [import-error] File "/mnt/c/Users/Matt/hg/mercurial/wireprotoframing.py", line 834, in populatestreamencoders: Can't find module 'mercurial.zstd'. [import-error] Using `TypedDict` is tempting here to fix the first two, but requires str keys. The code doing the importing doesn't call the code at the other three locations if the `mercurial.zstd` module fails to import in a place that handles the ImportError.
Thu, 24 Oct 2024 22:47:31 -0400 wireprototypes: make `baseprotocolhandler` methods abstract
Matt Harbison <matt_harbison@yahoo.com> [Thu, 24 Oct 2024 22:47:31 -0400] rev 52127
wireprototypes: make `baseprotocolhandler` methods abstract The documentation says it's an abstract base class, so let's enforce it. The `typing.Protocol` class is already an ABC, but it only prevents instantiation if there are abstract attrs that are missing. For example, from `hg debugshell`: >>> from mercurial import wireprototypes >>> x = wireprototypes.baseprotocolhandler() Traceback (most recent call last): File "<console>", line 1, in <module> TypeError: Can't instantiate abstract class baseprotocolhandler with abstract method name >>> class fake(wireprototypes.baseprotocolhandler): ... pass ... >>> x = fake() Traceback (most recent call last): File "<console>", line 1, in <module> TypeError: Can't instantiate abstract class fake with abstract method name That's great, but it doesn't protect against calling non-abstract methods at runtime, rather it depends on the protocol type hint being added to method signatures or class attrs, and then running a type checker to notice when an instance is assigned that doesn't conform to the protocol. We don't widely use type hints yet, and do have a lot of class hierarchy in the repository area, which could lead to surprises like this: >>> class fake(wireprototypes.baseprotocolhandler): ... @property ... def name(self) -> bytes: ... return b'name' ... >>> z = fake() >>> z.client() >>> print(z.client()) None Oops. That was supposed to return `bytes`. So not only is a bad/unexpected value returned, but it's one that violates the type hints (since the base client() method will be annotated to return bytes). With this change, we get: >>> from mercurial import wireprototypes >>> class fake(wireprototypes.baseprotocolhandler): ... @property ... def name(self) -> bytes: ... return b'name' ... >>> x = fake() Traceback (most recent call last): File "<console>", line 1, in <module> TypeError: Can't instantiate abstract class fake with abstract methods addcapabilities, checkperm, client, getargs, getpayload, getprotocaps, mayberedirectstdio So this looks like a reasonable safety harness to me, and lets us catch problems by running the standard tests while the type hints are being added, and pytype is improved. We should probably do this for all Protocol class methods that don't supply a method implementation.
Thu, 24 Oct 2024 22:37:45 -0400 wireprototypes: convert `baseprotocolhandler.name` to an abstract property
Matt Harbison <matt_harbison@yahoo.com> [Thu, 24 Oct 2024 22:37:45 -0400] rev 52126
wireprototypes: convert `baseprotocolhandler.name` to an abstract property PyCharm was flagging the subclasses where this was declared as a `@property` with Type of 'name' is incompatible with 'baseprotocolhandler' But pytype didn't complain. This seems more correct, however. Since `Protocol` is already an `abc.ABCMeta` class, we don't need to mess with the class hierarchy.
Thu, 24 Oct 2024 20:50:47 -0400 wireprotoserver: subclass the new `baseprotocolhandler` Protocol class
Matt Harbison <matt_harbison@yahoo.com> [Thu, 24 Oct 2024 20:50:47 -0400] rev 52125
wireprotoserver: subclass the new `baseprotocolhandler` Protocol class
Thu, 24 Oct 2024 20:47:12 -0400 wireprototypes: convert `baseprotocolhandler` to a Protocol class
Matt Harbison <matt_harbison@yahoo.com> [Thu, 24 Oct 2024 20:47:12 -0400] rev 52124
wireprototypes: convert `baseprotocolhandler` to a Protocol class The methodology for doing this is now known, and this is limited to two implementing classes, so just make the changes.
Sat, 26 Oct 2024 12:56:02 +0200 test: stabilize `test-audit-path.t` in rust (hopefully)
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 26 Oct 2024 12:56:02 +0200] rev 52123
test: stabilize `test-audit-path.t` in rust (hopefully) We have been seeing flakiness on the file reported for a bit.
Sat, 26 Oct 2024 05:09:55 +0200 pycompat: drop test involving assigning "foo" to `sys.hexversion` stable
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 26 Oct 2024 05:09:55 +0200] rev 52122
pycompat: drop test involving assigning "foo" to `sys.hexversion` Starting with python 3.13, `sys.hexversion` refuse to be assigned non-hex value like "foo". I don't think I can blame it. It is time to drop that part of the tests.
Sat, 26 Oct 2024 05:11:58 +0200 pycompat: filter more of the traceback in `test-flagproccessor.t` stable
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 26 Oct 2024 05:11:58 +0200] rev 52121
pycompat: filter more of the traceback in `test-flagproccessor.t` The traceback changes again with 3.13. So we filter it to only keeps the bits we care about. This is actually only reusing the approach from a few line below.
Fri, 25 Oct 2024 00:46:22 +0200 pycompat: ignore the fork + thread warning for now stable
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 25 Oct 2024 00:46:22 +0200] rev 52120
pycompat: ignore the fork + thread warning for now No known issues has been reported and this is breaking the CI quite hard. So for now we have to delay the issue.
Thu, 24 Oct 2024 22:55:45 -0400 wireprototypes: fix exception handling code with a bad pytype suppression stable
Matt Harbison <matt_harbison@yahoo.com> [Thu, 24 Oct 2024 22:55:45 -0400] rev 52119
wireprototypes: fix exception handling code with a bad pytype suppression This goes back to f5fcf7123a92, and I suspect it was a misread of the error message is describes- the LHS of `.sorted()` is always bytes, and bytes didn't have this method in py2 either. The invalid names were already handled like this a few lines above. PyCharm flagged this, and it stood out after converting the zope interfaces to Protocol classes (which hasn't been published yet).
Fri, 18 Oct 2024 14:14:24 -0400 tests: conditionalize undesired output on Windows for rbc the mmap cases
Matt Harbison <matt_harbison@yahoo.com> [Fri, 18 Oct 2024 14:14:24 -0400] rev 52118
tests: conditionalize undesired output on Windows for rbc the mmap cases I don't want to lose sight of this issue, and it's useful to be able to turn on mmap support to hack on the underlying problem. As noted in the previous commit, I think the current usage of `mmap` and `memoryview` needs to be reworked for correctness on posix anyway.
Fri, 18 Oct 2024 13:21:23 -0400 rev-branch-cache: disable mmapping by default on Windows
Matt Harbison <matt_harbison@yahoo.com> [Fri, 18 Oct 2024 13:21:23 -0400] rev 52117
rev-branch-cache: disable mmapping by default on Windows See the inline comment for why. The commands work, other than leaving extra files laying around. Perhaps there's some way to get this to work like on posix with some `CreateFile` magic (though it already uses `FILE_SHARE_DELETE`, so I'm not sure offhand what else we can do). However big picture- it seems wrong that the old file is left mmapped, a new one moved into place, and the mapping left over the old file instead of retargeted to the new file. That's got to be a bug on posix too, in a long running process like chg, right? If the memory is read again for some reason, it will be stale data.
Fri, 18 Oct 2024 13:45:13 -0400 tests: actually test the non-mmap case in `test-branches.t`
Matt Harbison <matt_harbison@yahoo.com> [Fri, 18 Oct 2024 13:45:13 -0400] rev 52116
tests: actually test the non-mmap case in `test-branches.t` It looks like 40943970b7ae renamed the config, but also flipped it to 'on' by default, and the test file didn't keep up. I noticed because all 4 test cases failed on Windows due to a mmap problem, and there only should have been 2.
Thu, 17 Oct 2024 15:34:45 -0400 tests: dump the http server log after a clone in `test-static-http.t`
Matt Harbison <matt_harbison@yahoo.com> [Thu, 17 Oct 2024 15:34:45 -0400] rev 52115
tests: dump the http server log after a clone in `test-static-http.t` The 404 message lines don't match `$LOGDATE$`, because that tests for a pattern from the first "-" through a "(GET|PUT|POST)", so glob the timestamp away manually.
Thu, 17 Oct 2024 15:21:20 -0400 tests: force `dumbhttp.py` to write its log file with '\n' on Windows
Matt Harbison <matt_harbison@yahoo.com> [Thu, 17 Oct 2024 15:21:20 -0400] rev 52114
tests: force `dumbhttp.py` to write its log file with '\n' on Windows This wasn't causing obvious test failures, but it's the same fix as dbd2d56224d1 for `dummysmtpd.py`, and there's no sense in leaving this problem lying around. (And upon further review, it might have been causing some non-obviously related failures- see the next commit.)
Sat, 26 Oct 2024 04:16:00 +0200 branching: merge stable into default
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 26 Oct 2024 04:16:00 +0200] rev 52113
branching: merge stable into default
Thu, 11 Jan 2024 20:37:34 +0100 rust: address 'error: unnecessarily eager cloning of iterator items' stable
Mads Kiilerich <mads@kiilerich.com> [Thu, 11 Jan 2024 20:37:34 +0100] rev 52112
rust: address 'error: unnecessarily eager cloning of iterator items' Build failed with a reference to https://rust-lang.github.io/rust-clippy/master/index.html#iter_overeager_cloned which seems reasonable. There doesn't seem to be any reason to not follow the advice.
Mon, 22 Jul 2024 18:20:03 +0200 utils: fix resourceutil use of deprecated importlib.resources stable
Mads Kiilerich <mads@kiilerich.com> [Mon, 22 Jul 2024 18:20:03 +0200] rev 52111
utils: fix resourceutil use of deprecated importlib.resources Some importlib functionality was deprecated in 3.11 . The documentation on https://docs.python.org/3.12/library/importlib.resources.html recommends using the new .files() API that was introduced in 3.9.
Tue, 27 Jun 2023 13:05:03 +0200 utils: avoid using internal _imp.is_frozen() stable
Mads Kiilerich <mads@kiilerich.com> [Tue, 27 Jun 2023 13:05:03 +0200] rev 52110
utils: avoid using internal _imp.is_frozen() imp has been deprecated for a long time, and were removed in Python 3.12 . As a workaround, we started using the internal _imp. That is ugly and risky. It seems less risky to get the functionality in some other way. Here, we just inspect if 'origin' of the '__main__' module is set and 'frozen'. That seems to work and do the same, and might be better than using the internal _imp directly. This way of inspecting module attributes seems to work in some test cases, but it is a risky change. This level of importlib doesn't have much documentation, a complicated implementation, and we are dealing with some odd use cases.
Thu, 11 Jan 2024 20:32:07 +0100 cext: use sys.executable instead of deprecated Py_GetProgramFullPath stable
Mads Kiilerich <mads@kiilerich.com> [Thu, 11 Jan 2024 20:32:07 +0100] rev 52109
cext: use sys.executable instead of deprecated Py_GetProgramFullPath Fix warning with Python 3.13: mercurial/cext/parsers.c: In function 'check_python_version': mercurial/cext/parsers.c:1243:30: warning: 'Py_GetProgramFullPath' is deprecated [-Wdeprecated-declarations] 1243 | Py_GetProgramFullPath()); | ^~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/python3.13/Python.h:119, from mercurial/cext/parsers.c:11: /usr/include/python3.13/pylifecycle.h:43:43: note: declared here 43 | Py_DEPRECATED(3.13) PyAPI_FUNC(wchar_t *) Py_GetProgramFullPath(void); | ^~~~~~~~~~~~~~~~~~~~~ At this point in time, the PyConfig struct memory has been released and the PyConfig API can't be used. https://docs.python.org/3.13/c-api/init.html#c.Py_GetProgramFullPath recommands using sys.executable instead. Let's assume that will work in all versions. It would perhaps be better to use PySys_GetObject, but I prefer to stay consistent with how the same function is retrieving sys.hexversion.
Thu, 11 Jan 2024 21:58:55 +0100 subrepoutil: pass re.sub 'count' argument by name stable
Mads Kiilerich <mads@kiilerich.com> [Thu, 11 Jan 2024 21:58:55 +0100] rev 52108
subrepoutil: pass re.sub 'count' argument by name Python 3.13 started warning: DeprecationWarning: 'count' is passed as positional argument
Thu, 11 Jan 2024 21:58:55 +0100 tests: pass re.MULTILINE to re.sub as 'flags' - not in 'count' position stable
Mads Kiilerich <mads@kiilerich.com> [Thu, 11 Jan 2024 21:58:55 +0100] rev 52107
tests: pass re.MULTILINE to re.sub as 'flags' - not in 'count' position This bug was caught by the new Python 3.13 warning: DeprecationWarning: 'count' is passed as positional argument
Thu, 29 Jun 2023 20:02:27 +0200 tests: use packaging from setuptools instead of deprecated distutils stable
Mads Kiilerich <mads@kiilerich.com> [Thu, 29 Jun 2023 20:02:27 +0200] rev 52106
tests: use packaging from setuptools instead of deprecated distutils When invoking StrictVersion in 3.12 we got: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead. distutils is dead in the standard library, and we have to move towards using `setuptools` as general extern dependency. Instead of also requiring the extern `packaging`, we will just use the packaging that is vendored in setuptools.
Mon, 26 Jun 2023 15:16:51 +0200 tests: drop test-demandimport.py distutils test that failed with warnings stable
Mads Kiilerich <mads@kiilerich.com> [Mon, 26 Jun 2023 15:16:51 +0200] rev 52105
tests: drop test-demandimport.py distutils test that failed with warnings The test would fail because warnings: /usr/lib/python3.11/site-packages/_distutils_hack/__init__.py:18: UserWarning: Distutils was imported before Setuptools, but importing Setuptools also replaces the `distutils` module in `sys.modules`. This may lead to undesirable behaviors or errors. To avoid these issues, avoid using distutils directly, ensure that setuptools is installed in the traditional way (e.g. not an editable install), and/or make sure that setuptools is always imported before distutils. warnings.warn( /usr/lib/python3.11/site-packages/_distutils_hack/__init__.py:33: UserWarning: Setuptools is replacing distutils. warnings.warn("Setuptools is replacing distutils.") The test for distutils.msvc9compiler comes from 2205d00b6d2b. But since then, distutils is going away, and this test must change somehow. It is unclear exactly how setuptools depended on msvc9compiler, but setuptools also moved forward, and this exact test no longer seems relevant. It thus seems like a fair solution to remove the test while keeping the demandimport blacklist of distutils.msvc9compiler.
Thu, 29 Jun 2023 20:02:27 +0200 utils: test coverage of makedate stable
Mads Kiilerich <mads@kiilerich.com> [Thu, 29 Jun 2023 20:02:27 +0200] rev 52104
utils: test coverage of makedate Explore the scenario from ae04af1ce78d to avoid future regressions. This was intended to give some coverage of the change in faccec1edc2c.
Sat, 26 Oct 2024 02:04:31 +0200 filecache: use bytes wherever possible in the tests
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 26 Oct 2024 02:04:31 +0200] rev 52103
filecache: use bytes wherever possible in the tests This is closer than the actual usage, so I figured in would not hurt.
Sat, 26 Oct 2024 01:38:20 +0200 cachestat: avoid creating cachestat for http path
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 26 Oct 2024 01:38:20 +0200] rev 52102
cachestat: avoid creating cachestat for http path The statichttprepo repo attemp to create cachestat for content we access through http. We modify the couple of place create cachestat object to detect this situation and avoids it. This is not marvelous, but there is few of them and the freeze is looming. This helps on Windows where calling cachestat on http path might create issues.
Sat, 26 Oct 2024 02:03:54 +0200 filecache: use binary path in the test
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 26 Oct 2024 02:03:54 +0200] rev 52101
filecache: use binary path in the test This was overlooked when converting string. This is needed as we are about to introduce bytes specific code in the filecache code path.
Sat, 26 Oct 2024 00:58:01 +0200 branching: merge stable into default
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 26 Oct 2024 00:58:01 +0200] rev 52100
branching: merge stable into default
Thu, 24 Oct 2024 15:23:52 +0200 py-3-13: stabilize the docstring output across all supported Python versions
Raphaël Gomès <rgomes@octobus.net> [Thu, 24 Oct 2024 15:23:52 +0200] rev 52099
py-3-13: stabilize the docstring output across all supported Python versions Python 3.13 now trims indents from docstrings at compilation time (to save space in .pyc), so all of our helptext is affected. The indentation has never served a user-facing purpose and was more here because nobody cared enough to remove it: we gain some screen space this way. Rather than undo the transformation (which isn't really possible since the transform also deletes leading/trailing whitespace), we align the behavior of older Python versions with that of 3.13. Unfortunately, this means breaking some of the translations. I've only touched the ones that need to work for some tooling tests to pass, but I do not have the time to fix the rest of them across all languages, since they cannot be done in an automated way. i18n updates have been basically abandonned for a good while now, hopefully someone cares enough to bring them back.
Fri, 25 Oct 2024 23:54:24 +0200 docstring: backed out changeset 51057ab0dffa stable
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 25 Oct 2024 23:54:24 +0200] rev 52098
docstring: backed out changeset 51057ab0dffa In retrospect this is too much of a behavior change for stable. So I grafted the same change as 31076a2301f1 on default, and I am backing out its version on stable.
Tue, 15 Oct 2024 22:30:10 -0400 tests: stabilize `test-clonebundles-autogen.t` on Windows
Matt Harbison <matt_harbison@yahoo.com> [Tue, 15 Oct 2024 22:30:10 -0400] rev 52097
tests: stabilize `test-clonebundles-autogen.t` on Windows The problem was that the commands are spun up with `shell=True`, which uses `cmd.exe`, which doesn't understand `$foo` style variables. The HGCB variable expansion has to be delayed, because it's figured out right before launching the command. We could probably add a conditional for Windows, and rewrite the config to use `%foo%` style variables, but it's more maintainable to just wrap the command in a bash shell invocation. The forward style slashes in the path are needed to avoid accruing double backslashes (when switching between shells- the url template seems fine). Also need to strong quote the command so that the double quotes don't get stripped off of `$HGCB_BUNDLE_PATH`, which results in: sh: 1: Syntax error: Unterminated quoted string abort: command returned status 2: sh -c "cp $HGCB_BUNDLE_PATH $TESTTMP/final-upload/"
Tue, 15 Oct 2024 22:19:30 -0400 clonebundles: stop shell quoting `HGCB_BUNDLE_BASENAME` environment variable
Matt Harbison <matt_harbison@yahoo.com> [Tue, 15 Oct 2024 22:19:30 -0400] rev 52096
clonebundles: stop shell quoting `HGCB_BUNDLE_BASENAME` environment variable This causes problems in `test-clonebundles-autogen.t` on Windows, because the quoted path ends up being passed to the `cp` command, which fails, because quote characters are not a legal part of a file name. I don't see any quoting in environment variables on either MSYS or WSL, even with weird ones that appear to have escape sequences like `PS1=\[\033]0;$MSYSTEM:\w\007` (in MSYS). The quoting was added back in 5ae30ff79c76, and as shown here, was causing problems even on posix when a quote was slipped into the path. (The other obvious problem is that the command is spun up shell style, which invokes `cmd.exe`, which doesn't know about `$foo` style variables. That will be addressed next, but that change didn't work without this too.)
Mon, 21 Oct 2024 15:24:55 -0400 tests: add coverage to for `HGCB_BUNDLE_BASENAME` with special characters
Matt Harbison <matt_harbison@yahoo.com> [Mon, 21 Oct 2024 15:24:55 -0400] rev 52095
tests: add coverage to for `HGCB_BUNDLE_BASENAME` with special characters Per request on IRC, to show the behavior of dropping the quoting of `HGCB_BUNDLE_BASENAME` in the next commit. This current failure is basically the same error and output that currently happens on Windows with any path (even without the embedded quote). The only difference is Windows doesn't print the `cp: cannot stat ...` line.
Tue, 15 Oct 2024 18:58:47 -0400 tests: stabilize `test-eol-update.t` on Windows
Matt Harbison <matt_harbison@yahoo.com> [Tue, 15 Oct 2024 18:58:47 -0400] rev 52094
tests: stabilize `test-eol-update.t` on Windows Perhaps it's better if this doesn't happen, but there are a bunch of tests that spew this, and we already have a conditional match for this in the block prior to the comment right above this section. So accept it as a possibility, and reduce the noise in the Windows tests.
Tue, 15 Oct 2024 18:35:45 -0400 tests: force `dummysmtpd.py` to write its log file with '\n' on Windows
Matt Harbison <matt_harbison@yahoo.com> [Tue, 15 Oct 2024 18:35:45 -0400] rev 52093
tests: force `dummysmtpd.py` to write its log file with '\n' on Windows The log files were being `cat'd` in `test-patchbomb-tls.t`, and causing gratuitous failures. Since `sys.stdout` is being written to with `str` instead of `bytes`, use a `io.TextIOWrapper` to change the EOL, like 2924676d4728.
Mon, 14 Oct 2024 20:11:27 -0400 tests: raise the default value for the various `devel.sync.*-timeout` configs
Matt Harbison <matt_harbison@yahoo.com> [Mon, 14 Oct 2024 20:11:27 -0400] rev 52092
tests: raise the default value for the various `devel.sync.*-timeout` configs These are used in `mercurial.testing.wait_file()` to stall for a file to appear in the filesystem, and raise an error if the file doesn't show up before the timeout expires. The default of 2s was way too low on Windows, especially when running tests in parallel, and resulted in various timeouts in `test-dirstate-read-race.t`, `test-dirstate-status-write-race.t`, and `test-clone-stream-revlog-split.t`. The various `wait-on-file` invocations in the tests are inconsistent, and wait anywhere from 5s - 20s. I'm using 20s here because if everything is working, the timeout won't matter. Also with the default timeout being raised on Windows in f4c038081561, both `HGTEST_TIMEOUT_DEFAULT` and `HGTEST_TIMEOUT` are 1440 in the default case where the timeout is not specified on the command line of the test runner, so the timing factor that is multipled with the value is 1, resulting in no changes. (But if someone specified a lower value on the command line, that would *lower* the timeout period used.)
Tue, 22 Oct 2024 15:59:01 +0200 tests: remove deprecated test-check-py3-compat.t
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 22 Oct 2024 15:59:01 +0200] rev 52091
tests: remove deprecated test-check-py3-compat.t If our current source files were not compatible with Python 3, we would know by now. This check has not been relevant for a couple of years now and we can safely remove it.
Thu, 24 Oct 2024 18:58:58 +0200 zope-interface: add compatibility with 3.13 compiler attributes stable
Raphaël Gomès <rgomes@octobus.net> [Thu, 24 Oct 2024 18:58:58 +0200] rev 52090
zope-interface: add compatibility with 3.13 compiler attributes We could follow-up with an actual vendoring update from the newest version of zope-interface in the new cycle since we're dropping 3.7 and down. However we are also in the process of replacing zope-interface with Protocol, so hopefully we can simply drop the zope-interface vendoring.
Thu, 24 Oct 2024 15:35:45 +0200 py-3-13: fix traceback matching for the new Python version stable
Raphaël Gomès <rgomes@octobus.net> [Thu, 24 Oct 2024 15:35:45 +0200] rev 52089
py-3-13: fix traceback matching for the new Python version
Thu, 24 Oct 2024 15:23:52 +0200 py-3-13: stabilize the docstring output across all supported Python versions stable
Raphaël Gomès <rgomes@octobus.net> [Thu, 24 Oct 2024 15:23:52 +0200] rev 52088
py-3-13: stabilize the docstring output across all supported Python versions Python 3.13 now trims indents from docstrings at compilation time (to save space in .pyc), so all of our helptext is affected. The indentation has never served a user-facing purpose and was more here because nobody cared enough to remove it: we gain some screen space this way. Rather than undo the transformation (which isn't really possible since the transform also deletes leading/trailing whitespace), we align the behavior of older Python versions with that of 3.13. Unfortunately, this means breaking some of the translations. I've only touched the ones that need to work for some tooling tests to pass, but I do not have the time to fix the rest of them across all languages, since they cannot be done in an automated way. i18n updates have been basically abandonned for a good while now, hopefully someone cares enough to bring them back.
Thu, 24 Oct 2024 18:04:26 +0200 test-lfs-serve-access: vastly simplify the error output check stable
Raphaël Gomès <rgomes@octobus.net> [Thu, 24 Oct 2024 18:04:26 +0200] rev 52087
test-lfs-serve-access: vastly simplify the error output check The traceback differences between all supported Python versions is about to become insane to handle, so let's check what we're actually looking to check.
Sun, 31 Mar 2024 17:57:46 -0300 subrepo: propagate non-default path on outgoing stable
Felipe Resende <felipe@fcresende.dev.br> [Sun, 31 Mar 2024 17:57:46 -0300] rev 52086
subrepo: propagate non-default path on outgoing There was already a fix made in 5dbff89cf107 for pull and push commands. I did the same for the outgoing command. The problem I identified is that when the parent repository has multiple paths, the outgoing command was not respecting the parent path used and was always using the default path for subrepositories.
Fri, 25 Oct 2024 01:14:53 +0200 outgoing: pre-indent some code stable
Felipe Resende <felipe@fcresende.dev.br> [Fri, 25 Oct 2024 01:14:53 +0200] rev 52085
outgoing: pre-indent some code This will make the next changeset clearer.
Fri, 25 Oct 2024 01:23:24 +0200 outgoing: move sorting in the display function stable
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 25 Oct 2024 01:23:24 +0200] rev 52084
outgoing: move sorting in the display function This make the core code simpler.
Fri, 25 Oct 2024 01:04:38 +0200 outgoing: extract changeset display in its own function stable
Felipe Resende <felipe@fcresende.dev.br> [Fri, 25 Oct 2024 01:04:38 +0200] rev 52083
outgoing: extract changeset display in its own function This will clarify future patches.
Tue, 11 Jun 2024 14:35:52 +0200 subrepo: move code around stable
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 11 Jun 2024 14:35:52 +0200] rev 52082
subrepo: move code around
Thu, 24 Oct 2024 17:35:53 +0200 merge: add a config to allow conflict-free merge of changes on adjacent lines
Arseniy Alekseyev <aalekseyev@janestreet.com [Thu, 24 Oct 2024 17:35:53 +0200] rev 52081
merge: add a config to allow conflict-free merge of changes on adjacent lines This change adds a config to make it no longer a conflict to merge changes made on adjacent lines. The reason these changes are considered a conflict is that there's no region of text at the relevant position (sync region) that's kept unchanged by both sides of the merge. The problem can be solved by making the sync regions being a bit more powerful: we can keep a 0-length sync region if we find that a block unchanged by one side is ajacent to a block unchanged by the other side. Since these 0-length sync regions are emitted using the ~same algorithm as the normal non-empty sync regions, this change involves no arbitrary decisions and I expect it to work pretty well. 0-length sync regions do create an ambiguity in a special case where two pairs of adjacent regions "meet" at the same point. This corresponds to an insertion made at the same place by the two sides of the merge, and this still results in a conflict.
Wed, 23 Oct 2024 17:08:57 -0400 localrepo: drop the CamelCase name for `localrepo.ilocalrepositorymain`
Matt Harbison <matt_harbison@yahoo.com> [Wed, 23 Oct 2024 17:08:57 -0400] rev 52080
localrepo: drop the CamelCase name for `localrepo.ilocalrepositorymain` See 61557734c0ae for the reasoning. This one is slightly different, however, because the `localrepository` class already subclasses the interface class in the type checking phase.
Wed, 23 Oct 2024 17:04:59 -0400 localrepo: drop the CamelCase name for `localrepo.revlognarrowfilestorage`
Matt Harbison <matt_harbison@yahoo.com> [Wed, 23 Oct 2024 17:04:59 -0400] rev 52079
localrepo: drop the CamelCase name for `localrepo.revlognarrowfilestorage` See 61557734c0ae for the reasoning.
Wed, 23 Oct 2024 17:03:33 -0400 localrepo: drop the CamelCase name for `localrepo.revlogfilestorage`
Matt Harbison <matt_harbison@yahoo.com> [Wed, 23 Oct 2024 17:03:33 -0400] rev 52078
localrepo: drop the CamelCase name for `localrepo.revlogfilestorage` See 61557734c0ae for the reasoning.
Wed, 23 Oct 2024 17:01:35 -0400 localrepo: drop the CamelCase name for `localrepo.locallegacypeer`
Matt Harbison <matt_harbison@yahoo.com> [Wed, 23 Oct 2024 17:01:35 -0400] rev 52077
localrepo: drop the CamelCase name for `localrepo.locallegacypeer` See 61557734c0ae for the reasoning.
Wed, 23 Oct 2024 16:59:43 -0400 localrepo: drop the CamelCase name for `localrepo.localpeer`
Matt Harbison <matt_harbison@yahoo.com> [Wed, 23 Oct 2024 16:59:43 -0400] rev 52076
localrepo: drop the CamelCase name for `localrepo.localpeer` See 61557734c0ae for the reasoning.
Wed, 23 Oct 2024 16:51:18 -0400 localrepo: drop the CamelCase name for `localrepo.localcommandexecutor`
Matt Harbison <matt_harbison@yahoo.com> [Wed, 23 Oct 2024 16:51:18 -0400] rev 52075
localrepo: drop the CamelCase name for `localrepo.localcommandexecutor` See 61557734c0ae for the reasoning.
Wed, 23 Oct 2024 16:48:46 -0400 manifest: drop the CamelCase name for `manifest.treemanifestctx`
Matt Harbison <matt_harbison@yahoo.com> [Wed, 23 Oct 2024 16:48:46 -0400] rev 52074
manifest: drop the CamelCase name for `manifest.treemanifestctx` See 61557734c0ae for the reasoning.
Wed, 23 Oct 2024 16:45:12 -0400 manifest: drop the CamelCase name for `manifest.memtreemanifestctx`
Matt Harbison <matt_harbison@yahoo.com> [Wed, 23 Oct 2024 16:45:12 -0400] rev 52073
manifest: drop the CamelCase name for `manifest.memtreemanifestctx` See 61557734c0ae for the reasoning.
Wed, 23 Oct 2024 16:43:22 -0400 manifest: drop the CamelCase name for `manifest.manifestctx`
Matt Harbison <matt_harbison@yahoo.com> [Wed, 23 Oct 2024 16:43:22 -0400] rev 52072
manifest: drop the CamelCase name for `manifest.manifestctx` See 61557734c0ae for the reasoning.
Wed, 23 Oct 2024 16:41:02 -0400 manifest: drop the CamelCase name for `manifest.memmanifestctx`
Matt Harbison <matt_harbison@yahoo.com> [Wed, 23 Oct 2024 16:41:02 -0400] rev 52071
manifest: drop the CamelCase name for `manifest.memmanifestctx` See 61557734c0ae for the reasoning.
Wed, 23 Oct 2024 16:39:12 -0400 manifest: drop the CamelCase name for `manifest.manifestlog`
Matt Harbison <matt_harbison@yahoo.com> [Wed, 23 Oct 2024 16:39:12 -0400] rev 52070
manifest: drop the CamelCase name for `manifest.manifestlog` See 61557734c0ae for the reasoning.
Wed, 23 Oct 2024 16:36:50 -0400 manifest: drop the CamelCase name for `manifest.manifestrevlog`
Matt Harbison <matt_harbison@yahoo.com> [Wed, 23 Oct 2024 16:36:50 -0400] rev 52069
manifest: drop the CamelCase name for `manifest.manifestrevlog` See 61557734c0ae for the reasoning.
Wed, 23 Oct 2024 16:32:34 -0400 manifest: drop the CamelCase name for `manifest.treemanifest`
Matt Harbison <matt_harbison@yahoo.com> [Wed, 23 Oct 2024 16:32:34 -0400] rev 52068
manifest: drop the CamelCase name for `manifest.treemanifest` See 61557734c0ae for the reasoning.
Wed, 23 Oct 2024 16:30:23 -0400 manifest: drop the CamelCase name for `manifest.manifestdict`
Matt Harbison <matt_harbison@yahoo.com> [Wed, 23 Oct 2024 16:30:23 -0400] rev 52067
manifest: drop the CamelCase name for `manifest.manifestdict` See 61557734c0ae for the reasoning.
Wed, 23 Oct 2024 16:24:18 -0400 filelog: drop the CamelCase name for `filelog.filelog`
Matt Harbison <matt_harbison@yahoo.com> [Wed, 23 Oct 2024 16:24:18 -0400] rev 52066
filelog: drop the CamelCase name for `filelog.filelog` See 61557734c0ae for the reasoning.
Wed, 23 Oct 2024 16:22:21 -0400 revlog: drop the CamelCase name for `revlog.revlogproblem`
Matt Harbison <matt_harbison@yahoo.com> [Wed, 23 Oct 2024 16:22:21 -0400] rev 52065
revlog: drop the CamelCase name for `revlog.revlogproblem` See 61557734c0ae for the reasoning.
Wed, 23 Oct 2024 16:19:24 -0400 revlog: drop the CamelCase name for `revlog.revlogrevisiondelta`
Matt Harbison <matt_harbison@yahoo.com> [Wed, 23 Oct 2024 16:19:24 -0400] rev 52064
revlog: drop the CamelCase name for `revlog.revlogrevisiondelta` These CamelCase names popped up this cycle because pytype was getting confused by the zope decorator, and so the decoration was decoupled from the class declaration. We're in the process of switching all of the zope interfaces to `typing.Protocol` classes, but we're up against the code freeze. It would be nice to use CamelCase for protocol classes (or classes in general), but let's reset to a consistent state and buy some more time to think about this. Since we're moving to Protocol classes and I disabled the interface tests back in ef7d85089952, I'm not bothering to re-add the decorator, and re-confuse pytype. But do place the interface next to the class, so that these places can be found with the `grep` when the time comes to subclass.
Wed, 23 Oct 2024 16:14:13 +0200 tests: use pyflakes as a tool, not a python module
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 23 Oct 2024 16:14:13 +0200] rev 52063
tests: use pyflakes as a tool, not a python module The usage of pyflakes as a Python module was introduced in e397c6d74652, to work around issue between Python 2 and Python 3. This issues are long behind us now and we can get beck to using pyflakes as a tool, giving us more flexibility about how we install it. The `hghave` requirements is modified to check that we have a tool available, instead of a python module.
Tue, 22 Oct 2024 15:50:47 +0200 clang-format: do not accept version above 19.x
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 22 Oct 2024 15:50:47 +0200] rev 52062
clang-format: do not accept version above 19.x This gives me different formatting on latest version available in Debian. So disabling for now.
Wed, 16 Oct 2024 17:21:03 +0200 rust-update: add a config item to disable the Rust update fastpath
Raphaël Gomès <rgomes@octobus.net> [Wed, 16 Oct 2024 17:21:03 +0200] rev 52061
rust-update: add a config item to disable the Rust update fastpath Explanations inline.
Tue, 01 Oct 2024 13:49:11 +0200 update: add a Rust fast-path when updating from null (and clean)
Raphaël Gomès <rgomes@octobus.net> [Tue, 01 Oct 2024 13:49:11 +0200] rev 52060
update: add a Rust fast-path when updating from null (and clean) This case is easy to detect and we have all we need to generate a valid working copy and dirstate entirely in Rust, which speeds things up considerably: On my machine updating a repo of ~300k files goes from 10.00s down to 4.2s, all while consuming 50% less system time, with all caches hot. Something to note is that further improvements will probably happen with the upcoming `InnerRevlog` series that does smarter mmap hanlding, especially for filelogs. Here are benchmark numbers on a machine with only 4 cores (and no SMT enabled) ``` ### data-env-vars.name = heptapod-public-2024-03-25-ds2-pnm # benchmark.name = hg.command.update # bin-env-vars.hg.py-re2-module = default # bin-env-vars.hg.changeset.node = <this change> # benchmark.variants.atomic-update = no # benchmark.variants.scenario = null-to-tip # benchmark.variants.worker = default default: 5.328762 ~~~~~ rust: 1.308654 (-75.44%, -4.02) ### data-env-vars.name = mercurial-devel-2024-03-22-ds2-pnm # benchmark.name = hg.command.update # bin-env-vars.hg.py-re2-module = default # bin-env-vars.hg.changeset.node = <this change> # benchmark.variants.atomic-update = no # benchmark.variants.scenario = null-to-tip # benchmark.variants.worker = default default: 1.693271 ~~~~~ rust: 1.151053 (-32.02%, -0.54) ### data-env-vars.name = mozilla-unified-2024-03-22-ds2-pnm # benchmark.name = hg.command.update # bin-env-vars.hg.py-re2-module = default # bin-env-vars.hg.changeset.node = <this change> # benchmark.variants.atomic-update = no # benchmark.variants.scenario = null-to-tip # benchmark.variants.worker = default default: 38.901613 ~~~~~ rust: 11.637880 (-70.08%, -27.26) ### data-env-vars.name = netbsd-xsrc-public-2024-09-19-ds2-pnm # benchmark.name = hg.command.update # bin-env-vars.hg.py-re2-module = default # bin-env-vars.hg.changeset.node = <this change> # benchmark.variants.atomic-update = no # benchmark.variants.scenario = null-to-tip # benchmark.variants.worker = default default: 4.793727 ~~~~~ rust: 1.505905 (-68.59%, -3.29) ```
Wed, 16 Oct 2024 19:14:30 +0200 merge: improve working-copy mtime race handling
Raphaël Gomès <rgomes@octobus.net> [Wed, 16 Oct 2024 19:14:30 +0200] rev 52059
merge: improve working-copy mtime race handling Explanations inline. This also makes use of `make_mtime_reliable`, which unifies our mtime raciness logic from the status. On top of this, this fixes the handling of the pure dirstate status to better catch racy status, as we've been doing in Rust for a long time now.
Wed, 16 Oct 2024 18:56:19 +0200 merge: move the filtering of ambiguous files to a dedicated function
Raphaël Gomès <rgomes@octobus.net> [Wed, 16 Oct 2024 18:56:19 +0200] rev 52058
merge: move the filtering of ambiguous files to a dedicated function I have multiple reasons: - The body of `_update` is way too long - This adds typing which will help our tooling and brains understand this code more easily - This function will get more nested and complex in the next patch I've taken the liberty of rewrapping and typo-passing the docstring.
Wed, 16 Oct 2024 18:41:49 +0200 timestamp: make the reliable comparison more usable from outside
Raphaël Gomès <rgomes@octobus.net> [Wed, 16 Oct 2024 18:41:49 +0200] rev 52057
timestamp: make the reliable comparison more usable from outside This is going to be used with pre-computed times unlike in status.
Wed, 16 Oct 2024 18:40:59 +0200 timestamp: add type information to the module
Raphaël Gomès <rgomes@octobus.net> [Wed, 16 Oct 2024 18:40:59 +0200] rev 52056
timestamp: add type information to the module This is easy to do and helps both Pytype and developpers understand what objects they are dealing with.
Wed, 16 Oct 2024 17:19:38 +0200 rust-dirstate: make the reliable timestamp comparison more usable from outside
Raphaël Gomès <rgomes@octobus.net> [Wed, 16 Oct 2024 17:19:38 +0200] rev 52055
rust-dirstate: make the reliable timestamp comparison more usable from outside This is going to be used with pre-computed times unlike in status.
Thu, 03 Oct 2024 16:35:31 +0200 rust-dirstate-map: use a more precise identity
Raphaël Gomès <rgomes@octobus.net> [Thu, 03 Oct 2024 16:35:31 +0200] rev 52054
rust-dirstate-map: use a more precise identity This is closer to the behavior of what Python does. So far, we were checking only the inode, but this might not be good enough for the v1 case.
Mon, 14 Oct 2024 14:14:21 +0200 dirstate-map: add a missing debug wait point when accessing the v2 docket
Raphaël Gomès <rgomes@octobus.net> [Mon, 14 Oct 2024 14:14:21 +0200] rev 52053
dirstate-map: add a missing debug wait point when accessing the v2 docket fc8e37c380d3 added synchronization points to the dirstate to allow for race condition testing without actually requiring a time-based race condition to happen. This changes adds the `pre-read-file` wait point before we read the docket, since callers might ask for the parents before anything else is read, leading to the first read being done before the wait point. This removes some differences in test output which were presumed to be speed related, but weren't.
Thu, 03 Oct 2024 00:31:25 +0200 rust-parsers: use the same error message as with the higher-level code
Raphaël Gomès <rgomes@octobus.net> [Thu, 03 Oct 2024 00:31:25 +0200] rev 52052
rust-parsers: use the same error message as with the higher-level code This can happen at two places, but it's not really enough time to justify it being refactored. Let's ensure we have the same error message, the newer one being slightly more helpful.
Thu, 03 Oct 2024 01:52:44 +0200 rust-pathauditor: make sure we actually test the nested repo case
Raphaël Gomès <rgomes@octobus.net> [Thu, 03 Oct 2024 01:52:44 +0200] rev 52051
rust-pathauditor: make sure we actually test the nested repo case This covers the *on-disk* case, where the path itself does not have a `.hg` component.
Wed, 02 Oct 2024 20:29:48 +0200 rust-pathauditor: match more of Python's behavior and display messages
Raphaël Gomès <rgomes@octobus.net> [Wed, 02 Oct 2024 20:29:48 +0200] rev 52050
rust-pathauditor: match more of Python's behavior and display messages We will make use of the path auditor when running our update fast-path, and we want to output of it to be close enough.
Wed, 02 Oct 2024 18:31:32 +0200 rust-dirstate: pass dirstate tracked key from the requirements
Raphaël Gomès <rgomes@octobus.net> [Wed, 02 Oct 2024 18:31:32 +0200] rev 52049
rust-dirstate: pass dirstate tracked key from the requirements We will make use of this with the `hg update` fastpath
Wed, 02 Oct 2024 13:39:43 +0200 rust-files: check for empty manifests caused by narrow
Raphaël Gomès <rgomes@octobus.net> [Wed, 02 Oct 2024 13:39:43 +0200] rev 52048
rust-files: check for empty manifests caused by narrow Explanations inline
Wed, 02 Oct 2024 13:36:51 +0200 rust-repo: don't use on-disk dirstate parents in v1
Raphaël Gomès <rgomes@octobus.net> [Wed, 02 Oct 2024 13:36:51 +0200] rev 52047
rust-repo: don't use on-disk dirstate parents in v1 This mistake was not causing any problems yet since we were never updating parents from Rust code. This is about to change, so let's fix it.
Tue, 01 Oct 2024 13:45:18 +0200 rust-cpython: add a util to get a `Repo` from a python path
Raphaël Gomès <rgomes@octobus.net> [Tue, 01 Oct 2024 13:45:18 +0200] rev 52046
rust-cpython: add a util to get a `Repo` from a python path I suspect this will not be the last time we need to do something like this.
Tue, 01 Oct 2024 13:20:40 +0200 rust: improve `InvalidRevision` error message
Raphaël Gomès <rgomes@octobus.net> [Tue, 01 Oct 2024 13:20:40 +0200] rev 52045
rust: improve `InvalidRevision` error message I encountered this when debugging earlier and felt like we were losing some information along the way, which we were!
Mon, 30 Sep 2024 17:19:35 +0200 rust-dirstate: use a struct as arguments for the high-level `reset_state`
Raphaël Gomès <rgomes@octobus.net> [Mon, 30 Sep 2024 17:19:35 +0200] rev 52044
rust-dirstate: use a struct as arguments for the high-level `reset_state` This makes the interface a lot clearer at the call site and prevents silly mistakes, as an API with a bunch of booleans is prone to errors. This refactor adds a `from_empty` parameter for a fast-path when resetting and entry we're sure does not exist. It will be used in the upcoming update Rust fastpath, and was not split to prevent more churn.
Mon, 30 Sep 2024 16:55:11 +0200 rust: implement `From<SparseConfigWarning>` for `HgError`
Raphaël Gomès <rgomes@octobus.net> [Mon, 30 Sep 2024 16:55:11 +0200] rev 52043
rust: implement `From<SparseConfigWarning>` for `HgError` This will be useful in a future patch to avoid a lot of boilerplate.
Mon, 30 Sep 2024 16:04:51 +0200 rust-hg-cpython: add an `HgProgressBar` util
Raphaël Gomès <rgomes@octobus.net> [Mon, 30 Sep 2024 16:04:51 +0200] rev 52042
rust-hg-cpython: add an `HgProgressBar` util This will be the entry point for all progress bars from a Python context in upcoming patches. Like the `Progress` trait, this is subject to change once we have more use cases, but this is good enough for now.
Mon, 30 Sep 2024 16:02:30 +0200 rust: add `Progress` trait for progress bars
Raphaël Gomès <rgomes@octobus.net> [Mon, 30 Sep 2024 16:02:30 +0200] rev 52041
rust: add `Progress` trait for progress bars This will be used in the next few changes to introduce a progress bar for the `hg update` fastpath.
Mon, 30 Sep 2024 19:15:19 +0200 rust-files: separate the listing of files from a revset and a revision
Raphaël Gomès <rgomes@octobus.net> [Mon, 30 Sep 2024 19:15:19 +0200] rev 52040
rust-files: separate the listing of files from a revset and a revision We won't need to parse a revset all the time, and an upcoming patch will make use of this new util.
Mon, 30 Sep 2024 19:12:42 +0200 rust-files: add a `Sync` bound to the matcher
Raphaël Gomès <rgomes@octobus.net> [Mon, 30 Sep 2024 19:12:42 +0200] rev 52039
rust-files: add a `Sync` bound to the matcher This enables us to use this code in multithreaded environements, which we very much want to do.
Mon, 30 Sep 2024 12:10:35 +0200 rust-files: also return filenode and flags when listing a revision's files
Raphaël Gomès <rgomes@octobus.net> [Mon, 30 Sep 2024 12:10:35 +0200] rev 52038
rust-files: also return filenode and flags when listing a revision's files This is going to be useful when implementing parts of `update` and makes it so we don't have to fetch the manifest and each entry twice.
Mon, 30 Sep 2024 12:08:49 +0200 rust-manifest: encode flags as `Option<NonZeroU8>`
Raphaël Gomès <rgomes@octobus.net> [Mon, 30 Sep 2024 12:08:49 +0200] rev 52037
rust-manifest: encode flags as `Option<NonZeroU8>` This makes the compiler use the niche optimization for all flags: since 0 is not a valid representation of any flags, we can use 0 as a replacement for `None`, which reduces memory footprint and could yield a little performance improvement over many iterations.
Mon, 30 Sep 2024 17:46:52 +0200 rust-repo: add a method to set the current parents
Raphaël Gomès <rgomes@octobus.net> [Mon, 30 Sep 2024 17:46:52 +0200] rev 52036
rust-repo: add a method to set the current parents This will be useful when we start writing an `hg update` fastpath.
Mon, 30 Sep 2024 17:46:24 +0200 rust-repo: add a method to get a `Node` from a `Revision` to the `Repo`
Raphaël Gomès <rgomes@octobus.net> [Mon, 30 Sep 2024 17:46:24 +0200] rev 52035
rust-repo: add a method to get a `Node` from a `Revision` to the `Repo` This is going to be more and more useful as we start writing higher-level code
Mon, 30 Sep 2024 17:45:10 +0200 rust-utils: move the `filesystem_now` function to a util
Raphaël Gomès <rgomes@octobus.net> [Mon, 30 Sep 2024 17:45:10 +0200] rev 52034
rust-utils: move the `filesystem_now` function to a util This is going to be useful for an upcoming `hg update` fastpath.
Mon, 30 Sep 2024 17:43:51 +0200 rust-dirstate: actually remember the identity
Raphaël Gomès <rgomes@octobus.net> [Mon, 30 Sep 2024 17:43:51 +0200] rev 52033
rust-dirstate: actually remember the identity This was an oversight that likely had no influence on anything since we have only been writing the dirstate for status. We will start writing the dirstate for more operations now, so we'll need this fixed.
Wed, 21 Aug 2024 09:48:14 +0200 mergestate: reduce the number of attribute lookups
Raphaël Gomès <rgomes@octobus.net> [Wed, 21 Aug 2024 09:48:14 +0200] rev 52032
mergestate: reduce the number of attribute lookups This code is called a lot during updates, this is a very small but also very easy thing to do.
Wed, 23 Oct 2024 14:02:28 +0200 test-lfs-serve-access: account for output differences in Python 3.12 stable
Raphaël Gomès <rgomes@octobus.net> [Wed, 23 Oct 2024 14:02:28 +0200] rev 52031
test-lfs-serve-access: account for output differences in Python 3.12 This test is quite noisy, but the fix was very easy.
Wed, 23 Oct 2024 13:49:54 +0200 patchbomb: don't test ambiguous address stable
Raphaël Gomès <rgomes@octobus.net> [Wed, 23 Oct 2024 13:49:54 +0200] rev 52030
patchbomb: don't test ambiguous address This is a bug in Python's `email` package and shouldn't be relied on. Python 3.12 has fixed this problem¹ and raises an exception. We keep the multiple `-t` because this is still relevant for testing. [1] https://github.com/python/cpython/issues/102988 [2] https://docs.python.org/3/whatsnew/changelog.html
Mon, 21 Oct 2024 11:48:09 -0400 contrib: install pip 24.2 in the Windows dependency installer script
Matt Harbison <matt_harbison@yahoo.com> [Mon, 21 Oct 2024 11:48:09 -0400] rev 52029
contrib: install pip 24.2 in the Windows dependency installer script One of the modern pythons was crying about the old version importing `distutils`.
Sat, 19 Oct 2024 01:22:25 -0400 contrib: install the latest py 3.11-3.13 in the Windows dependency script
Matt Harbison <matt_harbison@yahoo.com> [Sat, 19 Oct 2024 01:22:25 -0400] rev 52028
contrib: install the latest py 3.11-3.13 in the Windows dependency script Note that python 3.11 adds an installer for arm64, which we ignore here because I don't have a Windows system running arm64, and it's likely we will be dropping support for some platforms before I get my hands on one.
Sat, 19 Oct 2024 01:05:50 -0400 contrib: update to the latest py3.9 and 3.10 in the Windows dependency script
Matt Harbison <matt_harbison@yahoo.com> [Sat, 19 Oct 2024 01:05:50 -0400] rev 52027
contrib: update to the latest py3.9 and 3.10 in the Windows dependency script Python3.8 was already at its last version with an installer, FWIW.
Sat, 19 Oct 2024 00:57:52 -0400 contrib: drop python 3.7 from the Windows dependency installer script
Matt Harbison <matt_harbison@yahoo.com> [Sat, 19 Oct 2024 00:57:52 -0400] rev 52026
contrib: drop python 3.7 from the Windows dependency installer script I'm tempted to drop 3.8 too, since we use 3.9 on Windows.
Sat, 19 Oct 2024 00:50:49 -0400 contrib: drop python 3.5 requirements file for Linux automation
Matt Harbison <matt_harbison@yahoo.com> [Sat, 19 Oct 2024 00:50:49 -0400] rev 52025
contrib: drop python 3.5 requirements file for Linux automation The new minimum this cycle is py3.8.
Wed, 16 Oct 2024 18:06:36 -0400 windows: implement `util.cachestat` to fix numerous dirstate problems stable
Matt Harbison <matt_harbison@yahoo.com> [Wed, 16 Oct 2024 18:06:36 -0400] rev 52024
windows: implement `util.cachestat` to fix numerous dirstate problems I got here by bisecting the issue1790 related failure on Windows to keep an entry from being marked "unset" in `test-dirstate.t` back to eedbf8256263. There were a handful of other tests failing with an unexpected dirstate entry state like this, as well as numerous "skip updating dirstate: identity mismatch" messages added to various tests, as well as an issue with dirstate wrapping with the largefiles extension[1], all of which appear to be fixed by this. In total, ~25 tests are fully fixed on Windows with this change on default. This is basically a copy/paste of the posix implementation, but we drop the `st_mode` comparison- I think the only reason we care about the mode on posix is to detect +/-x mode changes, but the executable bits on Windows are synthesized based on the name of the file[2]. None of the other parts of the codebase are equipped to handle executable bits in the filesystem on Windows anyway, so it doesn't make sense to worry about them here. Note that `st_uid` and `st_gid` seem to always be 0 on Windows (and I can't find them being initialized), so they can probably be dropped from the comparison. But I doubt they matter any more on posix, since we don't track ownership. The `st_ino`, `st_dev`, and `st_nlink` attributes all seem to have reasonable values for comparing like on posix[3]. Also note that `st_ctime` is apparently deprecated in 3.12+ (for reasons I haven't explored)[4]. [1] https://foss.heptapod.net/mercurial/mercurial-devel/-/merge_requests/884 [2] https://github.com/python/cpython/blob/aab3210271136ad8e8fecd927b806602c463e1f2/Modules/posixmodule.c#L1948 [3] https://github.com/python/cpython/blob/aab3210271136ad8e8fecd927b806602c463e1f2/Python/fileutils.c#L1158 [4] https://github.com/python/cpython/blob/aab3210271136ad8e8fecd927b806602c463e1f2/Modules/posixmodule.c#L2200
Mon, 04 Feb 2019 23:32:20 -0800 extdiff: don't run gui programs when in a cli-only environment
Ludovic Chabant <ludovic@chabant.com> [Mon, 04 Feb 2019 23:32:20 -0800] rev 52023
extdiff: don't run gui programs when in a cli-only environment In order to provide a useful error message to override the behavior, we also need to slightly change the way that tool.gui is found in the config. Before, it had to be where tool.diffargs is located, which might not exist. Now, tool.isgui can exist on its own. A test is added for the new error message. We also need to force procutil.isgui() to return true, so we set $DISPLAY to a non-empty value before running any test expecting to have a gui.
Wed, 28 Dec 2022 21:33:44 -0800 bookflow: fix bullet list indentation in docstring
Ludovic Chabant <ludovic@chabant.com> [Wed, 28 Dec 2022 21:33:44 -0800] rev 52022
bookflow: fix bullet list indentation in docstring
Mon, 09 Oct 2023 22:14:24 -0700 doc: generate separate commands/topics/extension pages
Ludovic Chabant <ludovic@chabant.com> [Mon, 09 Oct 2023 22:14:24 -0700] rev 52021
doc: generate separate commands/topics/extension pages This change modifies gendoc.py and Makefile so that individual pages for commands, help topics, and extensions can be generated. A new index page is also generated with links to all these pages. This makes it easier to look up and search the help text of a given command or topic, instead of having to deal with the giant hg.1 "all-in-one" page. Since the list of individual pages varies based on the source code, we generate a dynamic Makefile that contains this list of files as individual targets. This gives us fine-grained control over output files. However, it greatly increases the time spent generating all help pages. It's recommended to run make with -j to make use of multi-core archs. Individual man pages are produced in doc/man, and HTML ones are in doc/html
Mon, 09 Oct 2023 22:11:21 -0700 doc: refactor gendoc for better reusability
Ludovic Chabant <ludovic@chabant.com> [Mon, 09 Oct 2023 22:11:21 -0700] rev 52020
doc: refactor gendoc for better reusability This change separates the gathering of commands/topics/etc from the logic of printing their documentation out.
Tue, 01 Oct 2024 16:07:51 +0200 stream: prefer keeping an open file handle to volatile file instead of copy
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 01 Oct 2024 16:07:51 +0200] rev 52019
stream: prefer keeping an open file handle to volatile file instead of copy We will still do copy if too many file handle are open. Currently, have less than 10 volatile files in typical usage, so we should be fine. See inline documentation for details.
Tue, 01 Oct 2024 15:55:49 +0200 stream: remove __getitem__ from the VolatileManager
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 01 Oct 2024 15:55:49 +0200] rev 52018
stream: remove __getitem__ from the VolatileManager It is no longer used and that API will get in the way of the new order.
Tue, 01 Oct 2024 15:55:29 +0200 stream: open volatile file through the manager
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 01 Oct 2024 15:55:29 +0200] rev 52017
stream: open volatile file through the manager To do more subtle things, we need more control.
Mon, 14 Oct 2024 15:11:49 +0200 stream: rename TempCopyManager to VolatileManager
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 14 Oct 2024 15:11:49 +0200] rev 52016
stream: rename TempCopyManager to VolatileManager We are going to be more subtle in our management of volatile file, so use a more semantic name.
Mon, 14 Oct 2024 12:12:34 -0400 ci: only use the macOS runner if manually invoked
Matt Harbison <matt_harbison@yahoo.com> [Mon, 14 Oct 2024 12:12:34 -0400] rev 52015
ci: only use the macOS runner if manually invoked Right now, we only have a single machine with a single runner, so don't create a bottleneck by default.
Tue, 08 Oct 2024 18:59:44 -0400 ci: add a runner for macos
Matt Harbison <matt_harbison@yahoo.com> [Tue, 08 Oct 2024 18:59:44 -0400] rev 52014
ci: add a runner for macos This is running from a venv, created with the packages from the requirements file in the `test-setup-future-work` topic being discussed separately. We can basically reuse the existing `test_c` configuration as-is, but there was one small issue- if the clone from the previous CI run is still present in `/tmp`, the clone for the current run fails. It's not a problem for the current setup because a new container is instantiated, so the easy fix is to simply delete the clone first. (The Windows CI avoids this by not cloning in the first place.) It looks like it takes ~80m to run the whole test suite on the current system.
Tue, 15 Oct 2024 13:52:21 +0200 branching: merge stable into default
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 15 Oct 2024 13:52:21 +0200] rev 52013
branching: merge stable into default
Mon, 14 Oct 2024 16:46:25 +0200 tests: use shlex.quote instead of pipes.quote stable
Julien Cristau <jcristau@debian.org> [Mon, 14 Oct 2024 16:46:25 +0200] rev 52012
tests: use shlex.quote instead of pipes.quote The pipes module got removed in python 3.13. https://bugs.debian.org/1084553
Tue, 01 Oct 2024 12:29:10 +0200 branchmap-v3: make sure we write the cache after detecting pure-topo mode
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 01 Oct 2024 12:29:10 +0200] rev 52011
branchmap-v3: make sure we write the cache after detecting pure-topo mode We were properly detecting the pure topo-case but in some case the one disk cache file was never updated with that information.
Tue, 15 Oct 2024 04:33:30 +0200 demande-import-test: use `wsgiref` instead of `telnetlib` for testing stable
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 15 Oct 2024 04:33:30 +0200] rev 52010
demande-import-test: use `wsgiref` instead of `telnetlib` for testing The `telnetlib` module has been dropped in 3.13. The `wsgiref` module fit the same purpose of being obscure and not imported yet.
Mon, 07 Oct 2024 19:53:24 +0200 hgdemandimport: add collections.abc to the ignore list because Python 3.13 rc3 stable
Mads Kiilerich <mads@kiilerich.com> [Mon, 07 Oct 2024 19:53:24 +0200] rev 52009
hgdemandimport: add collections.abc to the ignore list because Python 3.13 rc3 It worked in Python 3.13 rc2, but something changed for rc3. Now, when i18n.py imports typing and it touches collections.abc.Hashable , we get: ValueError: module object for collections.abc substituted in sys.modules during a lazy load This seems to be a general problem, released in the final Python 3.13 . I have not analyzed the problem in details. We *could* work around the problem by disabling demand import of typing. But that would effectively disable demand import of collections.abc too. Instead, just disable demand import for collections.abc .
Fri, 11 Oct 2024 00:56:20 -0400 run-tests: include non-activated venv packages in `PYTHONPATH`
Matt Harbison <matt_harbison@yahoo.com> [Fri, 11 Oct 2024 00:56:20 -0400] rev 52008
run-tests: include non-activated venv packages in `PYTHONPATH` If a venv is activated since afa9d73780e1, `hghave` would see the packages installed in it, and enable related tests. If the python interpreter was launched directly however, none of them were seen. In addition to getting consistent behavior, it's also easier to manage in CI if the venv doesn't need activation.
Thu, 10 Oct 2024 17:52:26 -0400 tests: allow optional output when `test-lfs-server` is sent SIGTERM
Matt Harbison <matt_harbison@yahoo.com> [Thu, 10 Oct 2024 17:52:26 -0400] rev 52007
tests: allow optional output when `test-lfs-server` is sent SIGTERM I guess this has only ever been tested on Windows, but on macOS, the test was failing with changes like: +++ /private/tmp/mercurial-ci/tests/test-lfs-test-server.t#git-server.err @@ -858,6 +858,7 @@ (Restart the server in a different location so it no longer has the content) $ "$PYTHON" $RUNTESTDIR/killdaemons.py $DAEMON_PIDS + $TESTTMP.sh: line 153: 38639 Terminated: 15 lfs-test-server > lfs-server.log 2>&1 #if hg-server $ cat $TESTTMP/access.log $TESTTMP/errors.log
Wed, 09 Oct 2024 20:09:33 -0400 tests: stabilize `test-http-bad-server.t` on macOS
Matt Harbison <matt_harbison@yahoo.com> [Wed, 09 Oct 2024 20:09:33 -0400] rev 52006
tests: stabilize `test-http-bad-server.t` on macOS I'm not sure what's going on here, because I got one test run where this worked, but two where it gave this error instead. It's connection related as the comment says it should be, so good enough.
Wed, 09 Oct 2024 13:55:04 -0400 upgrade: disable using the parallel workers optimization on macOS
Matt Harbison <matt_harbison@yahoo.com> [Wed, 09 Oct 2024 13:55:04 -0400] rev 52005
upgrade: disable using the parallel workers optimization on macOS It crashes `test-copies-chain-merge.t` for some reason[1]. It's only experimental, and already hard-disabled on Windows. [1] https://foss.heptapod.net/mercurial/mercurial-devel/-/jobs/2591045#L108
Sun, 13 Oct 2024 04:55:48 +0200 format: fix few black issues
paugier <pierre.augier@univ-grenoble-alpes.fr> [Sun, 13 Oct 2024 04:55:48 +0200] rev 52004
format: fix few black issues
Thu, 10 Oct 2024 09:54:55 +0200 install: static data moved from setup.py to pyproject.toml
paugier <pierre.augier@univ-grenoble-alpes.fr> [Thu, 10 Oct 2024 09:54:55 +0200] rev 52003
install: static data moved from setup.py to pyproject.toml
Mon, 14 Oct 2024 00:15:25 +0200 ci: display tool version more selectively
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 14 Oct 2024 00:15:25 +0200] rev 52002
ci: display tool version more selectively The goal here is to avoid showing tool version in all case as this create issue for non linux/docker runner that might not have some of them installed. This is currently relevant for the coming mac runner that does not have clang-format installed and does not needs its. This might also be useful in the future to use narrower docker image more specialized for each jobs.
Sun, 13 Oct 2024 14:46:23 +0200 zeroconf: fix a warning about a signature mismatch in a method override
Matt Harbison <matt_harbison@yahoo.com> [Sun, 13 Oct 2024 14:46:23 +0200] rev 52001
zeroconf: fix a warning about a signature mismatch in a method override Caught by PyCharm. It looks like the `hdr` arg is mostly unused (thus why it was missing in some cases), so pass along an empty string where needed.
Mon, 07 Oct 2024 23:24:28 -0400 zeroconf: use str instead of bytes when indexing `globals()`
Matt Harbison <matt_harbison@yahoo.com> [Mon, 07 Oct 2024 23:24:28 -0400] rev 52000
zeroconf: use str instead of bytes when indexing `globals()` I suppose since we set the key to bytes during init that it won't raise a KeyError, but this was very likely an oversight when mass-byteifying, rather than purposeful.
Mon, 07 Oct 2024 23:20:09 -0400 zeroconf: fix an invalid argument error on Windows
Matt Harbison <matt_harbison@yahoo.com> [Mon, 07 Oct 2024 23:20:09 -0400] rev 51999
zeroconf: fix an invalid argument error on Windows The idea that pyoxidizer was triggering the problem when standing up the previous incarnation of CI for Windows was misleading- it was a Windows problem in general. See the inline bug link. Unfortunately, there's no commit referenced there, and it looks like OP closed the report himself with the suggested workaround. IOW, very modern python may not work, but it's extremely unlikely that there are any users of this extension, especially on Windows.
Sat, 12 Oct 2024 16:55:30 -0400 tests: fix hooks in `test-transaction-rollback-on-revlog-split.t` for Windows
Matt Harbison <matt_harbison@yahoo.com> [Sat, 12 Oct 2024 16:55:30 -0400] rev 51998
tests: fix hooks in `test-transaction-rollback-on-revlog-split.t` for Windows A few problems with external hooks here: 1) `cmd.exe` is blissfully unaware of the meaning of single quotes, and passes them along as part of the revision arg 2) `cmd.exe` doesn't know how to run the python script `f` with the shebang line, so it needs to be invoked with the intepreter explicitly. Then for some reason it was trying to open `$TESTTMP\troffset-computation-hooks\f`, so make it an absolute path. 3) Likewise, the shell script `wait-on-file` cannot be invoked directly by `cmd.exe`. 4) Windows python doesn't understand whatever `$TESTTMP` unrolls to (probably it has the double backslashes), and silently failed to write the lock file. I'm assuming that `pretxnclose.03-abort` is also bad (there's no `false` in `cmd.exe`), but it's not currently causing problems. Also note that the paths in this are very long, and typically exceed the `MAX_PATH` limit in Windows. It can be run with `run-tests.py --tmpdir /c/t`.
Sat, 12 Oct 2024 16:35:03 -0400 tests: use the cross platform `SIGKILL` function
Matt Harbison <matt_harbison@yahoo.com> [Sat, 12 Oct 2024 16:35:03 -0400] rev 51997
tests: use the cross platform `SIGKILL` function This partially fixes `test-transaction-rollback-on-revlog-split.t` (there are still problems related to waiting on the lock files), and completely fixes `test-fncache.t`.
Sat, 12 Oct 2024 16:06:37 -0400 tests: add a module that can perform the equivalent of `SIGKILL` on any OS
Matt Harbison <matt_harbison@yahoo.com> [Sat, 12 Oct 2024 16:06:37 -0400] rev 51996
tests: add a module that can perform the equivalent of `SIGKILL` on any OS I started with this being Windows specific, but let's push all of the decision making into this function so that it can just be called by the tests. The tradeoff is that this is very specific to sending `SIGKILL`- since `signal.SIGKILL` doesn't exist on Windows, the desired signal can't be passed from the caller. Maybe there's a way, but let's wait until there's a need. We don't use `killdaemons.py` unconditionally because it starts with a more graceful `SIGTERM` on posix.
Sat, 12 Oct 2024 15:22:03 -0400 tests: teach `killdaemons` on Windows to use an exit code provided by a caller
Matt Harbison <matt_harbison@yahoo.com> [Sat, 12 Oct 2024 15:22:03 -0400] rev 51995
tests: teach `killdaemons` on Windows to use an exit code provided by a caller Right now, there are several tests that use `signal.SIGKILL`, which isn't a thing on Windows. The `killdaemons` script approximates this by forcibly terminating the process. There's a minor difference in that `signal.SIGKILL` results in the test capturing an exit code of 137, and the `killdaemons` victim doesn't record a code (as though it exited with 0). Since the exit code line couldn't be conditionalized the last time I checked, let's just allow the caller to simulate the same exit code, and avoid conditionalizing the tests.
Thu, 10 Oct 2024 17:55:50 +0200 ci: also offer tests with Python 3.13
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 10 Oct 2024 17:55:50 +0200] rev 51994
ci: also offer tests with Python 3.13 Python3.13 is du to be released soon. We better make sure we work with it.
Sat, 12 Oct 2024 03:07:52 +0200 run-test: add regular line break and test count in the dot output
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 12 Oct 2024 03:07:52 +0200] rev 51993
run-test: add regular line break and test count in the dot output This will make it simpler to follow the actual progress. The value "75" have been picked as it is smaller or equal to 80 and give a nice round number.
Fri, 11 Oct 2024 14:37:59 +0200 clonebundle-digest: add recursion guards for Python 3.8
Joerg Sonnenberger <joerg@bec.de> [Fri, 11 Oct 2024 14:37:59 +0200] rev 51992
clonebundle-digest: add recursion guards for Python 3.8 For Python 3.8 and 3.9, the read/readinto pair can recurse, so make sure the data is only hashed once.
Tue, 08 Oct 2024 01:06:57 -0400 tests: replace inline `waitlock()` with `wait-on-file` script
Matt Harbison <matt_harbison@yahoo.com> [Tue, 08 Oct 2024 01:06:57 -0400] rev 51991
tests: replace inline `waitlock()` with `wait-on-file` script The latter scales up the timeout based on the timeout value provided to the test runner, and I was seeing timeouts on Windows when running all of the tests using all CPU cores.
Mon, 07 Oct 2024 21:48:36 -0400 tests: stabilize `test-split-legacy-inline-changelog.t` on Windows
Matt Harbison <matt_harbison@yahoo.com> [Mon, 07 Oct 2024 21:48:36 -0400] rev 51990
tests: stabilize `test-split-legacy-inline-changelog.t` on Windows The `tar` command is unable to process "C:\path\to\foo.tar" style paths, which is how `$TESTDIR` is constructed. It also didn't work with `$TESTDIR_FORWARD_SLASH`- both failed with: tar: Cannot connect to C: resolve failed [128] But `cat` can handle it if the path is quoted, and `tar` can read from stdin.
Mon, 07 Oct 2024 19:11:54 -0400 tests: stabilize `test-largefiles-cache.t` on Windows
Matt Harbison <matt_harbison@yahoo.com> [Mon, 07 Oct 2024 19:11:54 -0400] rev 51989
tests: stabilize `test-largefiles-cache.t` on Windows The `undo.backup.dirstate.bck` was created by `hg commit -m 'add largefile'` at line 18, and deleted in the conditional block by `hg push -q http://localhost:$HGPORT/` at line 138. That's... surprising, but probably not harmful, and can be debugged from Linux if it is a problem. This was showing up in `find src/.hg/largefiles/* | grep -E "(dirstate|$hash)"`.
Mon, 07 Oct 2024 18:33:45 -0400 tests: stabilize `test-journal.t` on Windows
Matt Harbison <matt_harbison@yahoo.com> [Mon, 07 Oct 2024 18:33:45 -0400] rev 51988
tests: stabilize `test-journal.t` on Windows The file in these lines are double quoted, but single quoted on other platforms. Not sure why, other than `cmd.exe` doesn't recognize single quotes. But it's a cosmetic difference, so glob over it and move on.
Mon, 07 Oct 2024 18:26:41 -0400 tests: stabilize `test-clonebundles.t` on Windows
Matt Harbison <matt_harbison@yahoo.com> [Mon, 07 Oct 2024 18:26:41 -0400] rev 51987
tests: stabilize `test-clonebundles.t` on Windows The `remote: {foo,bar}` lines were different because `echo` in MSYS uses `\r\n`. I couldn't make it work with the previous echoing of individual lines, changing the internal `echo` to `printf "foo\n"`, because that output as "foon". This works on Linux and Windows, so I'm not thinking too hard about it.
Mon, 07 Oct 2024 17:26:31 -0400 tests: cleanup some special casing of `seq` emitting '\r\n'
Matt Harbison <matt_harbison@yahoo.com> [Mon, 07 Oct 2024 17:26:31 -0400] rev 51986
tests: cleanup some special casing of `seq` emitting '\r\n' My guess is these predate the commit referenced in the previous commit.
Mon, 07 Oct 2024 16:20:07 -0400 tests: force `seq` to print with '\n' EOL
Matt Harbison <matt_harbison@yahoo.com> [Mon, 07 Oct 2024 16:20:07 -0400] rev 51985
tests: force `seq` to print with '\n' EOL It looks like consistent EOL is the reason for 0605726179a0, but now on py3, `print()` uses the platform EOL without regard to binary mode. The tests mostly use this to loop over a sequence of number in the shell, but there are a handful that redirect output to a file. Specifically, this fixes Windows runs of `test-bundle2-multiple-changegroups.t`, but there may be other tests this fixes. Some other `tests/*.py` files also set binary mode on stdout, but they also write bytes directly to `sys.stdout.buffer`. I'm not doing that here because PyCharm flags these write calls for passing bytes instead of str (PyCharm is likely wrong, but possibly confused because the code falls back to `sys.stdout` if there is no `.buffer` attribute), and it's annoying.
Mon, 07 Oct 2024 15:48:06 -0400 tests: stabilize `test-bundle-phase-internal.t` on Windows
Matt Harbison <matt_harbison@yahoo.com> [Mon, 07 Oct 2024 15:48:06 -0400] rev 51984
tests: stabilize `test-bundle-phase-internal.t` on Windows This is a silly difference, and we control the Windows side of things from mercurial/windows.py:195. I'll swap and quote the values to be like `no-windows` at some point, but I suspect this exception output would appear elsewhere, and don't feel like waiting for a 2h+ test run to find all of them.
Mon, 07 Oct 2024 13:19:16 -0400 tests: skip `test-wsgicgi.t` on MSYS
Matt Harbison <matt_harbison@yahoo.com> [Mon, 07 Oct 2024 13:19:16 -0400] rev 51983
tests: skip `test-wsgicgi.t` on MSYS The test is attempting to set `PATH_INFO="/rev/\xe2\x80\x94"` into the environment, which it does. The problem is that when MSYS sees a leading '/' in an environment variable, it thinks it's a unix filesystem path, so it "helpfully" prepends the Windows path to the MSYS root directory before running a non-MSYS process. hgweb would then split this value on '/', so it would get 'C:' instead of 'rev', and return a 400 since that isn't a valid web command. I tried generating a *.bat file, but had trouble running that via `cmd.exe` inside the test. I also tried generating an equivalent *.py launcher that would set the environment variables itself. But there is no `os.environb` on Windows, and the value was getting mangled when put into the script. So, I give up. If it's encoding stuff on Windows, it's probably broken.
Thu, 27 Jun 2024 03:32:52 +0200 clonebundles: allow manifest to specify sha256 digest of bundles
Joerg Sonnenberger <joerg@bec.de> [Thu, 27 Jun 2024 03:32:52 +0200] rev 51982
clonebundles: allow manifest to specify sha256 digest of bundles
Thu, 03 Oct 2024 14:45:01 +0200 install: add long_description_content_type
paugier <pierre.augier@univ-grenoble-alpes.fr> [Thu, 03 Oct 2024 14:45:01 +0200] rev 51981
install: add long_description_content_type
Wed, 09 Oct 2024 10:56:51 +0200 headrevs: replace a boolean match with a if/else
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 09 Oct 2024 10:56:51 +0200] rev 51980
headrevs: replace a boolean match with a if/else I missed that while doing a previous cleanup.
Fri, 27 Sep 2024 03:55:40 +0200 head-revs: add a native implementation of the `stop_rev` parameter
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 27 Sep 2024 03:55:40 +0200] rev 51979
head-revs: add a native implementation of the `stop_rev` parameter This does not add too much complexity to the native code and help with branchmap v3 performance. Note that the final conversion of the heads from native-code to Python is still too costly, especially in Rust. In addition the current caching around headrevs is too simple and fragile. However these are an unrelated problem. ### benchmark.name = hg.command.unbundle # bin-env-vars.hg.py-re2-module = default # benchmark.variants.issue6528 = disabled # benchmark.variants.resource-usage = default # benchmark.variants.reuse-external-delta-parent = yes # benchmark.variants.revs = any-1-extra-rev # benchmark.variants.source = unbundle # benchmark.variants.validate = default # benchmark.variants.verbosity = quiet ## data-env-vars.name = netbeans-2018-08-01-zstd-sparse-revlog # bin-env-vars.hg.flavor = default branch-v2: 0.233711 ~~~~~ branch-v3 before: 0.239857 (+2.63%, +0.01) branch-v3 after: 0.239558 (+2.50%, +0.01) # bin-env-vars.hg.flavor = rust branch-v2: 0.235230 ~~~~~ branch-v3 before: 0.240972 (+2.44%, +0.01) branch-v3 after: 0.239917 (+1.99%, +0.00) ## data-env-vars.name = netbeans-2018-08-01-ds2-pnm # bin-env-vars.hg.flavor = rust branch-v2: 0.255586 ~~~~~ branch-v3 before: 0.268560 (+5.08%, +0.01) branch-v3 after: 0.262261 (+2.61%, +0.01) ## data-env-vars.name = mozilla-central-2024-03-22-zstd-sparse-revlog # bin-env-vars.hg.flavor = default branch-v2: 0.339010 ~~~~~ branch-v3 before: 0.349389 (+3.06%, +0.01) branch-v3 after: 0.348247 (+2.72%, +0.01) # bin-env-vars.hg.flavor = rust branch-v2: 0.346525 ~~~~~ branch-v3 before: 0.355661 (+2.64%, +0.01) branch-v3 after: 0.350906 (+1.26%, +0.00) ## data-env-vars.name = mozilla-central-2024-03-22-ds2-pnm # bin-env-vars.hg.flavor = rust branch-v2: 0.380202 ~~~~~ branch-v3 before: 0.408851 (+7.54%, +0.03) branch-v3 after: 0.406511 (+6.92%, +0.03) ## data-env-vars.name = mozilla-unified-2024-03-22-zstd-sparse-revlog # bin-env-vars.hg.flavor = default branch-v2: 0.412165 ~~~~~ branch-v3 before: 0.427782 (+3.79%, +0.02) branch-v3 after: 0.422595 (+2.53%, +0.01) # bin-env-vars.hg.flavor = rust branch-v2: 0.412397 ~~~~~ branch-v3 before: 0.422354 (+2.41%, +0.01) branch-v3 after: 0.421079 (+2.11%, +0.01) ## data-env-vars.name = mozilla-unified-2024-03-22-ds2-pnm # bin-env-vars.hg.flavor = rust branch-v2: 0.429501 ~~~~~ branch-v3 before: 0.443197 (+3.19%, +0.01) branch-v3 after: 0.449432 (+4.64%, +0.02) ## data-env-vars.name = mozilla-try-2024-03-26-zstd-sparse-revlog # bin-env-vars.hg.flavor = default branch-v2: 3.403171 ~~~~~ branch-v3 before: 3.819477 (+12.23%, +0.42) branch-v3 after: 3.658482 (+7.50%, +0.26) # bin-env-vars.hg.flavor = rust branch-v2: 3.454876 ~~~~~ branch-v3 before: 3.590284 (+3.92%, +0.14) branch-v3 after: 3.545843 (+2.63%, +0.09) ## data-env-vars.name = mozilla-try-2024-03-26-ds2-pnm # bin-env-vars.hg.flavor = rust branch-v2: 3.465435 ~~~~~ branch-v3 before: 3.633278 (+4.84%, +0.17) branch-v3 after: 3.556074 (+2.62%, +0.09)
Thu, 26 Sep 2024 01:52:09 +0200 head-revs: move hg-core's inner_headrevsfiltered closer to inner_headrevs
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 26 Sep 2024 01:52:09 +0200] rev 51978
head-revs: move hg-core's inner_headrevsfiltered closer to inner_headrevs This is pure code movement, it make a coming changesets significantly clearer.
Tue, 03 Sep 2024 11:11:17 +0200 branchmap-v3: introduce a "stop_rev" argument to `headsrevs`
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 03 Sep 2024 11:11:17 +0200] rev 51977
branchmap-v3: introduce a "stop_rev" argument to `headsrevs` The `headsrevs` method of the revlog already have a `revs` argument to compute the headrevs of a limited set of heads. However, it disable the use of the native compiled code to compute the heads, which slows down the branchmap v3 code a lot. The branchmap v3 usage is actually quite constrained as we will always only ignores a part at the top of the graph. So we could be significantly faster. We start by making small change to the python side to improve the situation and introduce the new API. More collaboration with the native code are coming later. This massively speedup operation and close most of the remaining gaps between branchmap-v3 and branchmap-v2. especially on repository with many revs like mozilla-try. A small overhead remains mostly because the `headrevs` logic currently has some inefficiently. We will look into them from there. ### benchmark.name = hg.command.unbundle # bin-env-vars.hg.py-re2-module = default # benchmark.variants.issue6528 = disabled # benchmark.variants.resource-usage = default # benchmark.variants.reuse-external-delta-parent = yes # benchmark.variants.revs = any-1-extra-rev # benchmark.variants.source = unbundle # benchmark.variants.validate = default # benchmark.variants.verbosity = quiet ## data-env-vars.name = netbeans-2018-08-01-zstd-sparse-revlog # bin-env-vars.hg.flavor = default branch-v2: 0.233711 ~~~~~ branch-v3 before: 0.368769 (+57.79%, +0.14) branch-v3 after: 0.239857 (+2.63%, +0.01) # bin-env-vars.hg.flavor = rust branch-v2: 0.235230 ~~~~~ branch-v3 before: 0.372460 (+58.34%, +0.14) branch-v3 after: 0.240972 (+2.44%, +0.01) ## data-env-vars.name = netbeans-2018-08-01-ds2-pnm # bin-env-vars.hg.flavor = rust branch-v2: 0.255586 ~~~~~ branch-v3 before: 0.318907 (+24.78%, +0.06) branch-v3 after: 0.268560 (+5.08%, +0.01) ## data-env-vars.name = mozilla-central-2024-03-22-zstd-sparse-revlog # bin-env-vars.hg.flavor = default branch-v2: 0.339010 ~~~~~ branch-v3 before: 0.349752 (+3.17%, +0.01) branch-v3 after: 0.349389 (+3.06%, +0.01) # bin-env-vars.hg.flavor = rust branch-v2: 0.346525 ~~~~~ branch-v3 before: 0.354300 (+2.24%, +0.01) branch-v3 after: 0.355661 (+2.64%, +0.01) ## data-env-vars.name = mozilla-central-2024-03-22-ds2-pnm # bin-env-vars.hg.flavor = rust branch-v2: 0.380202 ~~~~~ branch-v3 before: 0.396293 (+4.23%, +0.02) branch-v3 after: 0.408851 (+7.54%, +0.03) ## data-env-vars.name = mozilla-unified-2024-03-22-zstd-sparse-revlog # bin-env-vars.hg.flavor = default branch-v2: 0.412165 ~~~~~ branch-v3 before: 0.424769 (+3.06%, +0.01) branch-v3 after: 0.427782 (+3.79%, +0.02) # bin-env-vars.hg.flavor = rust branch-v2: 0.412397 ~~~~~ branch-v3 before: 0.421796 (+2.28%, +0.01) branch-v3 after: 0.422354 (+2.41%, +0.01) ## data-env-vars.name = mozilla-unified-2024-03-22-ds2-pnm # bin-env-vars.hg.flavor = rust branch-v2: 0.429501 ~~~~~ branch-v3 before: 0.443849 (+3.34%, +0.01) branch-v3 after: 0.443197 (+3.19%, +0.01) ## data-env-vars.name = mozilla-try-2024-03-26-zstd-sparse-revlog # bin-env-vars.hg.flavor = default branch-v2: 3.403171 ~~~~~ branch-v3 before: 6.234055 (+83.18%, +2.83) branch-v3 after: 3.819477 (+12.23%, +0.42) # bin-env-vars.hg.flavor = rust branch-v2: 3.454876 ~~~~~ branch-v3 before: 6.307813 (+82.58%, +2.85) branch-v3 after: 3.590284 (+3.92%, +0.14) ## data-env-vars.name = mozilla-try-2024-03-26-ds2-pnm # bin-env-vars.hg.flavor = rust branch-v2: 3.465435 ~~~~~ branch-v3 before: 5.176076 (+49.36%, +1.71) branch-v3 after: 3.633278 (+4.84%, +0.17)
Tue, 03 Sep 2024 02:13:03 +0200 branchmap-v3: filter topo heads using node for performance reason
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 03 Sep 2024 02:13:03 +0200] rev 51976
branchmap-v3: filter topo heads using node for performance reason The branchmap currently contains heads as nodeid. If we build a set of revnum with the topological heads, we need to turn the nodeid in the branchmap to revnum to be able to check if they are topo-heads. That nodeid → revnum lookup is "expensive" and adds up to something noticeable if you do it hundreds of thousand of time. Instead we turn all the topo-heads revnums into nodes and build a set. So we can directly test membership of the nodeids stored in the branchmap. That is much faster. Ideally we would have revnum in the branchmap and could directly test revnum against a revnum set and that would be even faster. However that's an adventure for another time. Without this change, the branchmap format "v3" was significantly slower than the "v2" format. With this changes, some of that gap is recovered With rust + persistent nodemap, this overhead was smaller because the extra lookup did not had to to build the nodemap from scratch. In addition the mozilla-unified repository is able to use the "pure_top" mode of branchmap v3, so it was not really affected by this. Future changeset will work of the remaining of the performance gap. ### benchmark.name = hg.command.unbundle # bin-env-vars.hg.py-re2-module = default # benchmark.variants.issue6528 = disabled # benchmark.variants.resource-usage = default # benchmark.variants.reuse-external-delta-parent = yes # benchmark.variants.revs = any-1-extra-rev # benchmark.variants.source = unbundle # benchmark.variants.validate = default # benchmark.variants.verbosity = quiet ## data-env-vars.name = netbeans-2018-08-01-zstd-sparse-revlog # bin-env-vars.hg.flavor = default branch-v2: 0.233711 ~~~~~ branch-v3 before: 0.380994 (+63.02%, +0.15) branch-v3 after: 0.368769 (+57.79%, +0.14) # bin-env-vars.hg.flavor = rust branch-v2: 0.235230 ~~~~~ branch-v3 before: 0.385060 (+63.70%, +0.15) branch-v3 after: 0.372460 (+58.34%, +0.14) ## data-env-vars.name = netbeans-2018-08-01-ds2-pnm # bin-env-vars.hg.flavor = rust branch-v2: 0.255586 ~~~~~ branch-v3 before: 0.317524 (+24.23%, +0.06) branch-v3 after: 0.318907 (+24.78%, +0.06) ## data-env-vars.name = mozilla-central-2024-03-22-zstd-sparse-revlog # bin-env-vars.hg.flavor = default branch-v2: 0.339010 ~~~~~ branch-v3 before: 0.410007 (+20.94%, +0.07) branch-v3 after: 0.349752 (+3.17%, +0.01) # bin-env-vars.hg.flavor = rust branch-v2: 0.346525 ~~~~~ branch-v3 before: 0.410428 (+18.44%, +0.06) branch-v3 after: 0.354300 (+2.24%, +0.01) ## data-env-vars.name = mozilla-central-2024-03-22-ds2-pnm # bin-env-vars.hg.flavor = rust branch-v2: 0.380202 ~~~~~ branch-v3 before: 0.393871 (+3.60%, +0.01) branch-v3 after: 0.396293 (+4.23%, +0.02) ## data-env-vars.name = mozilla-unified-2024-03-22-zstd-sparse-revlog # bin-env-vars.hg.flavor = default branch-v2: 0.412165 ~~~~~ branch-v3 before: 0.438105 (+6.29%, +0.03) branch-v3 after: 0.424769 (+3.06%, +0.01) # bin-env-vars.hg.flavor = rust branch-v2: 0.412397 ~~~~~ branch-v3 before: 0.438405 (+6.31%, +0.03) branch-v3 after: 0.421796 (+2.28%, +0.01) ## data-env-vars.name = mozilla-unified-2024-03-22-ds2-pnm # bin-env-vars.hg.flavor = rust branch-v2: 0.429501 ~~~~~ branch-v3 before: 0.452692 (+5.40%, +0.02) branch-v3 after: 0.443849 (+3.34%, +0.01) ## data-env-vars.name = mozilla-try-2024-03-26-zstd-sparse-revlog # bin-env-vars.hg.flavor = default branch-v2: 3.403171 ~~~~~ branch-v3 before: 6.562345 (+92.83%, +3.16) branch-v3 after: 6.234055 (+83.18%, +2.83) # bin-env-vars.hg.flavor = rust branch-v2: 3.454876 ~~~~~ branch-v3 before: 6.160248 (+78.31%, +2.71) branch-v3 after: 6.307813 (+82.58%, +2.85) ## data-env-vars.name = mozilla-try-2024-03-26-ds2-pnm # bin-env-vars.hg.flavor = rust branch-v2: 3.465435 ~~~~~ branch-v3 before: 5.381648 (+55.30%, +1.92) branch-v3 after: 5.176076 (+49.36%, +1.71)
Fri, 27 Sep 2024 15:19:10 +0200 rev-branch-cache: properly ignores unaligned trailing data
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 27 Sep 2024 15:19:10 +0200] rev 51975
rev-branch-cache: properly ignores unaligned trailing data Previously, trailing data could lead to crash and would be written back to disk, disaligning all new data… This is no longer the cases. This was detected while playing with branchmap-v3 that access the rev-branch-cache much more aggressively.
Fri, 27 Sep 2024 15:01:43 +0200 rev-branch-cache: stop pretending we will overwrite data when we don't
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 27 Sep 2024 15:01:43 +0200] rev 51974
rev-branch-cache: stop pretending we will overwrite data when we don't We were issuing a message about overwriting data even when we were about to write 0 bytes in pratice. This is silly. Instead we point at the extra data remaining in the file (in case someone is using debug to debug something).
Fri, 27 Sep 2024 15:05:26 +0200 rev-branch-cache: fix message about overwritten data
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 27 Sep 2024 15:05:26 +0200] rev 51973
rev-branch-cache: fix message about overwritten data If there is data at the end we ignore, we should not count them as overwritten. This reveal that we something don't overwrite anything, this will be taken car of in the next changeset.
Fri, 27 Sep 2024 02:27:54 +0200 branchmap-v3: detect invalid headerline and raise error
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 27 Sep 2024 02:27:54 +0200] rev 51972
branchmap-v3: detect invalid headerline and raise error Otherwise, broken cache file would be accept as valid, but empty.
Fri, 27 Sep 2024 00:55:54 +0200 head-revs: merge the two inner_headrevs… variants
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 27 Sep 2024 00:55:54 +0200] rev 51971
head-revs: merge the two inner_headrevs… variants Now that there is only one method, it does not make sense to have two different "inner" method. This is especially true as we are about to add another parameter to the method. So we clean up before that.
Thu, 26 Sep 2024 01:50:36 +0200 head-revs: move hg-cpython's inner_headrevsfiltered closer to inner_headrevs
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 26 Sep 2024 01:50:36 +0200] rev 51970
head-revs: move hg-cpython's inner_headrevsfiltered closer to inner_headrevs This is pure code movement, it make a coming changesets significantly clearer.
Wed, 25 Sep 2024 17:18:40 +0200 head-revs: teach the pure indexes about the `headrevs` method
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 25 Sep 2024 17:18:40 +0200] rev 51969
head-revs: teach the pure indexes about the `headrevs` method Having this computation done at the index level unify the API and remove revlog side complexity. It might also be a front runner of handing more responsability to the index.
Thu, 26 Sep 2024 00:50:21 +0200 head-revs: remove the `headrevsfiltered` method on the index
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 26 Sep 2024 00:50:21 +0200] rev 51968
head-revs: remove the `headrevsfiltered` method on the index This method is no longer called and can be removed.
Wed, 25 Sep 2024 17:11:32 +0200 head-revs: stop calling headrevsfiltered
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 25 Sep 2024 17:11:32 +0200] rev 51967
head-revs: stop calling headrevsfiltered The `headrevs` method have been accepting filter since Mercurial 3.2¹. I guess we can rely on it for now. (except the Rust extension that just gained this capability, but it has it now)
Wed, 25 Sep 2024 21:43:21 +0200 rust-cpython: also accept the `filteredrevs` argument in index.headrevs
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 25 Sep 2024 21:43:21 +0200] rev 51966
rust-cpython: also accept the `filteredrevs` argument in index.headrevs The C version have been accepting this argument since Mercurial 3.2, lets align the Rust index here. This will make it possible to simplify the code in later changesets.
Wed, 25 Sep 2024 16:38:31 +0200 branchmap: use the proper experimental name in cacheutil
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 25 Sep 2024 16:38:31 +0200] rev 51965
branchmap: use the proper experimental name in cacheutil Otherwise they are not properly copied around.
Sat, 05 Oct 2024 18:58:20 -0400 interfaces: introduce and use a protocol class for the `mpatch` module
Matt Harbison <matt_harbison@yahoo.com> [Sat, 05 Oct 2024 18:58:20 -0400] rev 51964
interfaces: introduce and use a protocol class for the `mpatch` module See f2832de2a46c for details when this was done for the `bdiff` module. Two things worth pointing out- 1) The `cffi` module "inherits" the `pure` implementation of `patchedsize()` because of its wildcard import. 2) It's odd that the `mpatchError` lives in both `pure` and `cext` modules. I initially thought to move the exception into the new class, and make the existing class name an alias to the class in the new location, but the exception is created in C code by the `cext` module, so that won't work. I don't think a protocol class is approriate, because there's nothing special about the class to distinguish from any other `Exception`. Fortunately, nobody is catching this exception in core, so we can kick the can down the road.
Tue, 08 Oct 2024 21:46:22 +0200 branching: merge stable into default
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 08 Oct 2024 21:46:22 +0200] rev 51963
branching: merge stable into default
Tue, 08 Oct 2024 20:50:46 +0200 doctest: use the system hg to find the list of file to tests stable
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 08 Oct 2024 20:50:46 +0200] rev 51962
doctest: use the system hg to find the list of file to tests Same as what we do for the `.t` tests, but more manually.
Tue, 08 Oct 2024 15:54:59 +0200 relnotes: skip the test if the source repository is not readable stable
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 08 Oct 2024 15:54:59 +0200] rev 51961
relnotes: skip the test if the source repository is not readable The test want to run the relnot extension, with the tested mercurial, on the original repository. This is not always possible (e.g. when running with --pure and the repository use zstd for example). So we skip the test in this case.
Tue, 08 Oct 2024 15:54:59 +0200 check-code: document reason and suggest alternative to exit code negation stable
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 08 Oct 2024 15:54:59 +0200] rev 51960
check-code: document reason and suggest alternative to exit code negation The check was introduced in f48b075ff088. We trust the explanation from there.
Tue, 08 Oct 2024 15:54:59 +0200 ci: drop the HGMODULEPOLICY overwrite stable
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 08 Oct 2024 15:54:59 +0200] rev 51959
ci: drop the HGMODULEPOLICY overwrite The test runner have been setting them properly for a while now. So we don't need to do it manually anymore.
Tue, 08 Oct 2024 15:54:59 +0200 test: preserve the existing module policy config for testrepohg resuse stable
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 08 Oct 2024 15:54:59 +0200] rev 51958
test: preserve the existing module policy config for testrepohg resuse The test runner is, righfully, setting HGMODULEPOLICY to match the flavor requests to run the tests. However this mess with the `testrepohg` ability to run properly, as the newly set policy might be incompatible with its installation, or its ability to read the test repo. So we preserve the initial value in a dedicated variable and use it in the `testrepohg` helper.
Tue, 08 Oct 2024 15:54:59 +0200 module-policy: ignore empty module policy stable
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 08 Oct 2024 15:54:59 +0200] rev 51957
module-policy: ignore empty module policy This make the variable easier to work with, the empty value is not ambiguous about not wanting to get in the way.
Fri, 04 Oct 2024 13:26:29 -0400 tests: provide an alternate fake lock for filesystems without symlink support
Matt Harbison <matt_harbison@yahoo.com> [Fri, 04 Oct 2024 13:26:29 -0400] rev 51956
tests: provide an alternate fake lock for filesystems without symlink support
Fri, 04 Oct 2024 12:53:02 -0400 tests: disable `worker.backgroundclose` to stabilize a test on Windows
Matt Harbison <matt_harbison@yahoo.com> [Fri, 04 Oct 2024 12:53:02 -0400] rev 51955
tests: disable `worker.backgroundclose` to stabilize a test on Windows TIL that `worker.enabled=0` doesn't prevent these workers from spinning up. At any rate, there's already a whole lot of conditionalized output following `cat client.log`, the placement of the "starting 4 threads for background file closing" message seems unstable, and we don't care about those worker threads here. Preventing the message is better for test maintenance.
Fri, 04 Oct 2024 11:22:30 -0400 tests: fix lock file path mangling in `test-racy-mutations.t` on Windows
Matt Harbison <matt_harbison@yahoo.com> [Fri, 04 Oct 2024 11:22:30 -0400] rev 51954
tests: fix lock file path mangling in `test-racy-mutations.t` on Windows I guess `$TESTTMP_FORWARD_SLASH` gets translated by MSYS. This was in the `.foo_commit_out` file: sh: C;C:\\MinGW\\msys\\1.0\\Users\\Matt\\AppData\\Local\\Temp\\hgtests.1qc8jmdl\\child2\\test-racy-mutations.t-skip-detection\\waitlock_editor.sh: $ENOENT
Fri, 04 Oct 2024 11:10:45 -0400 tests: stabilize `test-status-eacces.t` on Windows
Matt Harbison <matt_harbison@yahoo.com> [Fri, 04 Oct 2024 11:10:45 -0400] rev 51953
tests: stabilize `test-status-eacces.t` on Windows As noted earlier, `chmod` doesn't complain in MSYS, but also doesn't alter the file permissions such that they are unreadable. I'm guessing the other lines of output in this area that are gated on `rhg` (or not) will also need this, but I don't want to dig too deeply into something that is apparently working well enough.
Fri, 04 Oct 2024 01:40:35 -0400 run-tests: bump the default timeout on Windows to 4x the normal value
Matt Harbison <matt_harbison@yahoo.com> [Fri, 04 Oct 2024 01:40:35 -0400] rev 51952
run-tests: bump the default timeout on Windows to 4x the normal value There are a ridiculous number of tests that timeout on Windows with the 360 sec default (~60). And because of the bug where timed out tests still run to completion before the results are thrown away[1], the timeout does nothing but waste time, so there's no reason to try to find a lower value that still works. For reference on my system: # Ran 909 tests, 116 skipped, 119 failed. python hash seed: 2052473208 real 151m44.322s user 0m0.077s sys 0m0.046s [1] I thought that I wrote a bug for this, but search isn't finding it.
Fri, 04 Oct 2024 01:29:45 -0400 run-tests: bump the minimum python to 3.8
Matt Harbison <matt_harbison@yahoo.com> [Fri, 04 Oct 2024 01:29:45 -0400] rev 51951
run-tests: bump the minimum python to 3.8 Presumably this was an oversight when hg was updated to 3.8.
Fri, 04 Oct 2024 01:23:31 -0400 tests: stabilize `test-sparse.t` on Windows
Matt Harbison <matt_harbison@yahoo.com> [Fri, 04 Oct 2024 01:23:31 -0400] rev 51950
tests: stabilize `test-sparse.t` on Windows One of the reserved characters for path values is '*', so it can't be used. Fortunately, missing this seems to not get in the way of any other tests, and it is removed shortly after with `rm -r foo*bar`, and the extant 'foo-bar' matches the pattern.
Thu, 03 Oct 2024 21:08:10 -0400 tests: fix a test hang on Windows when setting a debuglock
Matt Harbison <matt_harbison@yahoo.com> [Thu, 03 Oct 2024 21:08:10 -0400] rev 51949
tests: fix a test hang on Windows when setting a debuglock I have no idea why, but running the `hg -R auto-upgrade debuglock --set-lock` command near the end of `test-upgrade-repo.t` hangs the test. It does background the process and `killdaemons.py` runs without error, but control doesn't return to `run-tests.py` until the process is manually killed. I did notice that `$!` in MSYS is *not* the PID of the process that got backgrounded, even when a simple `sleep 60 &` is run in MSYS without the *.t file. When `killdaemons.py` is run manually with the PID in ProcessExplorer, the backgrounded process terminates immediately, and returns control to `run-tests.py`. This looks like it would be a race, but the test waits 10s for the lock file to appear before attempting to kill the process, so there's time. `hg serve` has a `--pid-file` option to write the pid to the file, but this is only a debug command, so I'm not bothering with cluttering the command line.
Thu, 03 Oct 2024 19:49:05 -0400 tests: conditionalize `chmod` usage in `test-upgrade-repo.t`
Matt Harbison <matt_harbison@yahoo.com> [Thu, 03 Oct 2024 19:49:05 -0400] rev 51948
tests: conditionalize `chmod` usage in `test-upgrade-repo.t` While the command itself doesn't error out on Windows, it also doesn't make the filesystem readonly. Therefore the repo gets altered to drop dirstate-v2, and puts it out of sync with that happens on Linux.
Wed, 02 Oct 2024 18:30:12 -0400 tests: print the actual timeout value used in `wait-on-file`
Matt Harbison <matt_harbison@yahoo.com> [Wed, 02 Oct 2024 18:30:12 -0400] rev 51947
tests: print the actual timeout value used in `wait-on-file` Previously, it was printing the time passed in, prior to it being scaled up to account for a longer timeout.
Wed, 02 Oct 2024 18:19:59 -0400 tests: stabilize `test-transaction-wc-rollback-race.t` on Windows
Matt Harbison <matt_harbison@yahoo.com> [Wed, 02 Oct 2024 18:19:59 -0400] rev 51946
tests: stabilize `test-transaction-wc-rollback-race.t` on Windows MSYS has a tendency to munge C:\Dir\SubDir\File into C:DirSubDirFile unless it is quoted, and that's what was happening here- there were a lot of these failures: file not created after 5 seconds: $TESTTMP/transaction-waiting I suspect quoting is only needed in the hook script that is generated (the catting of the log file pointed me in the right direction here), but I missed a spot and trial and error got me here. The quoting elsewhere doesn't harm anything and it was taking 7+ minutes to run this test when things were timing out, so I don't feel like reducing the quoting to the minimum required.
Wed, 02 Oct 2024 16:34:33 -0400 tests: stabilize `test-merge-partial-tool.t` on Windows
Matt Harbison <matt_harbison@yahoo.com> [Wed, 02 Oct 2024 16:34:33 -0400] rev 51945
tests: stabilize `test-merge-partial-tool.t` on Windows The test was previously failing because it was opening the shell scripts being used as an executable in a text editor, and problems cascaded from there.
Wed, 02 Oct 2024 11:43:22 -0400 tests: replace `hg id --debug -i` command substitution with non-debug command
Matt Harbison <matt_harbison@yahoo.com> [Wed, 02 Oct 2024 11:43:22 -0400] rev 51944
tests: replace `hg id --debug -i` command substitution with non-debug command The censor and convert tests were failing on Windows because the `--debug` flag also prints debug messages, and at least some of these were outputting: skip updating dirstate: identity mismatch ${node} Obviously that causes cascading problems. The other tests were OK, but it's better to use a non debug command for stability.
Tue, 01 Oct 2024 21:40:20 -0400 tests: correct Windows output to account for putting repos in `repo` subdir
Matt Harbison <matt_harbison@yahoo.com> [Tue, 01 Oct 2024 21:40:20 -0400] rev 51943
tests: correct Windows output to account for putting repos in `repo` subdir These were missed in 55c6ebd11cb9, due to being conditionalized and not running in CI.
Tue, 01 Oct 2024 21:34:44 -0400 tests: use pattern matching to mask `ECONNREFUSED` messages
Matt Harbison <matt_harbison@yahoo.com> [Tue, 01 Oct 2024 21:34:44 -0400] rev 51942
tests: use pattern matching to mask `ECONNREFUSED` messages The second and third one of these in `test-http-proxy.t` was failing on Windows. The others were found by grep and by failed tests when output was matched and an attempt was made to emit the mask pattern. The first clonebundles failure on Windows emitted: error fetching bundle: [WinError 10061] $ECONNREFUSED$ We should probably stringify that better to get rid of the "[WinError 10061]" part.
Sat, 05 Oct 2024 17:32:26 -0400 typing: add stub functions for `cext/charencoding`
Matt Harbison <matt_harbison@yahoo.com> [Sat, 05 Oct 2024 17:32:26 -0400] rev 51941
typing: add stub functions for `cext/charencoding` I'm not sure if it's better to have a separate file, and currently pytype doesn't really know how to handle these, so it's no help in figuring that out. Technically, these methods are part of the `mercurial.cext.parsers` module, so put them into the existing stub until there's a reason to split it out.
Sat, 05 Oct 2024 15:00:37 -0400 interfaces: introduce and use a protocol class for the `charencoding` module
Matt Harbison <matt_harbison@yahoo.com> [Sat, 05 Oct 2024 15:00:37 -0400] rev 51940
interfaces: introduce and use a protocol class for the `charencoding` module See f2832de2a46c for details when this was done for the `bdiff` module. This lets us dump the hack where the `pure` implementation was imported during the type checking phase to provide signatures for the module methods it provides. Now the protocol classes are starting to shine, because these methods are provided by `pure.charencoding` and `cext.parsers`, and references to `cffi.charencoding` and `cext.charencoding` are forwarded to them as appropriate by the `policy` module. But none of that matters, as long as the module returned provides the listed methods. The interface was copy/pasted from the `pure` module, but `jsonescapeu8fallback` is omitted because it is accessed from the `pure` module directly when the escaping fails in the primary module's `jsonescapeu8()`.
Fri, 04 Oct 2024 23:23:24 -0400 debugantivirusrunning: use bytes when opening a vfs file
Matt Harbison <matt_harbison@yahoo.com> [Fri, 04 Oct 2024 23:23:24 -0400] rev 51939
debugantivirusrunning: use bytes when opening a vfs file I noticed this when searching for "base85" to see if anything else in the previous commit needed to be annotated. This was added in 87047efbc6a6, after the mass byteification in 687b865b95ad.
Fri, 04 Oct 2024 23:21:41 -0400 interfaces: introduce and use a protocol class for the `base85` module
Matt Harbison <matt_harbison@yahoo.com> [Fri, 04 Oct 2024 23:21:41 -0400] rev 51938
interfaces: introduce and use a protocol class for the `base85` module See f2832de2a46c for details when this was done for the `bdiff` module. It looks like PEP-688 removed the special casing of `bytes` being a standin for any type of `ByteString`, and defines a `typing.Buffer` class (with a backport in `typing_extensions` for Python prior to 3.12). There's been a lot of churn in this area with pytype, but recent versions of pytype and PyCharm recognize this, and e.g. have `mercurial.node.hex()` defined as: from typing_extensions import Buffer def hex(data: Buffer, sep: str | bytes = ..., bytes_per_sep: int = ...) -> bytes This covers `bytes`, `bytearray`, and `memoryview` by default. Both of the C functions here use `y#` to parse the arguments, which means the arg is a byte-like object[2], so the args would appear to be better typed as `Buffer`. However, pytype has a bug that prevents using this from `typing_extensions`[3], and mypy complained `Unsupported left operand type for + ("memoryview")` in the pure module on line 37 (meaning it's only a subset of `Buffer`). So hold off on changing any of that for now. [1] https://peps.python.org/pep-0688/#no-special-meaning-for-bytes [2] https://docs.python.org/3/glossary.html#term-bytes-like-object [3] https://github.com/google/pytype/issues/1772
Fri, 04 Oct 2024 23:09:56 -0400 base85: avoid a spurious use-before-initialized warning in `pure` module
Matt Harbison <matt_harbison@yahoo.com> [Fri, 04 Oct 2024 23:09:56 -0400] rev 51937
base85: avoid a spurious use-before-initialized warning in `pure` module The error wasn't possible because the only way for `acc` to not be initialized was if `len(text) == 0`. But then `0 % 5 == 0`, so no attempt at padding was done. It's a simple enough fix to not have PyCharm flag this though. The value needs to be reset on each loop iteration, so it's a line copy, not a line move.
Mon, 30 Sep 2024 19:40:14 -0400 typing: add type annotations to `mercurial/mdiff.py`
Matt Harbison <matt_harbison@yahoo.com> [Mon, 30 Sep 2024 19:40:14 -0400] rev 51936
typing: add type annotations to `mercurial/mdiff.py` We'll leave converting `diffopts` to `attrs` as another project.
Mon, 30 Sep 2024 23:50:40 -0400 mdiff: convert a few block definitions from lists to tuples
Matt Harbison <matt_harbison@yahoo.com> [Mon, 30 Sep 2024 23:50:40 -0400] rev 51935
mdiff: convert a few block definitions from lists to tuples These were flagged by adding type hints. Some places were using a tuple of 4 ints to define a block, and others were using a list of 4. A tuple is better for typing, because we can define the length and the type of each entry. One of the places had to redefine the tuple, since writing to a tuple at an index isn't supported. This change spills out into the tests, and archeology says it was added to the repo in this state. There was no reason given for the divergence, and I suspect it wasn't intentional. It looks like `splitblock()` is completely unused in the codebase.
Sun, 29 Sep 2024 02:03:20 -0400 interfaces: add the optional `bdiff.xdiffblocks()` method
Matt Harbison <matt_harbison@yahoo.com> [Sun, 29 Sep 2024 02:03:20 -0400] rev 51934
interfaces: add the optional `bdiff.xdiffblocks()` method PyCharm flagged where this was called on the protocol class in `mdiff.py` in the previous commit, but pytype completely missed it. PyCharm is correct here, but I'm committing this separately to highlight this potential problem- some of the implementations don't implement _all_ of the methods the others do, and there's not a great way to indicate on a protocol class that a method or attribute is optional- that's kinda the opposite of what static typing is about. Making the method an `Optional[Callable]` attribute works here, and keeps both PyCharm and pytype happy, and the generated `mdiff.pyi` and `modules.pyi` look reasonable. We might be getting a little lucky, because the method isn't invoked directly- it is returned from another method that selects which block function to use. Except since it is declared on the protocol class, every module needs this attribute (in theory, but in practice this doesn't seem to be checked), so the check for it on the module has to change from `hasattr()` to `getattr(..., None)`. We defer defining the optional attrs to the type checking phase as an extra precaution- that way it isn't an attr with a `None` value at runtime if someone is still using `hasattr()`. As to why pytype missed this, I have no clue. The generated `mdiff.pyi` even has the global variable typed as `bdiff: intmod.BDiff`, so uses of it really should comply with what is on the class, protocol class or not.
Sat, 28 Sep 2024 19:12:18 -0400 interfaces: introduce and use a protocol class for the `bdiff` module
Matt Harbison <matt_harbison@yahoo.com> [Sat, 28 Sep 2024 19:12:18 -0400] rev 51933
interfaces: introduce and use a protocol class for the `bdiff` module This is allowed by PEP 544[1], and we basically follow the example there. The class here is copied from `mercurial.pure.bdiff`, and the implementation removed. There are several modules that have a few different implementations, and the implementation chosen is controlled by `HGMODULEPOLICY`. The module is loaded via `mercurial/policy.py`, and has been inferred by pytype as `Any` up to this point. Therefore it and PyCharm were blind to all functions on the module, and their signatures. Also, having multiple instances of the same module allows their signatures to get out of sync. Introducing a protocol class allows the loaded module that is stored in a variable to be given type info, which cascades through the various places it is used. This change alters 11 *.pyi files, for example. In theory, this would also allow us to ensure the various implementations of the same module are kept in alignment- simply import the module in a test module, attempt to pass it to a function that uses the corresponding protocol as an argument, and run pytype on it. In practice, this doesn't work (yet). PyCharm (erroneously) flags imported modules being passed where a protocol class is used[2]. Pytype has problems the other way- it fails to detect when a module that doesn't adhere to the protocol is passed to a protocol argument. The good news is that mypy properly detects this case. The bad news is that mypy spews a bunch of other errors when importing even simple modules, like the various `bdiff` modules. Therefore I'm punting on the tests for now because the type info around a loaded module in PyCharm is a clear win by itself. [1] https://peps.python.org/pep-0544/#modules-as-implementations-of-protocols [2] https://youtrack.jetbrains.com/issue/PY-58679/Support-modules-implementing-protocols
Sat, 28 Sep 2024 19:11:39 -0400 mdiff: tweak calls into `bdiff.fixws` to match its type hints
Matt Harbison <matt_harbison@yahoo.com> [Sat, 28 Sep 2024 19:11:39 -0400] rev 51932
mdiff: tweak calls into `bdiff.fixws` to match its type hints It turns out that protocol classes can be used for modules too, which is great because all of the dynamically loaded modules (and their attributes) are currently inferred as `Any`. See the next commit for details. A protocol class for the `bdiff` module detected this (trivial) mismatch, so correct it first. The various implementations of this method are typed as taking a `bool`. The `cext` implementation parses its arguments with `PyArg_ParseTuple(args, "Sb:fixws", &s, &allws)`, which wants an `int`. But experimenting in `hg debugshell` under py38, passing `True` or `False` to `cext.fixws()` also works. We can change the implementation to use "p" (which was introduced in py33) instead of "b", but that's beyond the scope of this.
Tue, 01 Oct 2024 15:04:06 -0400 util: minor copy editing of the documentation for `mmapread()`
Matt Harbison <matt_harbison@yahoo.com> [Tue, 01 Oct 2024 15:04:06 -0400] rev 51931
util: minor copy editing of the documentation for `mmapread()`
Tue, 01 Oct 2024 15:00:39 -0400 util: make `mmapread()` work on Windows again
Matt Harbison <matt_harbison@yahoo.com> [Tue, 01 Oct 2024 15:00:39 -0400] rev 51930
util: make `mmapread()` work on Windows again 522b4d729e89 started referencing `mmap.MAP_PRIVATE`, but that's not available on Windows, so `hg version` worked, but `make local` did not. That commit also started calling the constructor with the fine-grained `flags` and `prot` args, but those aren't available on Windows either[1] (though the backing C code doesn't seem conditionalized to disallow usage of them). I assume the change away from from the `access` arg was to provide the same options, plus `MAP_POPULATE`. Looking at the source code[2], they're not quite the same- `ACCESS_READ` is equivalent to `flags = MAP_SHARED` and `prot = PROT_READ`. `MAP_PRIVATE` is only used with `ACCESS_COPY`, which allows read and write. Therefore, we can't quite get the same baseline flags on Windows, but this was the status quo ante and `MAP_POPULATE` is a Linux thing, so presumably it works. I realize that typically the OS differences are abstracted into the platform modules, but I'm leaving it here so that it is obvious what the differences are between the platforms. [1] https://docs.python.org/3/library/mmap.html#mmap.mmap [2] https://github.com/python/cpython/blob/5e0abb47886bc665eefdcc19fde985f803e49d4c/Modules/mmapmodule.c#L1539
Fri, 27 Sep 2024 12:30:37 -0400 typing: add type annotations to the dirstate classes
Matt Harbison <matt_harbison@yahoo.com> [Fri, 27 Sep 2024 12:30:37 -0400] rev 51929
typing: add type annotations to the dirstate classes The basic procedure here was to use `merge-pyi` to merge the `git/dirstate.pyi` file in (after renaming the interface class to match), cleaning up the import statement mess, and then repeating the procedure for `mercurial/dirstate.pyi`. Surprisingly, git's dirstate had more hints inferred in its *.pyi file. After that, it was a manual examination of each method in the interface, and how they were implemented in the core and git classes to verify what was inferred by pytype, and fill in the missing gaps. Since this involved jumping around between three different files, I applied the same type info to all three at the same time. Complex types I rolled up into type aliases in the interface module, and used that as needed. That way if it changes, there's one place to edit. There are some hints still missing, and some documentation that doesn't match the signatures. They should all be marked with TODOs. There are also a bunch of methods on the core class that aren't on the Protocol class that seem like maybe they should be (like `set_tracked()`). There are even more methods missing from the git class. But that's a project for another time.
Fri, 27 Sep 2024 12:10:25 -0400 interfaces: change a couple of dirstate fields to `@property`
Matt Harbison <matt_harbison@yahoo.com> [Fri, 27 Sep 2024 12:10:25 -0400] rev 51928
interfaces: change a couple of dirstate fields to `@property` As I was adding type hints here and to the concrete classes, PyCharm flagged the property in the core class as not being compatible with the base class's version.
Fri, 27 Sep 2024 12:05:48 -0400 git: make `dirstate.parents()` return a list like the core class
Matt Harbison <matt_harbison@yahoo.com> [Fri, 27 Sep 2024 12:05:48 -0400] rev 51927
git: make `dirstate.parents()` return a list like the core class The core class returned a list, so that's how I type annotated it, and this got flagged. I suppose we could annotate it as a `Sequence[bytes]`, but it's a trivial difference.
Fri, 27 Sep 2024 11:57:42 -0400 typing: add type hints for the overloads of `matchmod.readpatternfile()`
Matt Harbison <matt_harbison@yahoo.com> [Fri, 27 Sep 2024 11:57:42 -0400] rev 51926
typing: add type hints for the overloads of `matchmod.readpatternfile()` The return type is conditional on an argument passed, and it very much confused both pytype and PyCharm inside `dirstate._ignorefileandline()` after adding type hints for the return value there.
Thu, 26 Sep 2024 18:52:46 -0400 dirstate: subclass the new dirstate Protocol class
Matt Harbison <matt_harbison@yahoo.com> [Thu, 26 Sep 2024 18:52:46 -0400] rev 51925
dirstate: subclass the new dirstate Protocol class Behold the chaos that ensues. We'll use the generated *.pyi files to apply type annotations to the interface, and see how much agrees with the documentation. Since the CamelCase name was used to try to work around pytype issues with zope interfaces and is a new innovation this cycle (see c1d7ac70980b), drop the CamelCase name. I think the Protocol classes *should* be CamelCase, but that can be done later in one pass. For now, the CamelCase alias is extra noise in the *.pyi files.
Thu, 26 Sep 2024 18:51:03 -0400 git: correct some signature mismatches between dirstate and the Protocol class
Matt Harbison <matt_harbison@yahoo.com> [Thu, 26 Sep 2024 18:51:03 -0400] rev 51924
git: correct some signature mismatches between dirstate and the Protocol class These were flagged by PyCharm when subclassing the Protocol class. Note that both `is_changing_xxx` were only flagged when the Protocol class used a plain field, as mentioned in the previous commit. After converting those attrs in the Protocol class to @property to match the regular dirstate class, it stopped flagging these. But I don't think that makes sense- `@property` should look like an attribute to the outside world, not a callable.
Thu, 26 Sep 2024 18:15:36 -0400 interfaces: convert the zope `Attribute` attrs to regular fields
Matt Harbison <matt_harbison@yahoo.com> [Thu, 26 Sep 2024 18:15:36 -0400] rev 51923
interfaces: convert the zope `Attribute` attrs to regular fields At this point, we should have a useful protocol class. The file syntax requires the type to be supplied for any fields that are declared, but we'll leave the complex ones partially unspecified for now, for simplicity. (Also, the things documented as `Callable` are really as future type annotating worked showed- roll with it for now, but they're marked as TODO for fixing later.) All of the fields and all of the attrs will need type annotations, or the type rules say they are considered to be `Any`. That can be done in a separate pass, possibly applying the `dirstate.pyi` file generated from the concrete class. The first cut of this turned the `interfaceutil.Attribute` fields into plain fields, and thus the types on them. PyCharm flagged a few things as having incompatible signatures when the concrete dirstate class subclassed this, when the concrete class has them declared as `@property`. So they've been changed to `@property` here in those cases. The remaining fields that are decorated in the concrete class have comments noting the differences. We'll see if they need to be changed going forward, but leave them for now. We'll be in trouble if the `@util.propertycache` is needed, because we can't import that module here at runtime, due to circular imports.
Thu, 26 Sep 2024 18:09:33 -0400 interfaces: add the missing `self` arg to the dirstate Protocol class
Matt Harbison <matt_harbison@yahoo.com> [Thu, 26 Sep 2024 18:09:33 -0400] rev 51922
interfaces: add the missing `self` arg to the dirstate Protocol class This clears all of the errors that PyCharm has been flagging in this file, since the zope interface was declared here.
Thu, 26 Sep 2024 18:04:31 -0400 interfaces: convert the dirstate zope interface to a Protocol class
Matt Harbison <matt_harbison@yahoo.com> [Thu, 26 Sep 2024 18:04:31 -0400] rev 51921
interfaces: convert the dirstate zope interface to a Protocol class This is a small trial run for converting the repository interfaces enmasse, in the same series of steps. I'm not sure that this current code is valid (it has zope attribute fields, and it's missing all of the `self` args on its functions, but that was the previous state of things, and made PyCharm really unhappy). But it will be easier to review the repository interface changes if this change is separate from adding `self` and dropping the zope attributes all over. Having an empty constructor in a protocol is weird. I'm not sure if these args should be converted to fields that all subclasses would have, and comments around existing attributes say some should be going away. Comment it out for now so that it's not in the way, but also not forgotten.
Thu, 26 Sep 2024 17:47:39 -0400 tests: disable `test-check-interfaces.py` while converting to protocols
Matt Harbison <matt_harbison@yahoo.com> [Thu, 26 Sep 2024 17:47:39 -0400] rev 51920
tests: disable `test-check-interfaces.py` while converting to protocols The goal is to convert everything, so get it all out of the way. The interfaces don't get that much maintenance that this needs to be tested right now.
Wed, 02 Oct 2024 14:51:56 +0100 tests: always access the mercurial repo through `helpers-testrepo.sh`
Arseniy Alekseyev <aalekseyev@janestreet.com> [Wed, 02 Oct 2024 14:51:56 +0100] rev 51919
tests: always access the mercurial repo through `helpers-testrepo.sh` In some contexts the mercurial repo needs to be accessed through system hg. That's what `helpers-testrepo.sh` enforces, but some tests incorrectly use the mercurial repo without going through that script. This patch fixes those tests.
Wed, 02 Oct 2024 14:49:07 +0100 tests: in helpers-testrepo.sh switch from shell aliases to functions
Arseniy Alekseyev <aalekseyev@janestreet.com> [Wed, 02 Oct 2024 14:49:07 +0100] rev 51918
tests: in helpers-testrepo.sh switch from shell aliases to functions The reason is that I want this script to work in non-interactive shells too. (will be used in the next commit)
Fri, 27 Sep 2024 17:25:15 +0100 rust: fix the deprecation warning in NaiveDateTime::from_timestamp
Arseniy Alekseyev <aalekseyev@janestreet.com> [Fri, 27 Sep 2024 17:25:15 +0100] rev 51917
rust: fix the deprecation warning in NaiveDateTime::from_timestamp This warning appears between chrono 0.4.34 and 0.4.38, so isn't affecting the current lock file, but it would come when we upgraded the version.
Fri, 27 Sep 2024 15:53:56 +0200 run-tests: ensure that --no-rust do not use rust stable
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 27 Sep 2024 15:53:56 +0200] rev 51916
run-tests: ensure that --no-rust do not use rust Since having a valid value in HGWITHRUSTEXT is enough to trigger the use of rust, we need to unset it before install to be sure.
Sat, 20 Jul 2024 03:04:48 +0200 revlogutils: teach issue6528 filtering about grandparents
Joerg Sonnenberger <joerg@bec.de> [Sat, 20 Jul 2024 03:04:48 +0200] rev 51915
revlogutils: teach issue6528 filtering about grandparents During dynamic filtering, we should assume that the current repository is correct. Therefore the parents of the delta base can tell us if that parent has metadata without having to build the whole text.
Sat, 20 Jul 2024 00:43:08 +0200 revlogutils: remember known metadata parents for issue6528
Joerg Sonnenberger <joerg@bec.de> [Sat, 20 Jul 2024 00:43:08 +0200] rev 51914
revlogutils: remember known metadata parents for issue6528 In the cases where the parent revs tell us for sure that the parent has metadata, remember this fact to avoid content recomputations later.
Sat, 20 Jul 2024 00:44:59 +0200 revlogutils: for issue6528 fix, pre-cache nullrev as metadata-free
Joerg Sonnenberger <joerg@bec.de> [Sat, 20 Jul 2024 00:44:59 +0200] rev 51913
revlogutils: for issue6528 fix, pre-cache nullrev as metadata-free
Sat, 20 Jul 2024 00:59:50 +0200 revlogutils: for issue6528 fix, cache results for null changes
Joerg Sonnenberger <joerg@bec.de> [Sat, 20 Jul 2024 00:59:50 +0200] rev 51912
revlogutils: for issue6528 fix, cache results for null changes
Sat, 20 Jul 2024 00:41:37 +0200 revlogutils: fix _chunk() reference
Joerg Sonnenberger <joerg@bec.de> [Sat, 20 Jul 2024 00:41:37 +0200] rev 51911
revlogutils: fix _chunk() reference _chunk is only found in the inner revlog object and not directly exposed outside.
Mon, 02 Sep 2024 22:14:38 +0200 rev-branch-cache: reenable memory mapping of the revision data
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 02 Sep 2024 22:14:38 +0200] rev 51910
rev-branch-cache: reenable memory mapping of the revision data Now that we are no longer truncating it, we can mmap it again. This provide a sizeable speedup on repository with a very large amount of revision for example for a mozilla-try clone with 5 793 383 revisions, this provide a speedup of 5ms - 10ms. Since they happens within the "critical" locked path during push. These miliseconds are important. In addition, the v3 branchmap format is use the rev-branch-cache more than the v2 branchmap cache so this will be important. On smaller repository we consistently see an improvement of one or two percents, but the gain in absolute time is usually < 10 ms. #### benchmark.name = hg.command.unbundle # benchmark.variants.issue6528 = disabled # benchmark.variants.reuse-external-delta-parent = yes # benchmark.variants.revs = any-1-extra-rev # benchmark.variants.source = unbundle # benchmark.variants.verbosity = quiet ### data-env-vars.name = mozilla-try-2024-03-26-zstd-sparse-revlog ## bin-env-vars.hg.flavor = default e51161b12c7e: 3.527923 ebdcfe85b070: 3.468178 (-1.69%, -0.06) ## bin-env-vars.hg.flavor = rust e51161b12c7e: 3.580158 ebdcfe85b070: 3.480564 (-2.78%, -0.10) ### data-env-vars.name = mozilla-try-2024-03-26-ds2-pnm ## bin-env-vars.hg.flavor = rust e51161b12c7e: 3.527923 ebdcfe85b070: 3.468178 (-1.69%, -0.06)
Wed, 25 Sep 2024 12:42:47 +0200 rev-branch-cache: have debugupdatecache warm rbc too
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 25 Sep 2024 12:42:47 +0200] rev 51909
rev-branch-cache: have debugupdatecache warm rbc too Since the "v2" format can be more performant than the "v1" format (thanks to mmap), it is useful to be able to make sure it is present
Wed, 25 Sep 2024 12:49:32 +0200 rev-branch-cache: schedule a write of the "v2" format if we read from "v1"
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 25 Sep 2024 12:49:32 +0200] rev 51908
rev-branch-cache: schedule a write of the "v2" format if we read from "v1" The new file can be memorymapped, while the old one cannot. So there is value in having the v2 format around as soon a possible.
Tue, 24 Sep 2024 15:44:10 +0200 rev-branch-cache: fallback on "v1" data if no v2 is found
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 24 Sep 2024 15:44:10 +0200] rev 51907
rev-branch-cache: fallback on "v1" data if no v2 is found This will help smooth the transition to the v2 format for existing large repository.
Tue, 24 Sep 2024 03:16:35 +0200 rev-branch-cache: increment the version to "v2"
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 24 Sep 2024 03:16:35 +0200] rev 51906
rev-branch-cache: increment the version to "v2" We want to ensure no older clients will truncate the file under us. So we need to change their name. We don't change the rest of the format (unfortunaly).
Tue, 24 Sep 2024 00:16:23 +0200 rev-branch-cache: stop truncating cache file
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 24 Sep 2024 00:16:23 +0200] rev 51905
rev-branch-cache: stop truncating cache file Truncating the file prevent the safe use of mmap. So instead of overwrite the existing data. If more than 20% of the file is to be overwritten, we rewrite the whole file instead. Such whole rewrite is done by replacing the old one with a new one, so mmap of the old file would be affected. This prepare a more aggressive use of mmap in later patches.
Tue, 24 Sep 2024 00:16:04 +0200 rev-branch-cache: make sure we close the name file we open
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 24 Sep 2024 00:16:04 +0200] rev 51904
rev-branch-cache: make sure we close the name file we open We were various opening without with or try. Adding a try would not hurt.
Mon, 23 Sep 2024 23:52:45 +0200 rev-branch-cache: add a way to force rewrite of the cache
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 23 Sep 2024 23:52:45 +0200] rev 51903
rev-branch-cache: add a way to force rewrite of the cache This seems useful to be able to do this, for example during strip. This align with the intended expressed in the `test-branches.t` test. This will help use being more confident about future changes in the series.
Tue, 24 Sep 2024 00:01:30 +0200 rev-branch-cache: issue more truthful "truncating" message
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 24 Sep 2024 00:01:30 +0200] rev 51902
rev-branch-cache: issue more truthful "truncating" message First, don't pretend it truncate to 40 when it actually truncate to 0. Second, don't pretend to truncate to 0 when the file is already empty/missing.
Sun, 22 Sep 2024 15:55:46 +0200 rev-branch-cache: move the code in a dedicated module
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 22 Sep 2024 15:55:46 +0200] rev 51901
rev-branch-cache: move the code in a dedicated module The branchmap module is getting huge and the rev branch cache is fully independent, lets move it elsewhere.
Wed, 25 Sep 2024 01:16:47 -0400 statichttprepo: stop shadowing the `bytes` builtin
Matt Harbison <matt_harbison@yahoo.com> [Wed, 25 Sep 2024 01:16:47 -0400] rev 51900
statichttprepo: stop shadowing the `bytes` builtin PyCharm flagged it, but I also misunderstood when looking at the code, because the name implied a byte string, not a number.
Wed, 25 Sep 2024 01:12:39 -0400 statichttprepo: fix `httprangereader.read()` for py3
Matt Harbison <matt_harbison@yahoo.com> [Wed, 25 Sep 2024 01:12:39 -0400] rev 51899
statichttprepo: fix `httprangereader.read()` for py3 It looks like there were a bunch of problems, not all of them py3 related: 1) The signature of BinaryIO.read() is -1, not None 2) The `end` variable can't be bytes and interpolate into str with "%s" 3) The `end` variable can't be an int and interpolate into str with "%s" 4) The result slicing could be out of bounds if more is requested than returned I guess if somebody would have called `read(-1)` (either directly or because a wrapper defaults to that), it wouldn't have been handled correctly. The fact that it is a valid value meaning to read everything requires some additional changes later in the method around when it slices the byte string that was read, but that seems to have already been broken.
Wed, 25 Sep 2024 00:52:44 -0400 statichttprepo: use a context manager to handle a file descriptor
Matt Harbison <matt_harbison@yahoo.com> [Wed, 25 Sep 2024 00:52:44 -0400] rev 51898
statichttprepo: use a context manager to handle a file descriptor I'm not sure if this should be reduced to `vfs.exists()`. That would seem to be equivalent code (since the result of the read is ignored, so we can't tell if the file actually has content, which has been the state of things going back to 98b6c3dde237), but this is at least safer file descriptor handling.
Thu, 26 Sep 2024 02:58:50 +0200 profiling: pass bytes to `_()` and `error.Abort()`
Matt Harbison <matt_harbison@yahoo.com> [Thu, 26 Sep 2024 02:58:50 +0200] rev 51897
profiling: pass bytes to `_()` and `error.Abort()` And of course `other_tool_name` is str too, so that needs to be converted. The type hints from PyCharm say `sys.monitoring.get_tool()` can return None, so handle that case explicitly before it trips up pytype.
Mon, 08 Jul 2024 22:46:04 +0200 exchange: improve computation of relevant markers for large repos
Joerg Sonnenberger <joerg@bec.de> [Mon, 08 Jul 2024 22:46:04 +0200] rev 51896
exchange: improve computation of relevant markers for large repos Compute the candidate nodes with relevant markers directly from keys of the predecessors/successors/children dictionaries of obsstore. This is faster than iterating over all nodes directly. This test could be further improved for repositories with relative few markers compared to the repository size, but this is no longer hot already. With the current loop structure, the obshashrange use works as well as before as it passes lists with a single node. Adjust the interface by allowing revision lists as well as node lists. This helps cases that computes ancestors as it reduces the materialisation cost. Use this in _pushdiscoveryobsmarker and _getbundleobsmarkerpart. Improve the latter further by directly using ancestors(). Performance benchmarks show notable and welcome improvement to no-op push and pull (that would also apply to other push/pull). This apply to push and pull done without evolve. ### push/pull Benchmark parameter # bin-env-vars.hg.flavor = default # benchmark.variants.explicit-rev = none # benchmark.variants.protocol = ssh # benchmark.variants.revs = none ## benchmark.name = hg.command.pull # data-env-vars.name = mercurial-devel-2024-03-22-zstd-sparse-revlog before: 5.968537 seconds after: 5.668507 seconds (-5.03%, -0.30) # data-env-vars.name = tryton-devel-2024-03-22-zstd-sparse-revlog before: 1.446232 seconds after: 0.835553 seconds (-42.23%, -0.61) # data-env-vars.name = netbsd-src-draft-2024-09-19-zstd-sparse-revlog before: 5.777412 seconds after: 2.523454 seconds (-56.32%, -3.25) ## benchmark.name = hg.command.push # data-env-vars.name = mercurial-devel-2024-03-22-zstd-sparse-revlog before: 6.155501 seconds after: 5.885072 seconds (-4.39%, -0.27) # data-env-vars.name = tryton-devel-2024-03-22-zstd-sparse-revlog before: 1.491054 seconds after: 0.934882 seconds (-37.30%, -0.56) # data-env-vars.name = netbsd-src-draft-2024-09-19-zstd-sparse-revlog before: 5.902494 seconds after: 2.957644 seconds (-49.89%, -2.94) There is not notable different in these result using the "rust" flavor instead of the "default". The performance impact on the same operation when using evolve were also tested and no impact was noted.
Fri, 20 Sep 2024 21:31:58 -0400 typing: make the localrepo classes known to pytype
Matt Harbison <matt_harbison@yahoo.com> [Fri, 20 Sep 2024 21:31:58 -0400] rev 51895
typing: make the localrepo classes known to pytype 9d4ad05bc91c and 1b17309cdaab both mentioned making `bundlerepository` and `unionrepository` subclass `localrepository` during the type checking phase, but that didn't apply to pytype in practice. See bcaa5d408657 and friends for how the zope interfaces confuse pytype, and end up converting the classes they decorate into `Any`. This commit is slightly more complex though, because `localrepository` has mixin classes applied to it when it is instantiated. Specifically, `RevlogFileStorage` is added, which adds `def file(f)` (which isn't defined on `localrepository`). Therefore a list of `localrepository` superclasses is provided during type checking to account for the mixins. Without this, the `bundlerepository` class gets flagged when it attempts to call its superclass implementation of `file()`. Note that pytype doesn't understand these mixin superclasses (it marks the superclass of `localrepository` as `Any`, because they are zope interfaces it doesn't understand), but that's enough to get it to not flag `bundlerepository`. PyCharm also stops flagging it as a missing function, though it seems like it is able to handle the zope interfaces.
Mon, 23 Sep 2024 14:58:37 -0400 typing: add a handful more annotations to `mercurial/vfs.py`
Matt Harbison <matt_harbison@yahoo.com> [Mon, 23 Sep 2024 14:58:37 -0400] rev 51894
typing: add a handful more annotations to `mercurial/vfs.py` These came out of refactoring into a protocol class, but they can stand on their own. The `audit` callback is kinda screwy because the internal lambda and the callable for `pathutil.pathauditor` have different args and a different return type. It's conditionalized where it is called, and can be cleaned up later if desired.
Sat, 21 Sep 2024 13:53:05 -0400 typing: make `vfs.isfileorlink_checkdir()` path arg required
Matt Harbison <matt_harbison@yahoo.com> [Sat, 21 Sep 2024 13:53:05 -0400] rev 51893
typing: make `vfs.isfileorlink_checkdir()` path arg required The only caller to this is `merge._checkunknownfile()`, which supplies a value. That's good, because `util.localpath()` immediately uses the value to call a method on it on Windows. The posix implementation returns the value unaltered, but then `pathutil.finddirs_rev_noroot()` would have exploded.
Fri, 20 Sep 2024 20:16:12 -0400 typing: manually add type annotations to `mercurial/vfs.py`
Matt Harbison <matt_harbison@yahoo.com> [Fri, 20 Sep 2024 20:16:12 -0400] rev 51892
typing: manually add type annotations to `mercurial/vfs.py` This isn't everything, but hopefully it's close enough to hack on a protocol class.
Fri, 20 Sep 2024 16:36:28 -0400 typing: correct pytype mistakes in `mercurial/vfs.py`
Matt Harbison <matt_harbison@yahoo.com> [Fri, 20 Sep 2024 16:36:28 -0400] rev 51891
typing: correct pytype mistakes in `mercurial/vfs.py` With the previous changes in this series (prior to merging the *.pyi file), this wasn't too bad- the only definitively wrong things were the `data` argument to `writelines()`, and the return type on `backgroundclosing()` (both of these errors were dropped in the previous commit; for some reason pytype doesn't like `contextlib._GeneratorContextManager`, even though that's what it determined it is): File "/mnt/c/Users/Matt/hg/mercurial/vfs.py", line 411, in abstractvfs: Bad return type 'contextlib._GeneratorContextManager' for generator function abstractvfs.backgroundclosing [bad-yield-annotation] Expected Generator, Iterable or Iterator PyCharm thinks this is `Generator[backgroundfilecloser], Any, None]`, which can be reduced to `Iterator[backgroundfilecloser]`, but pytype flagged the line that calls `yield` without an argument unless it's also `Optional`. PyCharm is happy either way. For some reason, `Iterable` didn't work for pytype: File "/mnt/c/Users/Matt/hg/mercurial/vfs.py", line 390, in abstractvfs: Function contextlib.contextmanager was called with the wrong arguments [wrong-arg-types] Expected: (func: Callable[[Any], Iterator]) Actually passed: (func: Callable[[Any, Any, Any], Iterable[Optional[Any]]]) Attributes of protocol Iterator[_T_co] are not implemented on Iterable[Optional[Any]]: __next__
Fri, 20 Sep 2024 13:38:13 -0400 typing: run `merge-pyi` on `mercurial/vfs.py`
Matt Harbison <matt_harbison@yahoo.com> [Fri, 20 Sep 2024 13:38:13 -0400] rev 51890
typing: run `merge-pyi` on `mercurial/vfs.py` The *.pyi file was generated with pytype 2023.11.21. There were a few things here that were wrong (e.g. `writelines()` takes an `Iterable[bytes]`, not `bytes`, or inexplicable errors like importing several of the vfs classes from this very module), and those changes have been dropped manually here.
Fri, 20 Sep 2024 01:10:17 -0400 typing: add type annotations to `mercurial.util.makelock()`
Matt Harbison <matt_harbison@yahoo.com> [Fri, 20 Sep 2024 01:10:17 -0400] rev 51889
typing: add type annotations to `mercurial.util.makelock()` This bubbles up into the `vfs` classes, so get this out of the way.
Fri, 20 Sep 2024 00:20:24 -0400 util: avoid a leaked file descriptor in `util.makelock()` exceptional case
Matt Harbison <matt_harbison@yahoo.com> [Fri, 20 Sep 2024 00:20:24 -0400] rev 51888
util: avoid a leaked file descriptor in `util.makelock()` exceptional case
Fri, 20 Sep 2024 00:04:09 -0400 typing: add type annotations to the `mercurial.util.filestat` class
Matt Harbison <matt_harbison@yahoo.com> [Fri, 20 Sep 2024 00:04:09 -0400] rev 51887
typing: add type annotations to the `mercurial.util.filestat` class It's referenced in the `vfs` classes, so get this out of the way to help there. The `TypeVar` definition and its usage was copied from the existing `util.pyi` file.
Fri, 20 Sep 2024 12:15:08 -0400 vfs: do minor copyediting on comments and doc strings
Matt Harbison <matt_harbison@yahoo.com> [Fri, 20 Sep 2024 12:15:08 -0400] rev 51886
vfs: do minor copyediting on comments and doc strings These were flagged by PyCharm, so clear them from the gutter.
Fri, 20 Sep 2024 01:16:16 -0400 vfs: simplify the `abstractvfs.rename()` implementation
Matt Harbison <matt_harbison@yahoo.com> [Fri, 20 Sep 2024 01:16:16 -0400] rev 51885
vfs: simplify the `abstractvfs.rename()` implementation PyCharm was yapping about `util.rename()` not returning anything, because it is typed to return `None`, but the value was captured and returned after calling `_avoidambig()`. Instead, drop all of that, unconditionally rename, and then call `_avoidambig()` if appropriate. While we're here, convert the ersatz ternary operator into a modern one to help pytype. When a variable is initialized the old way, pytype tends to assign the type of the LHS of the `and`. In this case, that's a bool, and it will get confused that bool doesn't have a `stat` attribute once this method gets more type annotations. (Currently it thinks the `checkambig` arg is `Any`, so it doesn't care.)
Fri, 20 Sep 2024 00:07:39 -0400 vfs: use @abstractmethod instead of homebrewing abstract methods
Matt Harbison <matt_harbison@yahoo.com> [Fri, 20 Sep 2024 00:07:39 -0400] rev 51884
vfs: use @abstractmethod instead of homebrewing abstract methods The latter confuses PyCharm after adding more type annotations when, for example, `abstractvfs.rename()` calls `_auditpath()`- the latter unconditionally raised an error, so PyCharm thought the code that came after is unreachable. It also tricked pytype into marking the return type as `Never`, which isn't available until Python 3.11 (outside of `typing_extensions`). This also avoid PyCharm warnings that the call to the superclass constructor was missed (it couldn't be called because it raised an error to prevent instantiation). The statichttprepo module needed to be given an override for one of the abstract methods, so that it can be instantiated. In `abstractvfs`, this method is only called by `rename()`, so I think we can leave this empty. We raise an error in case somebody accidentally calls it in the future- it would have raised this same error prior to this change. I couldn't wrangle `import-checker.py` into accepting importing `ABC` and `abstractmethod`- for each subsequent import, it reports something like: stdlib import "contextlib" follows local import: abc I suspect the problem is that near the `if fullname != '__future__'` check, if the module doesn't fall into the error case, `seenlocal` gets set to the module name. That causes it to be treated like a local module on the next iteration, even though it is in `stdlib_modules`.
Thu, 19 Sep 2024 21:03:10 -0400 vfs: modernize the detection of the main thread
Matt Harbison <matt_harbison@yahoo.com> [Thu, 19 Sep 2024 21:03:10 -0400] rev 51883
vfs: modernize the detection of the main thread There weren't a lot of good choices when py27 was supported, but starting with py34, `threading.main_thread()` is available. This gets us away from an undocumented, internal symbol, and drops a pytype suppression statement. It is also apparently no longer reliable after a process fork.[1][2] [1] https://stackoverflow.com/a/23207116 [2] https://github.com/python/cpython/blob/v3.6.3/Lib/threading.py#L1334
Sun, 22 Sep 2024 17:06:31 -0400 store: fix a signature mismatch for a vfs subclass
Matt Harbison <matt_harbison@yahoo.com> [Sun, 22 Sep 2024 17:06:31 -0400] rev 51882
store: fix a signature mismatch for a vfs subclass This was flagged by PyCharm. I'm not sure why pytype doesn't catch this- it's not excluded from the modules that are currently checked.
Sun, 22 Sep 2024 17:02:42 -0400 lfs: fix various signature mismatches for vfs subclasses
Matt Harbison <matt_harbison@yahoo.com> [Sun, 22 Sep 2024 17:02:42 -0400] rev 51881
lfs: fix various signature mismatches for vfs subclasses These were flagged by PyCharm. I'm not sure why pytype doesn't catch these- only `hgext/lfs/__init__.py` in the lfs extension is excluded from being checked. I'm not sure if the `*insidef` arg to `join()` was meant as an internal convencience, because I see another class that gets flagged for the same signature problem (to be fixed next). But I don't feel bold enough to make this an internal function, and provide a simplified public `join()` on the `vfs` classes. That can still be done later, if desired. For now, process the additional args and pass them along, even though there don't appear to be any current callers that provide extra args to these classes. We need all of the subclasses to agree on the signature, or they won't be considered to implement the `Vfs` protocol being developed. While we're copy/pasting from the base class, bring the type annotations along for the ride.
Sun, 22 Sep 2024 17:18:05 -0400 util: add a comment to suppress a PyCharm warning about a PEP 8 violation
Matt Harbison <matt_harbison@yahoo.com> [Sun, 22 Sep 2024 17:18:05 -0400] rev 51880
util: add a comment to suppress a PyCharm warning about a PEP 8 violation Slowly trying to get rid of silly warnings, so that real problems aren't hidden.
Sun, 22 Sep 2024 17:15:20 -0400 keepalive: fix a signature mismatch for a http.client.HTTPResponse subclass
Matt Harbison <matt_harbison@yahoo.com> [Sun, 22 Sep 2024 17:15:20 -0400] rev 51879
keepalive: fix a signature mismatch for a http.client.HTTPResponse subclass Also flagged by PyCharm. This is checked by pytype too, so I'm not sure why it misses this. I verified in py36 that this argument is documented for the function, so maybe this is py2 legacy.
Sun, 22 Sep 2024 17:11:10 -0400 cbor: drop a duplicate dictionary initialization entry
Matt Harbison <matt_harbison@yahoo.com> [Sun, 22 Sep 2024 17:11:10 -0400] rev 51878
cbor: drop a duplicate dictionary initialization entry Flagged by PyCharm.
Wed, 04 Sep 2024 17:08:58 +0200 profiling: document the py-spy value for `profiling.type`
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 04 Sep 2024 17:08:58 +0200] rev 51877
profiling: document the py-spy value for `profiling.type` The feature was not visible otherwise.
Thu, 19 Sep 2024 18:49:04 -0400 tests: enable pytype checking on `mercurial/unionrepo.py`
Matt Harbison <matt_harbison@yahoo.com> [Thu, 19 Sep 2024 18:49:04 -0400] rev 51876
tests: enable pytype checking on `mercurial/unionrepo.py`
Thu, 19 Sep 2024 18:48:07 -0400 unionrepo: fix mismatches with revlog classes
Matt Harbison <matt_harbison@yahoo.com> [Thu, 19 Sep 2024 18:48:07 -0400] rev 51875
unionrepo: fix mismatches with revlog classes This is a subset of cfd30df0f8e4, applied to `unionrepository`. There are none of the `write()` method overrides here, like `bundlerepository`. With these changes, pytype flags the `unionrevlog` constructor: File "/mnt/c/Users/Matt/hg/mercurial/unionrepo.py", line 55, in __init__: No attribute '_revlog' on mercurial.changelog.changelog [attribute-error] Called from (traceback): line 207, in __init__ File "/mnt/c/Users/Matt/hg/mercurial/unionrepo.py", line 55, in __init__: No attribute '_revlog' on mercurial.revlog.revlog [attribute-error] Called from (traceback): line 232, in __init__ But it turns out that both `changelog.changelog` and `revlog.revlog` do have a `target` attribute, so they wouldn't trip over this. It seems weird that the second caller to be flagged is passing the private `_revlog`, but maybe that's how it needs to be.
Thu, 19 Sep 2024 16:19:29 -0400 typing: make `unionrepository` subclass `localrepository` while type checking
Matt Harbison <matt_harbison@yahoo.com> [Thu, 19 Sep 2024 16:19:29 -0400] rev 51874
typing: make `unionrepository` subclass `localrepository` while type checking This is the same change as 9d4ad05bc91c made for `bundlerepository`, for the same reasons. Also, add a comment here to suppress the PyCharm warning that the superclass constructor is not called, that is new now that there's a simulated superclass. That lack of a call is by design- `makeunionrepository()` does magic that PyCharm isn't aware of. But PyCharm has been better at catching problems than pytype in a lot of cases, so I'd like to reduce the bogus things it flags, to make the real issues stand out.
Wed, 18 Sep 2024 21:00:20 -0400 tests: enable pytype checking on `mercurial/bundlerepo.py`
Matt Harbison <matt_harbison@yahoo.com> [Wed, 18 Sep 2024 21:00:20 -0400] rev 51873
tests: enable pytype checking on `mercurial/bundlerepo.py`
Wed, 18 Sep 2024 17:46:46 -0400 revlog: make `clearcaches()` signature consistent with ManifestRevlog
Matt Harbison <matt_harbison@yahoo.com> [Wed, 18 Sep 2024 17:46:46 -0400] rev 51872
revlog: make `clearcaches()` signature consistent with ManifestRevlog I'm not sure if this a newly added bug, because of using a different version of pytype, or if the recent work around avoiding the zope interface types in the type checking phase (see 5eb98ea78fd7 and friends)... but pytype 2023.11.21 started flagging this series since it was last pushed ~6 weeks ago: File "/mnt/c/Users/Matt/hg/mercurial/bundlerepo.py", line 204, in <module>: Overriding method signature mismatch [signature-mismatch] Base signature: 'def mercurial.manifest.ManifestRevlog.clearcaches(self, clear_persisted_data: Any = ...) -> None'. Subclass signature: 'def mercurial.revlog.revlog.clearcaches(self) -> None'. Not enough positional parameters in overriding method. Maybe the multiple inheritance in `bundlerepo.bundlemanifest` is bad, but it seems like a `ManifestRevlog` is-a `revlog`, even though the class hierarchy isn't coded that way. Additionally, it looks like `revlog.clearcaches()` is dealing with some persistent data, so maybe this is useful to have there anyway. Also sprinkle some trivial type hints on the method, because there are other `clearcaches()` definitions in the codebase with these hints, and I don't feel like waiting for another pytype run to see if it cares that specifically about the signature matching.
Sat, 03 Aug 2024 01:33:13 -0400 bundlerepo: fix mismatches with repository and revlog classes
Matt Harbison <matt_harbison@yahoo.com> [Sat, 03 Aug 2024 01:33:13 -0400] rev 51871
bundlerepo: fix mismatches with repository and revlog classes Both pytype and PyCharm complained that `write()` and `_write()` in the bundlephasecache class aren't proper overrides- indeed they seem to be missing an argument that the base class has. PyCharm and pytype also complained that the `revlog.revlog` class doesn't have a `_chunk()` method. That looks like it was moved from revlog to `_InnerRevlog` back in e8ad6d8de8b8, and wasn't caught because this module wasn't type checked. However, I couldn't figure out a syntax with `revlog.revlog._inner._chunk(self, rev)`, as it complained about passing too many args. `bundlerevlog._rawtext()` uses this `super(...)` style to call the super class, so hopefully that works, even with the wonky dynamic subclassing. The revlog class needed the `_InnerRevlog` field typed because it isn't set in the constructor. Finally, the vfs type hints look broken. This initially failed with: File "/mnt/c/Users/Matt/hg/mercurial/bundlerepo.py", line 65, in __init__: Function readonlyvfs.__init__ was called with the wrong arguments [wrong-arg-types] Expected: (self, vfs: mercurial.vfs.vfs) Actually passed: (self, vfs: Callable) Called from (traceback): line 232, in dirlog line 214, in __init__ I don't see a raw Callable, but I tried changing some of the vfs args to be typed as `vfsmod.abstractvfs`, but that class doesn't have `options`, so it failed elsewhere. `readonlyvfs` isn't a subclass of `vfs` (it's a subclass of `abstractvfs`), so I'm not sure how to handle that. It would be a shame to have to make a union of vfs subclasses (but not all of them have `options` either).
Wed, 18 Sep 2024 17:50:57 -0400 typing: make `bundlerepository` subclass `localrepository` while type checking
Matt Harbison <matt_harbison@yahoo.com> [Wed, 18 Sep 2024 17:50:57 -0400] rev 51870
typing: make `bundlerepository` subclass `localrepository` while type checking Currently, `mercurial/bundlerepo.py` is excluded from pytype, mostly because it complains that various `ui` and `vfs` fields in `localrepository` are missing. (`bundlerepository` dynamically subclasses `localrepository` when it is instantiated, so it works at runtime.) This makes that class hierarchy known to pytype. Having a protocol for `Repository` is probably the right thing to do, but that will be a lot of work and this still reflects the class at runtime. Subclassing also has the benefit of making sure any method overrides have a matching signature, so maybe this is a situation where we do both of these things. (I'm not sure how clear the diagnostics are if a class *almost* implements a protocol, but is missing a method argument or similar.) The subclassing is not done outside of type checking runs to avoid any side effects on already complex code.
Tue, 17 Sep 2024 16:40:24 +0200 rust: bump rust-cpython version to 0.7.2 stable
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 17 Sep 2024 16:40:24 +0200] rev 51869
rust: bump rust-cpython version to 0.7.2 This version supports Python 3.12 while 0.7.1 did not.
Wed, 19 Jun 2024 14:49:35 +0200 rust: add Vfs trait
Raphaël Gomès <rgomes@octobus.net> [Wed, 19 Jun 2024 14:49:35 +0200] rev 51868
rust: add Vfs trait This will allow for the use of multiple vfs like in the Python implementation, as well as hiding the details of the upcoming Python vfs wrapper to hg-core.
Wed, 19 Jun 2024 12:49:26 +0200 rust: use new revlog configs in all revlog opening code
Raphaël Gomès <rgomes@octobus.net> [Wed, 19 Jun 2024 12:49:26 +0200] rev 51867
rust: use new revlog configs in all revlog opening code This centralizes the more complex logic needed for the upcoming code and creates stronger APIs with fewer booleans. We also reuse `RevlogType` where needed.
Tue, 17 Sep 2024 10:18:32 +0200 rust-revlog: don't try to open the data file if the index is empty
Raphaël Gomès <rgomes@octobus.net> [Tue, 17 Sep 2024 10:18:32 +0200] rev 51866
rust-revlog: don't try to open the data file if the index is empty This will cover the case where the data file is not present.
Wed, 19 Jun 2024 12:25:12 +0200 rust-revlog: add revlog-specific config objects
Raphaël Gomès <rgomes@octobus.net> [Wed, 19 Jun 2024 12:25:12 +0200] rev 51865
rust-revlog: add revlog-specific config objects These will be used by the upcoming Rust `InnerRevlog` to better centralize config information that is relevant to revlogs.
Thu, 12 Sep 2024 16:27:58 -0400 typing: add `from __future__ import annotations` to remaining source files
Matt Harbison <matt_harbison@yahoo.com> [Thu, 12 Sep 2024 16:27:58 -0400] rev 51864
typing: add `from __future__ import annotations` to remaining source files Most of these look newer than when the original imports referenced in the previous commit were dropped, so these weren't covered by the backout. These were found with: hg files mercurial hgext hgext3rd -I '**.py' -X '**/thirdparty' \ | xargs grep -L 'from __future__ import annotations' All of the `__init__.py` files that finds are empty, so those were ignored and the rest manually edited.
Mon, 16 Sep 2024 15:36:44 +0200 typing: add `from __future__ import annotations` to most files
Matt Harbison <matt_harbison@yahoo.com> [Mon, 16 Sep 2024 15:36:44 +0200] rev 51863
typing: add `from __future__ import annotations` to most files Now that py36 is no longer supported, we can postpone annotation evaluation. This means that the quoting is usually optional (for things imported under the guard of `if typing.TYPE_CHECKING:` to avoid circular imports), and there's less overhead on startup[1]. There may be some missing here. I backed out 6000f5b25c9b (which removed the `from __future__ import ...` that was supporting py2), reverted the changes in `contrib/`, `doc/`, and `tests/`, and then ran: $ hg status -n --change . | \ xargs sed -i -e 's/from __future__ import .*$/from __future__ import annotations/' There were some minor tweaks needed when reviewing (mostly making the spacing around the import consistent, and `mercurial/testing/__init__.py` had a multiline import that wasn't fully rewritten. [1] https://docs.python.org/3/whatsnew/3.7.html#pep-563-postponed-evaluation-of-annotations
Mon, 16 Sep 2024 15:36:38 +0200 format: add many "missing" comma
Matt Harbison <matt_harbison@yahoo.com> [Mon, 16 Sep 2024 15:36:38 +0200] rev 51862
format: add many "missing" comma Black was not adding them until the next changeset introduced a bunch of `from __future__ import annotations` to most file. Since it make the next changeset hard to read we introduce them in advance.
Thu, 12 Sep 2024 12:53:00 -0400 typing: simplify archive.gz writing and drop a few pytype suppressions
Matt Harbison <matt_harbison@yahoo.com> [Thu, 12 Sep 2024 12:53:00 -0400] rev 51861
typing: simplify archive.gz writing and drop a few pytype suppressions I was waiting until 3.8 to use `Literal` to fix this, but there's also the ":" and "|" characters that are passed along here, meant only for the non-gz archive types. But manipulating what the local caller passes is silly- we know we're writing, so just open it for writing. As an added bonus, PyCharm stops flagging the call too (since it doesn't know about pytype suppression comments).
Thu, 12 Sep 2024 12:38:43 -0400 typing: explicitly set the return type of `_InnerRevLog.raw_text()`
Matt Harbison <matt_harbison@yahoo.com> [Thu, 12 Sep 2024 12:38:43 -0400] rev 51860
typing: explicitly set the return type of `_InnerRevLog.raw_text()` Somewhere between cd72a88c5599 and 2fd44b3dcc33, pytype changed the return type from `Tuple[_T1, Any, bool]` to `Any`. Both are wrong. `mdiff.patches()` is an alias for `mpatch.patches()`, which is selected via module policy (and breaks the ability to infer the types). However, `cext`, `cffi`, and `pure` implementations all agree it returns bytes.
Thu, 12 Sep 2024 12:28:27 -0400 typing: add explicit hints for recent pytype regressions
Matt Harbison <matt_harbison@yahoo.com> [Thu, 12 Sep 2024 12:28:27 -0400] rev 51859
typing: add explicit hints for recent pytype regressions Somewhere between 454feddab720 and cd72a88c5599, pytype changed how it inferred the return type in `extdiff.py` from Tuple[Any, List[Tuple[bytes, Any, os.stat_result]]] to Tuple[Any, List[nothing]] It also changed the return type in `archival.py` from `Any` to `NoReturn`. Fix those up, and also the obvious parameter types while we're here.
Wed, 19 Jun 2024 18:06:50 +0200 revlog: use the method to check if the revlog is being written to
Raphaël Gomès <rgomes@octobus.net> [Wed, 19 Jun 2024 18:06:50 +0200] rev 51858
revlog: use the method to check if the revlog is being written to This was probably fine, but it could become not fine at some point.
Wed, 19 Jun 2024 17:26:06 +0200 revlog: add an early return for getting sidedata
Raphaël Gomès <rgomes@octobus.net> [Wed, 19 Jun 2024 17:26:06 +0200] rev 51857
revlog: add an early return for getting sidedata No point in trying to fetch sidedata if there isn't a sidedata file.
Wed, 19 Jun 2024 17:19:20 +0200 revlog: simplify rawtext return value
Raphaël Gomès <rgomes@octobus.net> [Wed, 19 Jun 2024 17:19:20 +0200] rev 51856
revlog: simplify rawtext return value We're always returning a tuple even though only the raw text is being used, and we're rebuilding another tuple again higher. As a bonus, this will remove one tuple creation and deletion per `raw_text` call, hence fewer gc calls, etc.
Wed, 19 Jun 2024 17:06:05 +0200 revlog: cleanup some outdated docstrings
Raphaël Gomès <rgomes@octobus.net> [Wed, 19 Jun 2024 17:06:05 +0200] rev 51855
revlog: cleanup some outdated docstrings
Thu, 12 Sep 2024 10:09:06 +0200 rust-inner-revlog: always inline `get_entry`
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 12 Sep 2024 10:09:06 +0200] rev 51854
rust-inner-revlog: always inline `get_entry` This is a very hot function.
Thu, 12 Sep 2024 10:08:45 +0200 rust-inner-revlog: derive Debug for IndexHeaderFlags
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 12 Sep 2024 10:08:45 +0200] rev 51853
rust-inner-revlog: derive Debug for IndexHeaderFlags
Thu, 12 Sep 2024 10:08:28 +0200 rust-inner-revlog: drop some outdated comment
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 12 Sep 2024 10:08:28 +0200] rev 51852
rust-inner-revlog: drop some outdated comment
Wed, 19 Jun 2024 12:00:55 +0200 rust-config: add more ways of reading the config
Raphaël Gomès <rgomes@octobus.net> [Wed, 19 Jun 2024 12:00:55 +0200] rev 51851
rust-config: add more ways of reading the config These will be needed for future patches of this series to interpret more complex/different config values.
Tue, 26 Mar 2024 15:51:31 +0000 util: make buffer readonly
Raphaël Gomès <rgomes@octobus.net> [Tue, 26 Mar 2024 15:51:31 +0000] rev 51850
util: make buffer readonly There is no use of writable buffers anywhere in the code, and this helps us make sure we don't get into unsound territory when sharing memory with Rust. This `toreadonly` method was not available in Python 3.6, but we dropped the support for it earlier that week, so no need for any compatibility code.
Thu, 05 Sep 2024 17:12:52 -0400 setup: avoid the deprecated `distutils.spawn.find_executable`
Matt Harbison <mharbison@atto.com> [Thu, 05 Sep 2024 17:12:52 -0400] rev 51849
setup: avoid the deprecated `distutils.spawn.find_executable` I noticed this was flagged with `DeprecationWarning` in py3.12 with `setuptools` 74.1.2, and it suggested `shutil.which()` instead. The signatures aren't the same, but the additional `mode` argument in the middle of the latter defaults to `os.F_OK | os.X_OK`, which maintains the same semantics.
Thu, 05 Sep 2024 16:59:36 -0400 setup: drop the hack to disable linker warning 4197 on Windows
Matt Harbison <mharbison@atto.com> [Thu, 05 Sep 2024 16:59:36 -0400] rev 51848
setup: drop the hack to disable linker warning 4197 on Windows I don't see this when building on Windows with py3.8 or py3.12, so either the code was fixed, or (more likely) the compiler stopped warning about it some time after VS 2008. If we do have to put this back, it would probably be better to put a `#pragma` in a header file somewhere, and avoid `setuptools` technical debt.
Wed, 11 Sep 2024 00:20:07 +0200 ci: also offer to test 3.12 with rust
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 11 Sep 2024 00:20:07 +0200] rev 51847
ci: also offer to test 3.12 with rust The rust-cpython binding got 3.12 support very recently, it is worse keeping on a tighter watch.
Wed, 28 Aug 2024 16:35:43 +0200 ci: add the option to test more Python versions
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 28 Aug 2024 16:35:43 +0200] rev 51846
ci: add the option to test more Python versions It seems like a good idea to be able to test the lowest version we support. And there have been enougth issue with 3.12 that we need to be able to make sur we do not break it. We should probably get a matrix setup for more version and flavor, but that is a simple and efficient start.
Thu, 05 Sep 2024 12:37:59 +0200 censor: document the censor.policy option (issue6909)
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 05 Sep 2024 12:37:59 +0200] rev 51845
censor: document the censor.policy option (issue6909) Censor is not marked as experimental and should be documented I am not doing this on stable because the help markup change it is using seems more suitable for default.
Thu, 05 Sep 2024 12:28:12 +0200 help: add :config-doc:`section.key` shorthand to insert documentation
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 05 Sep 2024 12:28:12 +0200] rev 51844
help: add :config-doc:`section.key` shorthand to insert documentation The config items defined in the configitems.toml file can already hold their documentation. Having some way to automatically insert it was a long standing low hanging fruit. So I did a first implementation on that. It fairly simple, but it open the door to more. It will be used in the next changeset.
Wed, 11 Sep 2024 20:52:51 +0200 bzr: attempt to stabilize the test
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 11 Sep 2024 20:52:51 +0200] rev 51843
bzr: attempt to stabilize the test The test has flakyness where the order of a few commit swap. This is an attempt at avoiding that.
Thu, 12 Sep 2024 02:24:20 +0200 branching: merge with stable
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 12 Sep 2024 02:24:20 +0200] rev 51842
branching: merge with stable
Wed, 11 Sep 2024 12:03:39 +0200 profiling: use "stat" profiler to profile individual request stable
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 11 Sep 2024 12:03:39 +0200] rev 51841
profiling: use "stat" profiler to profile individual request The ls profiler no longer works for that. As the lsprof profiler is not default and not great is general, lets side step the issue for now.
Wed, 11 Sep 2024 12:02:38 +0200 profiling: improve 3.12 error message for calling lsprof twice stable
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 11 Sep 2024 12:02:38 +0200] rev 51840
profiling: improve 3.12 error message for calling lsprof twice Python 3.12 prevent lsprof to be enabled if it is already enabled. This break the use of lsprof in `hg serve` as both the initial `serve` command and the request serving want to profile. The "stat" profiler (the default) does not have this problem, so we focus on improving the error message for now.
Wed, 11 Sep 2024 00:41:37 +0200 test: display server error log in test-profile.t stable
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 11 Sep 2024 00:41:37 +0200] rev 51839
test: display server error log in test-profile.t This will help us to catch error with Python 3.12
Wed, 15 Nov 2023 22:11:34 +0100 archive: defer opening the output until a file is matched
Joerg Sonnenberger <joerg@bec.de> [Wed, 15 Nov 2023 22:11:34 +0100] rev 51838
archive: defer opening the output until a file is matched Before, if no file is matched, an error is thrown, but the archive is created anyway. When using hgweb, an error 500 is returned as the response body already exists when the error is seen. Afterwards, the archive is created before the first match is emitted. If no match is found, no archive is created. This is more consistent behavior as an empty archive is not a representable in all output formats, e.g. tar archives.
Thu, 05 Sep 2024 13:37:24 +0200 run-tests: add color to the progress output
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 05 Sep 2024 13:37:24 +0200] rev 51837
run-tests: add color to the progress output More color is useful to me.
Tue, 10 Sep 2024 22:26:23 +0200 python-compat: drop support for Python3.6 and 3.7
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 10 Sep 2024 22:26:23 +0200] rev 51836
python-compat: drop support for Python3.6 and 3.7 As discussed on the mailing list¹, these are old version that seems safe to drop. Python 3.8 comes with various improvement especially regarding typing capabilities. [1] https://lists.mercurial-scm.org/pipermail/mercurial-devel/2024-July/297998.html
Tue, 10 Sep 2024 21:19:36 +0200 ci: drop path manipulation that we do not need anymore
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 10 Sep 2024 21:19:36 +0200] rev 51835
ci: drop path manipulation that we do not need anymore The CI image has a squarer setup now.
Fri, 06 Sep 2024 02:12:19 +0200 brancing: merge stable into default
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 06 Sep 2024 02:12:19 +0200] rev 51834
brancing: merge stable into default
Thu, 05 Sep 2024 15:37:14 -0400 setup: handle removal of old MSVC compiler from setuptools 65.0 (issue6910) stable
Matt Harbison <mharbison@atto.com> [Thu, 05 Sep 2024 15:37:14 -0400] rev 51833
setup: handle removal of old MSVC compiler from setuptools 65.0 (issue6910) It was removed a few years ago[1]. When trying to reproduce locally using a clean py3.12 as called out in the bug report, `setuptools` wasn't installed at all, and needed a `pip install` to fix a `ModuleNotFoundError` when building locally. Maybe that needs to be in the requirements clause now. It looks like this "private" module was added in setuptools 48.0.[2] I can't find a changelog of what version was included in which version of python, and the changelog for pip has a huge gap between when it called out 67.6.1 in `pip` 23.1 (2023-04-15), and 41.4.0 in `pip` 19.3 (2019-10-14).[3] So, we'll just add to the existing code instead of replacing it, for safety. [1] https://github.com/pypa/setuptools/commit/cc017c77948737d131f683e0c25cd37bc639b8fc [2] https://github.com/pypa/setuptools/commit/d034a5ec7f707499139f90eb846b9e720923124c [3] https://pip.pypa.io/en/stable/news/
Wed, 28 Aug 2024 23:25:26 +0200 utils: accept bytearray arguments for escapestr
Joerg Sonnenberger <joerg@bec.de> [Wed, 28 Aug 2024 23:25:26 +0200] rev 51832
utils: accept bytearray arguments for escapestr
Sun, 30 Jun 2024 16:02:50 +0200 http: simplify
Joerg Sonnenberger <joerg@bec.de> [Sun, 30 Jun 2024 16:02:50 +0200] rev 51831
http: simplify
Sun, 30 Jun 2024 14:16:43 +0200 http: use urllib's cookie handler
Joerg Sonnenberger <joerg@bec.de> [Sun, 30 Jun 2024 14:16:43 +0200] rev 51830
http: use urllib's cookie handler Split the logic for loading the cookies based on the configuration in a helper function and otherwise use the library implementation directly.
Sun, 30 Jun 2024 13:22:23 +0200 http: reuse Python's implementation of read/readline/readinto
Joerg Sonnenberger <joerg@bec.de> [Sun, 30 Jun 2024 13:22:23 +0200] rev 51829
http: reuse Python's implementation of read/readline/readinto Since Python 3 already provides a working implementation of readline, there is no need for our own buffering implementation. Reduce the code to transfer accounting only.
Sun, 30 Jun 2024 02:46:53 +0200 debugwireproto: redo logging to also work for https
Joerg Sonnenberger <joerg@bec.de> [Sun, 30 Jun 2024 02:46:53 +0200] rev 51828
debugwireproto: redo logging to also work for https
Fri, 28 Jun 2024 16:26:06 +0200 urllib2: redo response.readlines addition via class patching
Joerg Sonnenberger <joerg@bec.de> [Fri, 28 Jun 2024 16:26:06 +0200] rev 51827
urllib2: redo response.readlines addition via class patching
Wed, 21 Aug 2024 22:15:05 -0400 typing: lock in new pytype gains from making revlog related classes typeable
Matt Harbison <matt_harbison@yahoo.com> [Wed, 21 Aug 2024 22:15:05 -0400] rev 51826
typing: lock in new pytype gains from making revlog related classes typeable These were pretty clean changes in the pyi files from earlier in this series, so add them to the code to make it more understandable. There's one more trivial hint that can be added to the return of `mercurial.revlogutils.rewrite._filelog_from_filename()`, however it needs to be imported from '..' under the conditional of `typing.TYPE_CHECKING`, and that seems to confuse the import checker- possibly because there's already an import block from that level. (I would have expected a message about multiple import statements in this case, but got one about higher level imports should come first, no matter where I put the import statement.)
Tue, 20 Aug 2024 00:07:05 -0400 typing: add types to `revlog.revlogproblem`
Matt Harbison <matt_harbison@yahoo.com> [Tue, 20 Aug 2024 00:07:05 -0400] rev 51825
typing: add types to `revlog.revlogproblem` These attrs showed as `Any` after the previous commit made the class visible to pytype.
Mon, 19 Aug 2024 22:46:09 -0400 typing: make the revlog classes known to pytype
Matt Harbison <matt_harbison@yahoo.com> [Mon, 19 Aug 2024 22:46:09 -0400] rev 51824
typing: make the revlog classes known to pytype These are the same changes as c1d7ac70980b and 45270e286bdc made to dirstate, for the same reasons.
Mon, 19 Aug 2024 22:27:43 -0400 typing: make the manifest classes known to pytype
Matt Harbison <matt_harbison@yahoo.com> [Mon, 19 Aug 2024 22:27:43 -0400] rev 51823
typing: make the manifest classes known to pytype These are the same changes as c1d7ac70980b and 45270e286bdc made to dirstate, for the same reasons. The migration away from decorating the classes with `@interfaceutil.implementer` was started back in 3e9a660b074a, but missed one.
Mon, 19 Aug 2024 22:21:16 -0400 typing: make the filelog class known to pytype
Matt Harbison <matt_harbison@yahoo.com> [Mon, 19 Aug 2024 22:21:16 -0400] rev 51822
typing: make the filelog class known to pytype These are the same changes as c1d7ac70980b and 45270e286bdc made to dirstate, for the same reasons.
Wed, 21 Aug 2024 17:41:57 -0400 remotefilelog: adapt the `debugindex` command to past API changes
Matt Harbison <matt_harbison@yahoo.com> [Wed, 21 Aug 2024 17:41:57 -0400] rev 51821
remotefilelog: adapt the `debugindex` command to past API changes Pytype was missing these problems because it's currently inferring the classes for `filelog` and `revlog` to be `Any`. When that's fixed, these were flagged, so fix these first. The `filelog` class used to subclass `revlog`, but that was changed back in 1541e1a8e87d (with most or all of the "lost" attributes being forwarded to the embedded `revlog` attribute at that time). These forwarded references were dropped over time, and this command has been broken at least as far back as 68282a7b29a7 when the `version` field was dropped. Most of the fixes were as simple as calling the accessor for the embedded `revlog` member, but the general delta feature detection was a bit more involved- I copied the detection for it from `mercurial.revlogutils.debug.debug_revlog()`.
Wed, 21 Aug 2024 16:13:14 -0400 typing: add type hints to the `opener` attributes and arguments of revlog
Matt Harbison <matt_harbison@yahoo.com> [Wed, 21 Aug 2024 16:13:14 -0400] rev 51820
typing: add type hints to the `opener` attributes and arguments of revlog When making revlog and filelog classes visible to pytype, it got confused quite a bit in `mercurial/revlogutils/rewrite.py`, thinking it had a plain `Callable`, and flagging additional methods on it like `join()` and `rename()`. I couldn't figure out how it reduced to that (and PyCharm flagged `opener` references as `Any`), but this makes it happy. So make this change before making the classes visible. The vfs class hierarchy is a bit wonky (e.g. `filteredvfs` is not a `vfs`), so this may need to be revisited with a Protocol class that covers all of the `vfs` classes. But for now, everything works.
Wed, 21 Aug 2024 16:09:22 -0400 remotefilelog: honor the `--format` arg of the `debugindex` command
Matt Harbison <matt_harbison@yahoo.com> [Wed, 21 Aug 2024 16:09:22 -0400] rev 51819
remotefilelog: honor the `--format` arg of the `debugindex` command Flagged by PyCharm while investigating pytype spew. The other `**opts` above are already accessed as str. I've never used remotefilelog, and don't have a repo to test this on, so I'm trusting the nearby code.
Wed, 07 Aug 2024 22:05:36 +0200 merge: sort filemap only if requested by the caller stable
Manuel Jacob <me@manueljacob.de> [Wed, 07 Aug 2024 22:05:36 +0200] rev 51818
merge: sort filemap only if requested by the caller The name `sorted` refers to a built-in function, which is always true, so the else branch of this if statement was dead code. Because, with this fix, the function can iterate over the dict items while yielding values, the dict should not change size while the generator is running. Because of that, it is required to re-introduce code that makes a caller copy the filemap before modification, which was removed in 3c783ff08d40cbaf36eb27ffe1d296718c0f1d77 (that changeset also introduced the filemap() method including the bug that’s being fixed by this changeset).
Tue, 20 Aug 2024 22:47:11 -0400 shelve: consistently convert exception to bytes via `stringutil.forcebytestr`
Matt Harbison <matt_harbison@yahoo.com> [Tue, 20 Aug 2024 22:47:11 -0400] rev 51817
shelve: consistently convert exception to bytes via `stringutil.forcebytestr` The other two places in this module use this, and past experience shows that this method does a nicer job. I'm not sure why we're converting to bytes here- `KeyError` is built-in and will have str attrs, and `RepoLookupError` is a subclass of the built-in `Exception` class (not `errors.Error`, which is allegedly the baseclass for all Mercurial exceptions).
Tue, 20 Aug 2024 22:34:51 -0400 typing: add type hints to `mercurial.shelve`
Matt Harbison <matt_harbison@yahoo.com> [Tue, 20 Aug 2024 22:34:51 -0400] rev 51816
typing: add type hints to `mercurial.shelve` Pytype wasn't flagging anything here yet, but PyCharm was really unhappy about the usage of `state` objects being passed to various methods that accessed attrs on it, without any obvious attrs on the class because there's no contructor. Filling that out made PyCharm happy, and a few other things needed to be filled in to make that easier, so I made a pass over the whole file and filled in the trivial hints. The other repo, ui, context, matcher, and pats items can be filled in after the context and match modules are typed.
Tue, 20 Aug 2024 18:30:47 -0400 typing: lock in correct changes from pytype 2023.04.11 -> 2023.06.16
Matt Harbison <matt_harbison@yahoo.com> [Tue, 20 Aug 2024 18:30:47 -0400] rev 51815
typing: lock in correct changes from pytype 2023.04.11 -> 2023.06.16 There were a handful of other changes to the pyi files generated when updating pytype locally (and jumping from python 3.8.0 to python 3.10.11), but they were not as clear (e.g. the embedded type in a list changing from `nothing` to `Any` or similar). These looked obviously correct, and agreed with PyCharm's thoughts on the signatures. Oddly, even though pytype starting inferring `obsutil._getfilteredreason()` as returning bytes, it (correctly) complained about the None path when it was typed that way. Instead, raise a ProgrammingError if an unhandled fate is calculated. (Currently, all possibilities are handled, so this isn't reachable unless another fate is added in the future.)
Tue, 20 Aug 2024 17:46:17 -0400 monotone: replace %s interpolation with appropriate numeric specifiers
Matt Harbison <matt_harbison@yahoo.com> [Tue, 20 Aug 2024 17:46:17 -0400] rev 51814
monotone: replace %s interpolation with appropriate numeric specifiers The length is an int, and the version is a float. Neither work with bytes on py3. This was noticed when looking at nearby code after updating pytype changed some signatures.
Tue, 20 Aug 2024 16:32:13 -0400 shelve: raise an error when loading a corrupt state file in an impossible case
Matt Harbison <matt_harbison@yahoo.com> [Tue, 20 Aug 2024 16:32:13 -0400] rev 51813
shelve: raise an error when loading a corrupt state file in an impossible case The old return statement was flagged by pytype 2023.06.16 running under python 3.10.11. No idea why it isn't caught in CI running the same pytype with py3.7. This function is only called by `unshelvecmd()` (which first checks that either `--abort` or `--continue` is specified), and `hgabortunshelve()` and `hgcontinueunshelve()`, which locally apply `--abort` or `--continue` respectively. Therefore, there is no other way to call this, and this error should never be seen, but pytype can't figure that out on its own. Given that the abort case clears the state, it seems reasonable to defensively code this and not make that a blanket `else` case, on the off chance a 3rd way of calling this appears in the future.
Tue, 20 Aug 2024 11:18:10 -0400 contrib: print the version of pytype used to do the type checking
Matt Harbison <matt_harbison@yahoo.com> [Tue, 20 Aug 2024 11:18:10 -0400] rev 51812
contrib: print the version of pytype used to do the type checking This will help with CI. I don't see a way to print the version of python that's running it. When I tried `head -n 1 $(which pytype)`, the CI run printed: #!/usr/bin/env bash Locally, that gives the path to the python interpreter in the venv, so IDK what's different.
Sat, 17 Aug 2024 18:43:23 -0400 typing: create an @overload of `phasecache` ctor to handle the copy case
Matt Harbison <matt_harbison@yahoo.com> [Sat, 17 Aug 2024 18:43:23 -0400] rev 51811
typing: create an @overload of `phasecache` ctor to handle the copy case In `phasecache.copy()`, it calls `self.__class__(None, None, _load=False)`, but the constuctor is typed to take a non-None repository. For the `_load=False` case, all args are ignored (and the copy function itself populates the attrs on the new object), so this isn't an error. For the default `_load=True` case, it needs a non-None repository. This is the simplest way to handle that duality. The reason this wasn't being detected is because pytype is confused by the interface decorators on the `localrepository` class, and is inferring the whole class as `Any`. (See 3e9a660b074a or c1d7ac70980b) Therefore, the type hint of `localrepo.localrepository` here was also effectively `Any`, which disabled the type checking entirely. This is the first foray into using `typing_extensions` to unlock future typing features. I think this is safe and reasonable because 1) it is only imported in the type checking phase (so no need to vendor our own copy), and 2) pytype has its own copy of `typing_extensions` bundled with it, so no need to alter the test environment. When run with a version of python that supports the symbol(s) natively, `typing_extensions` simply re-exports from `typing`, so there shouldn't be any future headaches with this.
Sat, 17 Aug 2024 17:38:35 -0400 typing: declare the `_phasesets` member of `phasecache` to be `Optional`
Matt Harbison <matt_harbison@yahoo.com> [Sat, 17 Aug 2024 17:38:35 -0400] rev 51810
typing: declare the `_phasesets` member of `phasecache` to be `Optional` Something in this area got flagged while making the repository class visible to pytype (instead of being typed as `Any`). A None assignment to something not optional is wrong, and when I tried setting it to `{}` to keep it non-Optional, some tests failed. There are checks for the attr being None elsewhere, so this seems to have just been an oversight.
Fri, 16 Aug 2024 18:11:52 -0400 typing: hide the interface version of `dirstate` during type checking
Matt Harbison <matt_harbison@yahoo.com> [Fri, 16 Aug 2024 18:11:52 -0400] rev 51809
typing: hide the interface version of `dirstate` during type checking As noted in the previous commit, the `dirstate` type is still inferred as `Any` by pytype, including where it is used as a base class for the largefiles dirstate. That effectively disables most type checking. The problems fixed two commits ago were flagged by this change. I'm not at all clear what the benefit of the original type is, but that was what was used at runtime, so I don't want to change the largefiles base class to the raw class. Having both a lowercase and camelcase name for the same thing isn't great, but given that this trivially finds problems without worrying about which symbol clients may be using, and the non-raw type is useless to pytype anyway, I'm not going to worry about it.
Fri, 16 Aug 2024 18:02:32 -0400 dirstate: remove the interface decorator to help pytype
Matt Harbison <matt_harbison@yahoo.com> [Fri, 16 Aug 2024 18:02:32 -0400] rev 51808
dirstate: remove the interface decorator to help pytype This is the same change that was made for some of the manifest classes in 3e9a660b074a. Note that `dirstate` is still inferred as `Any`, but at least we have `DirState` with all of the expected attributes.
Fri, 16 Aug 2024 17:58:17 -0400 largefiles: sync up `largefilesdirstate` methods with `dirstate` base class
Matt Harbison <matt_harbison@yahoo.com> [Fri, 16 Aug 2024 17:58:17 -0400] rev 51807
largefiles: sync up `largefilesdirstate` methods with `dirstate` base class As it currently stands, pytype infers the `dirstate` class (and anything else decorated with `@interfaceutil.implementer`) as `Any`. When that is worked around, it suddenly noticed that most of these methods don't exist in the `dirstate` class anymore. Since they only called into the missing methods and there's no test failures, we can assume these are never called, and they can be dropped. In addition, PyCharm flagged `set_tracked()` and `_ignore()` as not overriding a superclass method with the same arguments. The missing default parameter for the former was the obvious issue. I'm guessing that the latter was named wrong because while there is `_ignore()` in the base class, it takes no arguments and returns a matcher. The `_ignorefiles()` superclass method also takes no args, and returns a list of bytes. The `_ignorefileandline()` superclass method DOES take a file, but returns a tuple. Therefore, the closest match is `_dirignore()`, which takes a file AND returns a bool. No idea why this needs to be overridden though.
Fri, 16 Aug 2024 11:12:19 +0100 sparse: reliably avoid writing to store without a lock
Arseniy Alekseyev <aalekseyev@janestreet.com> [Fri, 16 Aug 2024 11:12:19 +0100] rev 51806
sparse: reliably avoid writing to store without a lock With the code as written before this patch we can still end up writing to store in `debugsparse`. Obviously we'll write to it if by accident a store requirement is modified, but more importantly we write to it if another concurrent transaction modifies the requirements file on disk. We can't rule this out since we're not holding the store lock, so it's better to explicitly pass a permission to write instead of inferring it based on file contents.
Thu, 15 Aug 2024 13:52:14 +0100 debugsparse: stop taking the store lock
Arseniy Alekseyev <aalekseyev@janestreet.com> [Thu, 15 Aug 2024 13:52:14 +0100] rev 51805
debugsparse: stop taking the store lock debugsparse is a workspace-only opperation, or it better be workspace-only. Let's make it to stop taking the store lock.
Thu, 15 Aug 2024 14:54:22 +0100 scmutils: read the requires file before writing to avoid unnecessary rewrite
Arseniy Alekseyev <aalekseyev@janestreet.com> [Thu, 15 Aug 2024 14:54:22 +0100] rev 51804
scmutils: read the requires file before writing to avoid unnecessary rewrite This lets us get away without the repo lock in situations where we need to write requirements, but we know we're not changing the store requirements.
Thu, 15 Aug 2024 14:56:50 +0100 localrepo: remove _readrequires function in favor of scmutil.readrequires
Arseniy Alekseyev <aalekseyev@janestreet.com> [Thu, 15 Aug 2024 14:56:50 +0100] rev 51803
localrepo: remove _readrequires function in favor of scmutil.readrequires
Thu, 15 Aug 2024 14:53:17 +0100 scmutil: add `readrequires` next to `writerequires`
Arseniy Alekseyev <aalekseyev@janestreet.com> [Thu, 15 Aug 2024 14:53:17 +0100] rev 51802
scmutil: add `readrequires` next to `writerequires` The code is copied from localrepo.py.
Wed, 14 Aug 2024 03:25:16 -0400 typing: correct a type hint in `mercurial.manifest`
Matt Harbison <matt_harbison@yahoo.com> [Wed, 14 Aug 2024 03:25:16 -0400] rev 51801
typing: correct a type hint in `mercurial.manifest` Obvious typo that was flagged by PyCharm.
Sat, 10 Aug 2024 14:22:26 -0400 typing: add hints to `mercurial.util.mktempcopy()`
Matt Harbison <matt_harbison@yahoo.com> [Sat, 10 Aug 2024 14:22:26 -0400] rev 51800
typing: add hints to `mercurial.util.mktempcopy()` Might as well, now that the previous commit indicated what types are required.
Sat, 10 Aug 2024 14:18:44 -0400 typing: fix the hint for the `mode` argument of `platform.copymode()`
Matt Harbison <matt_harbison@yahoo.com> [Sat, 10 Aug 2024 14:18:44 -0400] rev 51799
typing: fix the hint for the `mode` argument of `platform.copymode()` The posix module is doing a bitwise AND with this and an integer, so it can't be bytes. The only caller that provides the argument is `util.mktempcopy()`, and pytype infers the type as Any, which explains why this wasn't caught.
Fri, 09 Aug 2024 22:45:32 +0200 largefiles: fix check that ensures that --all-largefiles is only used locally stable
Manuel Jacob <me@manueljacob.de> [Fri, 09 Aug 2024 22:45:32 +0200] rev 51798
largefiles: fix check that ensures that --all-largefiles is only used locally Previously, the command added in the test failed with “abort: --all-largefiles is incompatible with non-local destination existing_destination”. The reason for the buggy behavior was the use of hg.islocal(), which does “return true if repo (or path pointing to repo) is local” and, for local paths, assumes that the path is actually pointing to an existing repository and returns whether the path is not a regular file (in which case it assumes that it is a bundlerepo, which are considered non-local).
Fri, 05 May 2023 06:08:36 -0600 exchange: trivial simplification
Felipe Contreras <felipe.contreras@gmail.com> [Fri, 05 May 2023 06:08:36 -0600] rev 51797
exchange: trivial simplification Both sides of the condition do essentially the same thing, except one with fastpath=True. No functional changes.
Fri, 09 Aug 2024 14:26:13 +0200 import: fix erroneous comparison of str with bytes stable
Manuel Jacob <me@manueljacob.de> [Fri, 09 Aug 2024 14:26:13 +0200] rev 51796
import: fix erroneous comparison of str with bytes
Thu, 08 Aug 2024 17:28:38 +0400 histedit: create state and acquire locks earlier stable
Anton Shestakov <av6@dwimlabs.net> [Thu, 08 Aug 2024 17:28:38 +0400] rev 51795
histedit: create state and acquire locks earlier This makes chistedit (histedit with curses UI) not write any files inside repo without wlock. It also makes sense to wrap the entire process of preparing commands inside the curses UI inside locks because we don't want anything else to touch wdir or repo during this time.
Tue, 06 Aug 2024 22:51:41 +0200 py3: use str literal instead of bytes literal stable
Manuel Jacob <me@manueljacob.de> [Tue, 06 Aug 2024 22:51:41 +0200] rev 51794
py3: use str literal instead of bytes literal
Tue, 06 Aug 2024 18:23:59 +0200 typing: fix type annotation stable
Manuel Jacob <me@manueljacob.de> [Tue, 06 Aug 2024 18:23:59 +0200] rev 51793
typing: fix type annotation
Tue, 06 Aug 2024 17:53:59 +0200 cffi: pass bytes instead of str to ffi.new("char[]", …) stable
Manuel Jacob <me@manueljacob.de> [Tue, 06 Aug 2024 17:53:59 +0200] rev 51792
cffi: pass bytes instead of str to ffi.new("char[]", …) The type annotations seem to imply that the passed values are always already bytes, but they aren’t necessarily. Before Python 3.11, the documentation stated that bytes can be used to annotate arguments whose type is actually any of bytes, bytearray, or memoryview.
Mon, 05 Aug 2024 21:21:32 +0200 cffi: call bytes() instead of str() on CFFI buffer instances stable
Manuel Jacob <me@manueljacob.de> [Mon, 05 Aug 2024 21:21:32 +0200] rev 51791
cffi: call bytes() instead of str() on CFFI buffer instances
Mon, 05 Aug 2024 21:08:36 +0200 cffi: pass C type and attribute names as str instead of bytes stable
Manuel Jacob <me@manueljacob.de> [Mon, 05 Aug 2024 21:08:36 +0200] rev 51790
cffi: pass C type and attribute names as str instead of bytes
Mon, 05 Aug 2024 20:47:17 +0200 py3: fix type of some elements of __all__ lists stable
Manuel Jacob <me@manueljacob.de> [Mon, 05 Aug 2024 20:47:17 +0200] rev 51789
py3: fix type of some elements of __all__ lists
Mon, 05 Aug 2024 20:08:23 +0200 manifest: deprecated readdelta and readfast
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 05 Aug 2024 20:08:23 +0200] rev 51788
manifest: deprecated readdelta and readfast These method should not have any user left.
Tue, 06 Aug 2024 02:09:33 +0200 manifest: use read_delta_new_entries in verify too
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 06 Aug 2024 02:09:33 +0200] rev 51787
manifest: use read_delta_new_entries in verify too This seems like the proper semantic for the usage.
Tue, 06 Aug 2024 02:13:17 +0200 manifest: use read_delta_new_entries in changegroup validate
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 06 Aug 2024 02:13:17 +0200] rev 51786
manifest: use read_delta_new_entries in changegroup validate This new method have a well defined semantic and can be adjusted by narrow as it needs. This should prevent some unwanted filelog access when running validate on a server using narrow profile to restrict access.
Tue, 06 Aug 2024 02:12:08 +0200 manifest: add a read_delta_new_entries method
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 06 Aug 2024 02:12:08 +0200] rev 51785
manifest: add a read_delta_new_entries method This new method have a well defined semantic and can be adjusted by narrow as it needs.
Thu, 01 Aug 2024 13:15:54 +0200 manifest: use `read_delta_parents` when adjusting linkrev
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 01 Aug 2024 13:15:54 +0200] rev 51784
manifest: use `read_delta_parents` when adjusting linkrev Let's use the more accurate API.
Thu, 01 Aug 2024 13:15:10 +0200 manifest: use the `read_delta_parents` method
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 01 Aug 2024 13:15:10 +0200] rev 51783
manifest: use the `read_delta_parents` method Let's use the more accurate API.
Thu, 01 Aug 2024 13:12:49 +0200 manifest: use `read_delta_parents` when adjusting linkrev in remotefile
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 01 Aug 2024 13:12:49 +0200] rev 51782
manifest: use `read_delta_parents` when adjusting linkrev in remotefile Let's use the more accurate API.
Thu, 01 Aug 2024 13:10:09 +0200 manifest: introduce a `read_delta_parents` method
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 01 Aug 2024 13:10:09 +0200] rev 51781
manifest: introduce a `read_delta_parents` method This new method have a clearer semantic and can be used by code that need this semantic. This should avoid bugs, allow for more targeted optimisation, and provide a clearer API. Users will be updated in subsequent changesets. This is also part of the wider effort to clarify and fix this API. one more method coming.
Thu, 01 Aug 2024 12:14:40 +0200 manifest: use `read_any_fast_delta` for tag rev cache computation
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 01 Aug 2024 12:14:40 +0200] rev 51780
manifest: use `read_any_fast_delta` for tag rev cache computation This will have the benefit of using the fast path more often, and being (a bit) less buggy. See inline comment for details.
Thu, 01 Aug 2024 05:37:57 +0200 manifest: use `read_any_fast_delta` during shallow prefetch's
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 01 Aug 2024 05:37:57 +0200] rev 51779
manifest: use `read_any_fast_delta` during shallow prefetch's We now have a better function with a clear semantic. This simplify the usage in the remotefilelog code.
Thu, 01 Aug 2024 05:36:53 +0200 manifest: use `read_any_fast_delta` during remotefilelog's repack
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 01 Aug 2024 05:36:53 +0200] rev 51778
manifest: use `read_any_fast_delta` during remotefilelog's repack We now have a better function with a clear semantic. This simplify the usage in the remotefilelog code.
Thu, 01 Aug 2024 13:42:34 +0200 manifest: use read_any_fast_delta in changectx
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 01 Aug 2024 13:42:34 +0200] rev 51777
manifest: use read_any_fast_delta in changectx The new API is clearer but also more expressive. It allow to detect case where we did return a full read and populated the associated cache. Saving time!
Thu, 01 Aug 2024 13:40:46 +0200 manifest: allow skipping valid_bases argument to `read_any_fast_delta`
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 01 Aug 2024 13:40:46 +0200] rev 51776
manifest: allow skipping valid_bases argument to `read_any_fast_delta` In some case it make sens to just want a delta. So we update the API to support this.
Thu, 01 Aug 2024 05:35:06 +0200 manifest: introduce a `read_any_fast_delta` method
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 01 Aug 2024 05:35:06 +0200] rev 51775
manifest: introduce a `read_any_fast_delta` method This method is a clearer semantic than `readbase` and `readfast` and will allow for more accurate optimization and usage. This is part of a wider series introducing such clearer method.
Mon, 05 Aug 2024 10:03:06 +0200 manifest: add many type annotations to the manifest module
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 05 Aug 2024 10:03:06 +0200] rev 51774
manifest: add many type annotations to the manifest module This help to clarify the API a bit, this caught various bug in the process and will help to catch more in the future. This also make large refactoring significantly simpler.
Mon, 05 Aug 2024 10:15:10 +0200 manifest: help pytype to understant `writesubtrees`'s `getnode` type
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 05 Aug 2024 10:15:10 +0200] rev 51773
manifest: help pytype to understant `writesubtrees`'s `getnode` type Since we provide a default, the return of `_lazydirs.get` is cannot be None. We help pytype to understand that.
Mon, 05 Aug 2024 10:13:31 +0200 manifest: use explicit None checking in `_loaddifflazy`
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 05 Aug 2024 10:13:31 +0200] rev 51772
manifest: use explicit None checking in `_loaddifflazy` This helps pytype to understand what is going here with `v2` type.
Mon, 05 Aug 2024 10:12:37 +0200 manifest: use explicit None checking in `_loadlazy`
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 05 Aug 2024 10:12:37 +0200] rev 51771
manifest: use explicit None checking in `_loadlazy` This help pytype to understand what is going on with `v` type.
Mon, 05 Aug 2024 10:11:51 +0200 manifest: clear `_lazydirs` in place in `_loadalllazy`
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 05 Aug 2024 10:11:51 +0200] rev 51770
manifest: clear `_lazydirs` in place in `_loadalllazy` This avoid resetting the type of the dictionary in pytype eyes. This is consistent with the way the dictionary is cleared bits by bits in `_loadalllazy` Having more accurate code will help pytype. We do it in advance to help bisecting and avoid drowning them in the future type annotation noise.
Mon, 05 Aug 2024 10:10:03 +0200 manifest: use tuple for `delta` in `fastdelta`
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 05 Aug 2024 10:10:03 +0200] rev 51769
manifest: use tuple for `delta` in `fastdelta` This make the list content consistent and will help type annotation.
Mon, 05 Aug 2024 09:22:18 +0200 manifest: expose a version of the Class without interface decorator
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 05 Aug 2024 09:22:18 +0200] rev 51768
manifest: expose a version of the Class without interface decorator The decorator confuse Pytype. Having the "raw" python class exposed will also helps pytype when it get replaced by a native implementation. At least until we start using `typing.Protocol` in the future.
Sun, 04 Aug 2024 10:50:38 +0200 pytype: stop ignoring manifest.py
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 04 Aug 2024 10:50:38 +0200] rev 51767
pytype: stop ignoring manifest.py pytype no longer complains about the file contents.
Sun, 04 Aug 2024 10:48:51 +0200 manifest: align some vfs option access on the fact we might not have options
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 04 Aug 2024 10:48:51 +0200] rev 51766
manifest: align some vfs option access on the fact we might not have options This make the usage consistent with the other option. Caught by pytype.
Sun, 04 Aug 2024 10:49:48 +0200 manifest: adds some type things for manifestdict.added
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 04 Aug 2024 10:49:48 +0200] rev 51765
manifest: adds some type things for manifestdict.added This appeases pytype.
Sun, 04 Aug 2024 10:47:29 +0200 manifest: type and fix unhexlify
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 04 Aug 2024 10:47:29 +0200] rev 51764
manifest: type and fix unhexlify Some part of that function seems to date back from Python 2. It raise question about whether this function is useful or not, but let us just fix it for now. This was caught by pytype.
Sun, 04 Aug 2024 10:45:31 +0200 docker-pytype: use version v2.1 of the CI image
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 04 Aug 2024 10:45:31 +0200] rev 51763
docker-pytype: use version v2.1 of the CI image It use a more recent pytype as far as I understand.
Thu, 01 Aug 2024 13:14:05 +0200 context: some gratuitous documentation improvement
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 01 Aug 2024 13:14:05 +0200] rev 51762
context: some gratuitous documentation improvement I wrote it as I was reading the code.
Thu, 01 Aug 2024 13:07:13 +0100 profiling: add a py-spy profiling backend
Arseniy Alekseyev <aalekseyev@janestreet.com> [Thu, 01 Aug 2024 13:07:13 +0100] rev 51761
profiling: add a py-spy profiling backend The recommended way to use this backend is by setting the config `profiling.output` to point to a file because py-spy output is not human-readable.
Thu, 01 Aug 2024 11:14:58 +0100 copytracing: fix a bug in an edge case in metadata.compute_all_files_changes stable
Arseniy Alekseyev <aalekseyev@janestreet.com> [Thu, 01 Aug 2024 11:14:58 +0100] rev 51760
copytracing: fix a bug in an edge case in metadata.compute_all_files_changes
Thu, 01 Aug 2024 13:04:38 +0100 rhg: ignore readonly FS error when saving dirstate stable
Arseniy Alekseyev <aalekseyev@janestreet.com> [Thu, 01 Aug 2024 13:04:38 +0100] rev 51759
rhg: ignore readonly FS error when saving dirstate The error is already ignored when the .hg directory is read-only, so this is only fair. (the python hg is silent on readonly fs, too)
Thu, 01 Aug 2024 13:38:31 +0100 commit: set whole manifest entries at once (node with its associated flags)
Arseniy Alekseyev <aalekseyev@janestreet.com> [Thu, 01 Aug 2024 13:38:31 +0100] rev 51758
commit: set whole manifest entries at once (node with its associated flags) Add a new function manifest.set that sets whole manifest entries at once, so the caller doesn't have to do two separate operations: m[p] = n m.set_flags(f) becomes: m.set(p, n, f) This obviously saves an extra lookup by path, and it also lets the underlying manifest implementation to be more efficient as it doesn't have to deal with partially-specified entries. It makes the interaction conceptually simpler, as well, since we don't have to go through an intermediate state of incorrect partially-written entry. (the real motivation for this change is an alternative manifest implementation where we batch pending writes, and dealing with fully defined entries makes the batching logic muchsimpler while avoiding slowdown due to alternating writes and reads)
Thu, 01 Aug 2024 11:43:10 -0400 typing: add type hints around the matcher for subrepo archiving
Matt Harbison <matt_harbison@yahoo.com> [Thu, 01 Aug 2024 11:43:10 -0400] rev 51757
typing: add type hints around the matcher for subrepo archiving Mostly this is meant to try to smoke out any other potential issues around the matcher, since these args were mostly previously treated as `Any`, and therefore checking wasn't done.
Thu, 01 Aug 2024 01:52:11 -0400 subrepo: drop the default value of None for the archive matcher
Matt Harbison <matt_harbison@yahoo.com> [Thu, 01 Aug 2024 01:52:11 -0400] rev 51756
subrepo: drop the default value of None for the archive matcher This was flagged by pytype after adding hints to `match.subdirmatcher` that it takes a non-optional matcher. That matcher argument is used without a guard in the subdirmatcher constructor, so that's the correct restriction. I don't think this fixes a bug in practice because the only way these are invoked is either by a parent `hgsubrepo.archive()`, `archival.archive()`, or the largefiles override of these. The `hgsubrepo.archive()` case (and the largefiles override) uses what the caller provided, so the caller will eventually be `archival.archive()` (or the largfiles override) up the call chain. The `archival.archive()` method also has None for its matcher's default arg. However, the three callers of that (`commands.archive()`, `webcommands.archive()`, and `extdiff.snapshot()`) all provide a matcher argument, so the None case can never occur unless a 3rd party extension swaps it for None. Sadly, we can't make the argument on the `archival.archive()` non-optional because there is a kwarg prior to it. Even though the largefiles override of `archival.archive()` is provided a valid matcher, we duplicate the internal creation of the matcher that the original `archival.archive()` does for consistency. By eliminating an impossible to hit case, we can simplify some of the subrepo code too, by dropping unreachable code.
Thu, 01 Aug 2024 16:42:38 +0200 branching: merge stable into default
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 01 Aug 2024 16:42:38 +0200] rev 51755
branching: merge stable into default Post 6.8.1 release.
Thu, 01 Aug 2024 16:34:37 +0200 Added signature for changeset 11a9e2fc0caf stable
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 01 Aug 2024 16:34:37 +0200] rev 51754
Added signature for changeset 11a9e2fc0caf
Thu, 01 Aug 2024 16:34:35 +0200 Added tag 6.8.1 for changeset 11a9e2fc0caf stable
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 01 Aug 2024 16:34:35 +0200] rev 51753
Added tag 6.8.1 for changeset 11a9e2fc0caf
Thu, 01 Aug 2024 15:38:24 +0200 relnotes: add 6.8.1 stable 6.8.1
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 01 Aug 2024 15:38:24 +0200] rev 51752
relnotes: add 6.8.1
Thu, 01 Aug 2024 14:00:07 +0200 rhg: expand user and environment variables in ignore includes stable
Raphaël Gomès <rgomes@octobus.net> [Thu, 01 Aug 2024 14:00:07 +0200] rev 51751
rhg: expand user and environment variables in ignore includes This was reported by a user, and was a TODO long overdue.
Tue, 27 Jun 2023 13:05:03 +0200 utils: avoid using internal _imp.is_frozen()
Mads Kiilerich <mads@kiilerich.com> [Tue, 27 Jun 2023 13:05:03 +0200] rev 51750
utils: avoid using internal _imp.is_frozen() imp has been deprecated for a long time, and were removed in Python 3.12 . As a workaround, we started using the internal _imp. That is ugly and risky. It seems less risky to get the functionality in some other way. Here, we just inspect if 'origin' of the '__main__' module is set and 'frozen'. That seems to work and do the same, and might be better than using the internal _imp directly. This way of inspecting module attributes seems to work in some test cases, but it is a risky change. This level of importlib doesn't have much documentation, a complicated implementation, and we are dealing with some odd use cases.
Mon, 22 Jul 2024 18:20:03 +0200 utils: fix resourceutil use of deprecated importlib.resources
Mads Kiilerich <mads@kiilerich.com> [Mon, 22 Jul 2024 18:20:03 +0200] rev 51749
utils: fix resourceutil use of deprecated importlib.resources Some importlib functionality was deprecated in 3.11 . The documentation on https://docs.python.org/3.12/library/importlib.resources.html recommends using the new .files() API that was introduced in 3.9.
Thu, 11 Jan 2024 20:32:07 +0100 cext: use sys.executable instead of deprecated Py_GetProgramFullPath
Mads Kiilerich <mads@kiilerich.com> [Thu, 11 Jan 2024 20:32:07 +0100] rev 51748
cext: use sys.executable instead of deprecated Py_GetProgramFullPath Fix warning with Python 3.13: mercurial/cext/parsers.c: In function 'check_python_version': mercurial/cext/parsers.c:1243:30: warning: 'Py_GetProgramFullPath' is deprecated [-Wdeprecated-declarations] 1243 | Py_GetProgramFullPath()); | ^~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/python3.13/Python.h:119, from mercurial/cext/parsers.c:11: /usr/include/python3.13/pylifecycle.h:43:43: note: declared here 43 | Py_DEPRECATED(3.13) PyAPI_FUNC(wchar_t *) Py_GetProgramFullPath(void); | ^~~~~~~~~~~~~~~~~~~~~ At this point in time, the PyConfig struct memory has been released and the PyConfig API can't be used. https://docs.python.org/3.13/c-api/init.html#c.Py_GetProgramFullPath recommands using sys.executable instead. Let's assume that will work in all versions. It would perhaps be better to use PySys_GetObject, but I prefer to stay consistent with how the same function is retrieving sys.hexversion.
Thu, 11 Jan 2024 21:58:55 +0100 subrepoutil: pass re.sub 'count' argument by name
Mads Kiilerich <mads@kiilerich.com> [Thu, 11 Jan 2024 21:58:55 +0100] rev 51747
subrepoutil: pass re.sub 'count' argument by name Python 3.13 started warning: DeprecationWarning: 'count' is passed as positional argument
Thu, 11 Jan 2024 21:58:55 +0100 tests: pass re.MULTILINE to re.sub as 'flags' - not in 'count' position
Mads Kiilerich <mads@kiilerich.com> [Thu, 11 Jan 2024 21:58:55 +0100] rev 51746
tests: pass re.MULTILINE to re.sub as 'flags' - not in 'count' position This bug was caught by the new Python 3.13 warning: DeprecationWarning: 'count' is passed as positional argument
Mon, 26 Jun 2023 21:31:41 +0200 tests: use packaging from setuptools instead of deprecated distutils
Mads Kiilerich <mads@kiilerich.com> [Mon, 26 Jun 2023 21:31:41 +0200] rev 51745
tests: use packaging from setuptools instead of deprecated distutils When invoking StrictVersion in 3.12 we got: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead. distutils is dead in the standard library, and we have to move towards using `setuptools` as general extern dependency. Instead of also requiring the extern `packaging`, we will just use the packaging that is vendored in setuptools.
Mon, 26 Jun 2023 15:16:51 +0200 tests: drop test-demandimport.py distutils test that failed with warnings
Mads Kiilerich <mads@kiilerich.com> [Mon, 26 Jun 2023 15:16:51 +0200] rev 51744
tests: drop test-demandimport.py distutils test that failed with warnings The test would fail because warnings: /usr/lib/python3.11/site-packages/_distutils_hack/__init__.py:18: UserWarning: Distutils was imported before Setuptools, but importing Setuptools also replaces the `distutils` module in `sys.modules`. This may lead to undesirable behaviors or errors. To avoid these issues, avoid using distutils directly, ensure that setuptools is installed in the traditional way (e.g. not an editable install), and/or make sure that setuptools is always imported before distutils. warnings.warn( /usr/lib/python3.11/site-packages/_distutils_hack/__init__.py:33: UserWarning: Setuptools is replacing distutils. warnings.warn("Setuptools is replacing distutils.") The test for distutils.msvc9compiler comes from 2205d00b6d2b. But since then, distutils is going away, and this test must change somehow. It is unclear exactly how setuptools depended on msvc9compiler, but setuptools also moved forward, and this exact test no longer seems relevant. It thus seems like a fair solution to remove the test while keeping the demandimport blacklist of distutils.msvc9compiler.
Thu, 29 Jun 2023 20:02:27 +0200 utils: test coverage of makedate
Mads Kiilerich <mads@kiilerich.com> [Thu, 29 Jun 2023 20:02:27 +0200] rev 51743
utils: test coverage of makedate Explore the scenario from ae04af1ce78d to avoid future regressions. This was intended to give some coverage of the change in faccec1edc2c.
Tue, 09 Jul 2024 20:08:48 +0200 mmap: populate mapping in a background thread
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 09 Jul 2024 20:08:48 +0200] rev 51742
mmap: populate mapping in a background thread When possible, we populate the memory mapping in a second thread. The mmap population does not only read the data from disk to memory. It also actually fill the memory mapping between process memory address and the physical memory used by the file system cache containing the mmap'ed data. Doing so buy back the slowdown from pre-population when it matters. When most data is accessed, only a few page fault will occurs, while the background thread fill the memory controller. When few data is accessed, the non-blocking mmap won't have to wait for all data to be populated. Here is a few example of improvement seen in benchmark around unbundle and push: ### data-env-vars.name = netbeans-2018-08-01-zstd-sparse-revlog # benchmark.name = hg.command.unbundle # benchmark.variants.issue6528 = disabled # benchmark.variants.reuse-external-delta-parent = yes # benchmark.variants.revs = any-100-extra-rev before: 0.758101 after: 0.732129 (-3.43%, -0.03) ## data-env-vars.name = mozilla-try-2019-02-18-zstd-sparse-revlog before: 1.519941 after: 1.503473 (-1.08%, -0.02) ### data-env-vars.name = mozilla-try-2019-02-18-zstd-sparse-revlog # benchmark.name = hg.command.push # bin-env-vars.hg.flavor = default # benchmark.variants.issue6528 = disabled # benchmark.variants.protocol = ssh # benchmark.variants.reuse-external-delta-parent = yes # benchmark.variants.revs = any-1-extra-rev before: 4.801442 after: 4.695810 (-1.46%, -0.07) # benchmark.variants.revs = any-100-extra-rev before: 4.848596 after: 4.794075 (-1.12%, -0.05) # bin-env-vars.hg.flavor = rust # benchmark.variants.revs = any-1-extra-rev before: 4.818410 after: 4.700053 (-2.46%, -0.12)
Thu, 25 Jul 2024 14:40:38 -0400 pure: stringify builtin exception messages
Matt Harbison <matt_harbison@yahoo.com> [Thu, 25 Jul 2024 14:40:38 -0400] rev 51741
pure: stringify builtin exception messages Builtin exceptions usually want strings, and display with a wierd b'' prefix if given bytes.
Mon, 29 Jul 2024 12:10:08 -0400 httppeer: avoid another bad reference before assignment warning
Matt Harbison <matt_harbison@yahoo.com> [Mon, 29 Jul 2024 12:10:08 -0400] rev 51740
httppeer: avoid another bad reference before assignment warning This wasn't a problem, because `b''` from the `AttributeError` handler is in `bundle2.bundletypes`, so the following loop and conditional always run at least once. But PyCharm can't figure that out on its own, and it took a little exploring to figure out it wasn't a problem. The usage in `bundle2.writebundle` is to look it up in the map of bundle types, so it will break in a more obvious way in the unlikely event that the empty string is removed from the map in the future.
Fri, 26 Jul 2024 21:59:34 -0400 httppeer: move a variable to avoid a bad reference before assignment warning
Matt Harbison <matt_harbison@yahoo.com> [Fri, 26 Jul 2024 21:59:34 -0400] rev 51739
httppeer: move a variable to avoid a bad reference before assignment warning No actual bug here, because the conditional used to assign is the same as the conditional in the `finally` block that guards the reference.
Fri, 26 Jul 2024 21:54:07 -0400 httppeer: simplify two-way stream cleanup
Matt Harbison <matt_harbison@yahoo.com> [Fri, 26 Jul 2024 21:54:07 -0400] rev 51738
httppeer: simplify two-way stream cleanup No need to conditionalize the cleanup if the filename is assigned outside the exception handler. I suppose `fd` leaks if `os.fdopen()` fails, but that was the case before too (and may trigger another exception in the `finally` block on Windows, when the file is still open).
Mon, 29 Jul 2024 10:07:53 +0200 rustfmt: update expected Rust edition
Raphaël Gomès <rgomes@octobus.net> [Mon, 29 Jul 2024 10:07:53 +0200] rev 51737
rustfmt: update expected Rust edition In this case it doesn't change anything, but we've been using 2021 for a while now.
Mon, 29 Jul 2024 10:04:00 +0200 hghave: update expected rustfmt version
Raphaël Gomès <rgomes@octobus.net> [Mon, 29 Jul 2024 10:04:00 +0200] rev 51736
hghave: update expected rustfmt version We still use nightly, but have moved to a newer nightly after the last CI image upgrade in 74f1bf147a6d and 3876d4c6c79e.
Mon, 29 Jul 2024 10:06:28 +0200 rustfmt: apply formatting expected by newer nightly version
Raphaël Gomès <rgomes@octobus.net> [Mon, 29 Jul 2024 10:06:28 +0200] rev 51735
rustfmt: apply formatting expected by newer nightly version This was missed in 3876d4c6c79ec5c71e8c51b876cc157e93a5eaac somehow.
Thu, 25 Jul 2024 15:56:04 -0400 tests: stop skipping `mercurial/pure/osutil.py` during pytype runs
Matt Harbison <matt_harbison@yahoo.com> [Thu, 25 Jul 2024 15:56:04 -0400] rev 51734
tests: stop skipping `mercurial/pure/osutil.py` during pytype runs Not sure when the original issue(s) were fixed, but it works for me now.
Thu, 25 Jul 2024 13:31:13 -0400 largefiles: avoid a potentially undefined variable in exception case
Matt Harbison <matt_harbison@yahoo.com> [Thu, 25 Jul 2024 13:31:13 -0400] rev 51733
largefiles: avoid a potentially undefined variable in exception case The `wlock` variable is used to release the lock in the `finally` block, so it would be undefined if `repo.wlock()` itself failed. Caught by pytype 2024.04.11 with py3.10.11.
Wed, 24 Jul 2024 22:40:22 -0400 typing: add trivial type hints to `mercurial.scmutil`
Matt Harbison <matt_harbison@yahoo.com> [Wed, 24 Jul 2024 22:40:22 -0400] rev 51732
typing: add trivial type hints to `mercurial.scmutil` There's still a lot to go, but there's a lot here already, so I tried to keep it to obvious/trivial things. I didn't bother with contexts, matchers, and revisions that can be `bytes | int | None`.
Wed, 24 Jul 2024 18:17:00 -0400 typing: narrow the scope of some recent disabled import warnings
Matt Harbison <matt_harbison@yahoo.com> [Wed, 24 Jul 2024 18:17:00 -0400] rev 51731
typing: narrow the scope of some recent disabled import warnings These comments were added in 39e2b2d062c1, but had the effect of changing the known type to `Any`, which cascaded through a few function signatures. Just ignore the import error instead.
Fri, 26 Jul 2024 10:52:28 +0200 demandimport: don't delay threading import stable
Julien Cristau <jcristau@debian.org> [Fri, 26 Jul 2024 10:52:28 +0200] rev 51730
demandimport: don't delay threading import A recent cpython change breaks demandimport by importing threading locally in importlib.util.LazyLoader.exec_module; add it (plus warnings and _weakrefset, which are imported by threading) to demandimport's ignore list. ``` Traceback (most recent call last): File "/usr/bin/hg", line 57, in <module> from mercurial import dispatch File "<frozen importlib._bootstrap>", line 1360, in _find_and_load File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 935, in _load_unlocked File "/usr/lib/python3/dist-packages/hgdemandimport/demandimportpy3.py", line 52, in exec_module super().exec_module(module) File "<frozen importlib.util>", line 257, in exec_module File "<frozen importlib._bootstrap>", line 1360, in _find_and_load File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 935, in _load_unlocked File "/usr/lib/python3/dist-packages/hgdemandimport/demandimportpy3.py", line 52, in exec_module super().exec_module(module) File "<frozen importlib.util>", line 267, in exec_module AttributeError: partially initialized module 'threading' has no attribute 'RLock' (most likely due to a circular import) ``` Ref: https://github.com/python/cpython/issues/117983 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1076449 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1076747
Tue, 23 Jul 2024 19:20:22 -0400 typing: induce pytype to use the standard `attr` instead of the vendored copy
Matt Harbison <matt_harbison@yahoo.com> [Tue, 23 Jul 2024 19:20:22 -0400] rev 51729
typing: induce pytype to use the standard `attr` instead of the vendored copy What was previously happening with the vendored copy was that pytype would stub out all(?) classes that were decorated with `@attr.s` as `Any`. After this, we get a ton of classes defined, and numerous fields and methods now have proper types.
Tue, 23 Jul 2024 19:14:16 -0400 typing: disable some pytype errors in `mercurial.store`
Matt Harbison <matt_harbison@yahoo.com> [Tue, 23 Jul 2024 19:14:16 -0400] rev 51728
typing: disable some pytype errors in `mercurial.store` These seem to be legitimate errors, since one of the two callers (`encodedstore.data_entries()`) was previously typed to generate `BaseStoreEntry`. However, that and the other caller only pass `RevlogStoreEntry` objects. I can't tell if this was a WIP or what, but don't want to get side tracked on this. So flag as a TODO for later.
Tue, 23 Jul 2024 19:05:26 -0400 linelog: correct the default value of `annotateresult.lines`
Matt Harbison <matt_harbison@yahoo.com> [Tue, 23 Jul 2024 19:05:26 -0400] rev 51727
linelog: correct the default value of `annotateresult.lines` This was flagged by pytype once it was tricked into using the standard `attr` package instead of the vendored copy.
Tue, 23 Jul 2024 19:01:16 -0400 phabricator: correct the default value of `phabhunk.corpus`
Matt Harbison <matt_harbison@yahoo.com> [Tue, 23 Jul 2024 19:01:16 -0400] rev 51726
phabricator: correct the default value of `phabhunk.corpus` There's only one caller to this constructor (which does provide this argument), and no direct assignments, so there's no runtime bug here. However, when pytype is tricked into using the standard `attr` package instead of the vendored version, it flags this because bytes is passed to the one constructor invocation. Tricking pytype into using the standard package will generate many more type hints, noteably around `@attr.s` decorated things.
Mon, 22 Jul 2024 18:20:29 +0200 rust-changelog: accessing the index
Georges Racinet <georges.racinet@cloudcrane.io> [Mon, 22 Jul 2024 18:20:29 +0200] rev 51725
rust-changelog: accessing the index The `Index` object is currently the one providing all DAG related algorithms, starting with simple ancestors iteration up to more advanced ones (ranges, common ancestors…). From pure Rust code, there was no way to access the changelog index for a given `Repository`, probably because `rhg` does not use any such algorithm yet.
Sat, 20 Jul 2024 17:03:30 -0400 typing: add type hints to `mercurial.policy`
Matt Harbison <matt_harbison@yahoo.com> [Sat, 20 Jul 2024 17:03:30 -0400] rev 51724
typing: add type hints to `mercurial.policy` Mostly trivial, but this seems like the logical module to use to inject the hints from `cext`, `pure`, etc, given that this file has the fallback policy. This is a first step. There doesn't appear to be a predefined type for a module in py3.7, so those are omitted for now.
Sat, 20 Jul 2024 01:55:09 -0400 cext: correct the argument handling of `b85encode()`
Matt Harbison <matt_harbison@yahoo.com> [Sat, 20 Jul 2024 01:55:09 -0400] rev 51723
cext: correct the argument handling of `b85encode()` The type stub indicated that this argument is `Optional`, which implies None is allowed. I don't see in the documentation where that's the case for `i`[1], and trying it in `hg debugshell` resulted in the method failing with a TypeError. I guess it was typed as an `int` argument because the `p` format unit wasn't added until Python 3.3[2]. In any event, 2 clients in core (`pvec` and `obsolete`) call this with no argument supplied, and `mdiff` calls it with True. So I guess we've avoided the None arg case, and when no arg is supplied, it defaults to the 0 initialization of the `pad` variable in C. Since the `p` format unit accepts both `int` and None, as well as `bool`, I'm not bothering to bump the module version- this code is more permissive than it was, in addition to being more correct. Interestingly, when I first imported the `cext` and `pure` methods in the same manner as the previous commit, it dropped the `Optional` part of the argument type when generating `util.pyi`. No idea why. [1] https://docs.python.org/3/c-api/arg.html#numbers [2] https://docs.python.org/3/c-api/arg.html#other-objects
Fri, 19 Jul 2024 20:09:48 -0400 typing: add type hints to the `charencode` module
Matt Harbison <matt_harbison@yahoo.com> [Fri, 19 Jul 2024 20:09:48 -0400] rev 51722
typing: add type hints to the `charencode` module Since this module is dynamically imported from either `mercurial.pure` or `mercurial.cext`, these hints aren't detected in `mercurial.encoding`, and need to be imported directly there during the type-checking phase. This keeps the runtime selection via the policy config in place, but allows pytype to see these as functions with proper signatures instead of just `Any`. We don't attempt to import the `mercurial.cext` version yet because there's no types stubs for that module, but this will get the ball rolling. I thought this would spill over into other modules from there, but the only two *.pyi files that changed were for `encoding` and `charencode`. Applying this to other dynamically selected modules will clean some things up in other files, so this is a start. I had originally redefined the functions in the type-checking block (like some of the `os.path` aliasing in `mercurial.util`), but this is better because we won't have another duplication of the definitions that may get out of date.
Fri, 19 Jul 2024 16:49:46 -0400 typing: explicitly type some `mercurial.util` eol code to avoid @overload
Matt Harbison <matt_harbison@yahoo.com> [Fri, 19 Jul 2024 16:49:46 -0400] rev 51721
typing: explicitly type some `mercurial.util` eol code to avoid @overload Unlike the previous commit, this makes a material difference in the generated stub file- the `pycompat.identity()` aliases generated an @overload like this: @overload def fromnativeeol(a: _T0) -> _T0: ... ... which might fail to detect a bad argument, like str. This drops the @overload for the 3 related methods, so there's a single definition for each. The `typelib.BinaryIO_Proxy` is used for subclassing (the same as was done in 8147abc05794), so that it is a `BinaryIO` type during type checking, but still inherits `object` at runtime. That way, we don't need to implement unused abstract methods.
Fri, 19 Jul 2024 16:38:53 -0400 typing: avoid some useless @overload definitions in `mercurial.util`
Matt Harbison <matt_harbison@yahoo.com> [Fri, 19 Jul 2024 16:38:53 -0400] rev 51720
typing: avoid some useless @overload definitions in `mercurial.util` Apparently pytype considered the name as well as the type of each argument, and generates @overload definitions if they don't match. At best this is clutter, and can easily be removed.
Thu, 18 Jul 2024 22:46:36 -0400 dirstate: stringify a few exception messages
Matt Harbison <matt_harbison@yahoo.com> [Thu, 18 Jul 2024 22:46:36 -0400] rev 51719
dirstate: stringify a few exception messages Built in exceptions want str, and ProgrammingError converts bytes to str internally (because it subclasses RuntimeError).
Thu, 18 Jul 2024 20:34:35 -0400 typing: add type hints to `mercurial.verify._normpath()`
Matt Harbison <matt_harbison@yahoo.com> [Thu, 18 Jul 2024 20:34:35 -0400] rev 51718
typing: add type hints to `mercurial.verify._normpath()` Since 10db46e128d4, pytype almost figured this out, going from `Any` -> `_T0`, but the intent is obvious.
Thu, 18 Jul 2024 20:16:31 -0400 typing: add type hints to `i18n._msgcache`
Matt Harbison <matt_harbison@yahoo.com> [Thu, 18 Jul 2024 20:16:31 -0400] rev 51717
typing: add type hints to `i18n._msgcache` Since 10db46e128d4, pytype stopped inferring that the key is bytes.
Thu, 18 Jul 2024 19:57:42 -0400 typing: add type hints to `mercurial.dirstatemap`
Matt Harbison <matt_harbison@yahoo.com> [Thu, 18 Jul 2024 19:57:42 -0400] rev 51716
typing: add type hints to `mercurial.dirstatemap` Somewhere since 10db46e128d4, pytype stopped being able to infer the type of the `identity` field. Fill in some obvious other hints along the way. These hints caused pytype to flag a missing attribute: File "/mnt/c/Users/Matt/hg/mercurial/dirstatemap.py", line 714, in _v1_map: No attribute 'stat' on mercurial.windows.cachestat [attribute-error] In Union[Any, mercurial.posix.cachestat, mercurial.windows.cachestat] File "/mnt/c/Users/Matt/hg/mercurial/dirstatemap.py", line 715, in _v1_map: No attribute 'stat' on mercurial.windows.cachestat [attribute-error] In Union[Any, mercurial.posix.cachestat, mercurial.windows.cachestat] In practice, the `identity` field is NOT replaced with None if it isn't cacheable, so it's probably safer to just add the field and set it to None, since that check is already in place on line 715.
Thu, 18 Jul 2024 19:55:51 -0400 typing: add type hints to `cmdutil.findrepo()`
Matt Harbison <matt_harbison@yahoo.com> [Thu, 18 Jul 2024 19:55:51 -0400] rev 51715
typing: add type hints to `cmdutil.findrepo()` Since 10db46e128d4, pytype almost figured this out, going from `Any` -> `_T0`, but the intent is obvious.
Thu, 18 Jul 2024 19:01:55 -0400 typing: add some type hints to fastannotate that have decayed in the last year
Matt Harbison <matt_harbison@yahoo.com> [Thu, 18 Jul 2024 19:01:55 -0400] rev 51714
typing: add some type hints to fastannotate that have decayed in the last year Somewhere since 10db46e128d4, `_knownopts` decayed to `set` for unknown reasons. Also, `annotateopts.default` changed from bytes to str. While that is correct, I noticed that PyCharm was flagging the member fields as undefined in `shortstr()`, so add those to keep it happy. (There are no complaints from pytype because that module is excluded, due to the missing reference to `linelog.copyfrom()` that I'm not sure how to fix.)
Tue, 23 Jul 2024 12:12:22 +0200 heptapod-ci: use new v2.1 image
Raphaël Gomès <rgomes@octobus.net> [Tue, 23 Jul 2024 12:12:22 +0200] rev 51713
heptapod-ci: use new v2.1 image This is finally catching up to ~3 years of tech debt.
Tue, 23 Jul 2024 12:12:03 +0200 heptapod-ci: move version prints closer to the start
Raphaël Gomès <rgomes@octobus.net> [Tue, 23 Jul 2024 12:12:03 +0200] rev 51712
heptapod-ci: move version prints closer to the start This makes debugging a lot easier if anything is to go wrong, and shows output earlier.
Tue, 23 Jul 2024 12:10:31 +0200 pytype: only try the hacky way of finding PYTHON if not provided
Raphaël Gomès <rgomes@octobus.net> [Tue, 23 Jul 2024 12:10:31 +0200] rev 51711
pytype: only try the hacky way of finding PYTHON if not provided This allows us to work in more environments, like when using pyenv. This syntax is compatible with all POSIX shells.
Mon, 22 Jul 2024 14:42:54 +0200 dummysmtpd: fix EOF handling on newer versions of OpenSSL
Raphaël Gomès <rgomes@octobus.net> [Mon, 22 Jul 2024 14:42:54 +0200] rev 51710
dummysmtpd: fix EOF handling on newer versions of OpenSSL Explanations inline.
Mon, 22 Jul 2024 14:19:12 +0200 test-install: add new glob for the upgrade notice in newer versions of pip
Raphaël Gomès <rgomes@octobus.net> [Mon, 22 Jul 2024 14:19:12 +0200] rev 51709
test-install: add new glob for the upgrade notice in newer versions of pip We only globbed for the old warning, newer versions of pip use a cleaner one.
Thu, 18 Jul 2024 13:36:32 +0200 rust: use `.cargo/config.toml` instead of `.cargo/config`
Raphaël Gomès <rgomes@octobus.net> [Thu, 18 Jul 2024 13:36:32 +0200] rev 51708
rust: use `.cargo/config.toml` instead of `.cargo/config` This has been deprecated for a while now and we don't support Rust versions that only understand the old path.
Thu, 18 Jul 2024 13:35:39 +0200 rust: apply clippy lints
Raphaël Gomès <rgomes@octobus.net> [Thu, 18 Jul 2024 13:35:39 +0200] rev 51707
rust: apply clippy lints They are at most harmless and at best make the codebase more readable and simpler.
Tue, 23 Jul 2024 14:25:23 +0200 rust: change minimum supported version everywhere applicable
Raphaël Gomès <rgomes@octobus.net> [Tue, 23 Jul 2024 14:25:23 +0200] rev 51706
rust: change minimum supported version everywhere applicable This will help users and downstream packaging.
Thu, 18 Jul 2024 12:38:26 +0200 rustfmt: format the codebase with nightly-2024-07-16
Raphaël Gomès <rgomes@octobus.net> [Thu, 18 Jul 2024 12:38:26 +0200] rev 51705
rustfmt: format the codebase with nightly-2024-07-16 The CI has moved to a newer nightly, which slightly changes how it wraps comments (which is the very option we use nightly for).
Thu, 18 Jul 2024 12:37:13 +0200 hghave: update detection of black version to a newer minimum
Raphaël Gomès <rgomes@octobus.net> [Thu, 18 Jul 2024 12:37:13 +0200] rev 51704
hghave: update detection of black version to a newer minimum The CI has moved to version 23.3.0, which is the last one to support 3.7 at runtime.
Thu, 18 Jul 2024 12:36:12 +0200 black: format the codebase with 23.3.0
Raphaël Gomès <rgomes@octobus.net> [Thu, 18 Jul 2024 12:36:12 +0200] rev 51703
black: format the codebase with 23.3.0 The CI has moved to 23.3.0, which is the last version that supports 3.7 at runtime, so we should honor this change. # skip-blame mass-reformating only
Thu, 18 Jul 2024 12:03:29 +0200 pytype: work around wrong ImportError flagging
Raphaël Gomès <rgomes@octobus.net> [Thu, 18 Jul 2024 12:03:29 +0200] rev 51702
pytype: work around wrong ImportError flagging As documented in https://github.com/google/pytype/issues/163, newer versions of Pytype do not understand caught `ImportError`, so we temporarily ignore them where applicable.
Thu, 18 Jul 2024 12:02:01 +0200 zeroconf: fix boolean return value
Raphaël Gomès <rgomes@octobus.net> [Thu, 18 Jul 2024 12:02:01 +0200] rev 51701
zeroconf: fix boolean return value This was (wrongly) flagged by Pytype as being undefined since it doesn't seem to understand `try` blocks. However, the caller is expecting a boolean and the fix to appease Pytype is simple, so we do both.
Tue, 23 Jul 2024 10:02:46 +0200 Backout accidental publication of a large range of revisions
Raphaël Gomès <rgomes@octobus.net> [Tue, 23 Jul 2024 10:02:46 +0200] rev 51700
Backout accidental publication of a large range of revisions I accidentally published 25e7f9dcad0f::bd1483fd7088, this is the inverse.
Mon, 22 Jul 2024 16:49:38 +0200 Latest image and pytype fix
Raphaël Gomès <rgomes@octobus.net> [Mon, 22 Jul 2024 16:49:38 +0200] rev 51699
Latest image and pytype fix
Mon, 22 Jul 2024 14:42:54 +0200 dummysmtpd: fix EOF handling on newer versions of OpenSSL
Raphaël Gomès <rgomes@octobus.net> [Mon, 22 Jul 2024 14:42:54 +0200] rev 51698
dummysmtpd: fix EOF handling on newer versions of OpenSSL Explanations inline.
Mon, 22 Jul 2024 14:19:12 +0200 test-install: add new glob for the upgrade notice in newer versions of pip
Raphaël Gomès <rgomes@octobus.net> [Mon, 22 Jul 2024 14:19:12 +0200] rev 51697
test-install: add new glob for the upgrade notice in newer versions of pip We only globbed for the old warning, newer versions of pip use a cleaner one.
Thu, 18 Jul 2024 15:48:05 +0200 Try the full CI run
Raphaël Gomès <rgomes@octobus.net> [Thu, 18 Jul 2024 15:48:05 +0200] rev 51696
Try the full CI run
Thu, 18 Jul 2024 14:57:37 +0200 WIP test new CI image
Raphaël Gomès <rgomes@octobus.net> [Thu, 18 Jul 2024 14:57:37 +0200] rev 51695
WIP test new CI image
Thu, 18 Jul 2024 13:36:32 +0200 rust: use `.cargo/config.toml` instead of `.cargo/config`
Raphaël Gomès <rgomes@octobus.net> [Thu, 18 Jul 2024 13:36:32 +0200] rev 51694
rust: use `.cargo/config.toml` instead of `.cargo/config` This has been deprecated for a while now and we don't support Rust versions that only understand the old path.
Thu, 18 Jul 2024 13:35:39 +0200 rust: apply clippy lints
Raphaël Gomès <rgomes@octobus.net> [Thu, 18 Jul 2024 13:35:39 +0200] rev 51693
rust: apply clippy lints They are at most harmless and at best make the codebase more readable and simpler.
Thu, 18 Jul 2024 12:38:26 +0200 rustfmt: format the codebase with nightly-2024-07-16
Raphaël Gomès <rgomes@octobus.net> [Thu, 18 Jul 2024 12:38:26 +0200] rev 51692
rustfmt: format the codebase with nightly-2024-07-16 The CI has moved to a newer nightly, which slightly changes how it wraps comments (which is the very option we use nightly for).
Thu, 18 Jul 2024 12:37:13 +0200 hghave: update detection of black version to a newer minimum
Raphaël Gomès <rgomes@octobus.net> [Thu, 18 Jul 2024 12:37:13 +0200] rev 51691
hghave: update detection of black version to a newer minimum The CI has moved to version 23.3.0, which is the last one to support 3.7 at runtime.
Thu, 18 Jul 2024 12:36:12 +0200 black: format the codebase with 23.3.0
Raphaël Gomès <rgomes@octobus.net> [Thu, 18 Jul 2024 12:36:12 +0200] rev 51690
black: format the codebase with 23.3.0 The CI has moved to 23.3.0, which is the last version that supports 3.7 at runtime, so we should honor this change. # skip-blame mass-reformating only
Thu, 18 Jul 2024 12:03:29 +0200 pytype: work around wrong ImportError flagging
Raphaël Gomès <rgomes@octobus.net> [Thu, 18 Jul 2024 12:03:29 +0200] rev 51689
pytype: work around wrong ImportError flagging As documented in https://github.com/google/pytype/issues/163, newer versions of Pytype do not understand caught `ImportError`, so we temporarily ignore them where applicable.
Thu, 18 Jul 2024 12:02:01 +0200 zeroconf: fix boolean return value
Raphaël Gomès <rgomes@octobus.net> [Thu, 18 Jul 2024 12:02:01 +0200] rev 51688
zeroconf: fix boolean return value This was (wrongly) flagged by Pytype as being undefined since it doesn't seem to understand `try` blocks. However, the caller is expecting a boolean and the fix to appease Pytype is simple, so we do both.
Thu, 11 Jul 2024 21:54:02 -0400 convert: fix various leaked file descriptors
Matt Harbison <matt_harbison@yahoo.com> [Thu, 11 Jul 2024 21:54:02 -0400] rev 51687
convert: fix various leaked file descriptors Some of these only leaked if an exception occurred between the open and close, but a lot of these leaked unconditionally. A type hint is added to `parsesplicemap` because otherwise this change caused pytype to change the return type from this to `Dict[nothing, nothing]`.
Thu, 11 Jul 2024 21:16:45 -0400 convert: stringify `shlex` class argument
Matt Harbison <matt_harbison@yahoo.com> [Thu, 11 Jul 2024 21:16:45 -0400] rev 51686
convert: stringify `shlex` class argument The documentation is handwavy, but typeshed says this should be `str`[1]. I'm not sure if this is the correct encoding (vs `fsencode` or "latin1" like the tokens returned by the proxy class). While we're here, we can add a few more type hints that would have caused pytype to flag the problem. [1] https://github.com/python/typeshed/blob/6a9b53e719a139c2d6b41cf265ed0990cf438192/stdlib/shlex.pyi#L51
Thu, 11 Jul 2024 20:54:06 -0400 typing: add trivial type hints to the convert extension's common modules
Matt Harbison <matt_harbison@yahoo.com> [Thu, 11 Jul 2024 20:54:06 -0400] rev 51685
typing: add trivial type hints to the convert extension's common modules This started as ensuring that the `encoding` and `orig_encoding` attributes has a type other than `Any`, so pytype can catch problems where it needs to be str for stdlib encoding and decoding. It turns out that adding the hint in `mercurial.encoding` is what was needed, but I picked a bunch of low hanging fruit while here. There's definitely more to do, and I see a problem where `shlex.shlex` is being fed bytes instead of str, but there are not enough type hints yet to make pytype notice.
Thu, 11 Jul 2024 14:46:00 -0400 convert: drop a duplicate implementation of `dateutil.makedate()`
Matt Harbison <matt_harbison@yahoo.com> [Thu, 11 Jul 2024 14:46:00 -0400] rev 51684
convert: drop a duplicate implementation of `dateutil.makedate()` I noticed this because the signature generated by pytype recently changed to be less specific. When the method was introduced back in 337d728e644f, `util.makedate()` didn't take an optional timestamp arg. But now it does, and the methods are the same (except the `dateutil` version validates that the timestamp isn't a negative value). I left the old method in place in case anyone has custom convert code that monkey patches it.
Mon, 08 Jul 2024 15:48:34 +0200 revlog: use mmap by default is pre-population is available
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 08 Jul 2024 15:48:34 +0200] rev 51683
revlog: use mmap by default is pre-population is available Using mmap has a great impact of memory usage on server, and a good impact on performance in multiple case. Now that we pre-populate memory mapping by default, there is case where it using mmap is slower. So we use it by default (if pre-population is available). Further work to reduce the performance impact of the pre-population will be done later. Some benchmark below (using the same setup as 522b4d729e89): As for 522b4d729e89 the impact on small repository like Mercurial or Pypy is tiny, ~1% best. However for large repositories we see some performance improvement without seeing the performance regression that we could have without pre-populate. ##### For netbeans ### data-env-vars.name = netbeans-2018-08-01-zstd-sparse-revlog ## benchmark.name = hg.command.log # bin-env-vars.hg.flavor = rust # benchmark.variants.limit-rev = 1 # benchmark.variants.patch = yes no-mmap: 0.171579 mmap: 0.166311 (-3.07%, -0.01) # bin-env-vars.hg.flavor = default no-mmap: 0.170716 mmap: 0.165218 (-3.22%, -0.01) # benchmark.variants.patch = no # benchmark.variants.rev = tip no-mmap: 0.140862 mmap: 0.137566 (-2.34%, -0.00) ## benchmark.name = hg.command.unbundle # bin-env-vars.hg.flavor = rust # benchmark.variants.issue6528 = disabled # benchmark.variants.reuse-external-delta-parent = yes # benchmark.variants.revs = any-1-extra-rev # benchmark.variants.source = unbundle no-mmap: 0.238038 mmap: 0.239912 no-populate: 0.cbd4c9 (+11.71%, +0.03) #### For Mozilla ### data-env-vars.name = mozilla-try-2019-02-18-ds2-pnm # benchmark.name = hg.command.log # bin-env-vars.hg.flavor = rust # bin-env-vars.hg.py-re2-module = default # benchmark.variants.limit-rev = 1 # benchmark.variants.patch = yes no-mmap: 0.258440 mmap: 0.237813 (-7.98%, -0.02) # benchmark.variants.limit-rev = 10 no-mmap: 1.235323 mmap: 1.213578 (-1.76%, -0.02) ## benchmark.name = hg.command.push # bin-env-vars.hg.flavor = rust # bin-env-vars.hg.py-re2-module = default # benchmark.variants.explicit-rev = none # benchmark.variants.issue6528 = disabled # benchmark.variants.protocol = ssh # benchmark.variants.reuse-external-delta-parent = yes # benchmark.variants.revs = any-1-extra-rev no-mmap: 4.790135 mmap: 4.668971 (-2.53%, -0.12) no-populate: 4.841141 (+1.06%, +0.05) ### data-env-vars.name = mozilla-try-2019-02-18-zstd-sparse-revlog ## benchmark.name = hg.command.log # bin-env-vars.hg.flavor = default # benchmark.variants.limit-rev = 1000 # benchmark.variants.rev = tip no-mmap: 0.206187 mmap: 0.197348 (-4.29%, -0.01) ## benchmark.name = hg.command.push # bin-env-vars.hg.flavor = default # benchmark.variants.explicit-rev = none # benchmark.variants.issue6528 = disabled # benchmark.variants.protocol = ssh # benchmark.variants.reuse-external-delta-parent = yes # benchmark.variants.revs = any-1-extra-rev no-mmap: 4.768259 mmap: 4.798632 no-populate: 4.953295 (+3.88%, +0.19) # benchmark.variants.revs = any-100-extra-rev no-mmap: 4.785946 mmap: 4.903618 no-populate: 5.014963 (+4.79%, +0.23) ## benchmark.name = hg.command.unbundle # bin-env-vars.hg.flavor = default # benchmark.variants.issue6528 = disabled # benchmark.variants.reuse-external-delta-parent = yes # benchmark.variants.revs = any-1-extra-rev # benchmark.variants.source = unbundle no-mmap: 1.400121 mmap: 1.423411 no-populate: 1.585365 (+13.23%, +0.19)
Mon, 08 Jul 2024 17:02:27 +0200 revlog: use an explicit config option to enable mmap usage for index
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 08 Jul 2024 17:02:27 +0200] rev 51682
revlog: use an explicit config option to enable mmap usage for index We replace the `experimental.mmapindexthreshold` with two options: The `storage.revlog.mmap.index` is a boolean option to enable or disable the feature. The `storage.revlog.mmap.index:size-threshold` is a bytes option that control when we will be using mmap instead of plain reading.
Thu, 11 Apr 2024 00:02:07 +0200 mmap: populate the mapping by default
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 11 Apr 2024 00:02:07 +0200] rev 51681
mmap: populate the mapping by default Without pre-population, accessing all data through a mmap can result in many pagefault, reducing performance significantly. If the mmap is prepopulated, the performance can no longer get slower than a full read. (See benchmark number below) In some cases were very few data is read, prepopulating can be overkill and slower than populating on access (through page fault). So that behavior can be controlled when the caller can pre-determine the best behavior. (See benchmark number below) In addition, testing with populating in a secondary thread yield great result combining the best of each approach. This might be implemented in later changesets. In all cases, using mmap has a great effect on memory usage when many processes run in parallel on the same machine. ### Benchmarks # What did I run A couple of month back I ran a large benchmark campaign to assess the impact of various approach for using mmap with the revlog (and other files), it highlighted a few benchmarks that capture the impact of the changes well. So to validate this change I checked the following: - log command displaying various revisions (read the changelog index) - log command displaying the patch of listed revisions (read the changelog index, the manifest index and a few files indexes) - unbundling a few revisions (read and write changelog, manifest and few files indexes, and walk the graph to update some cache) - pushing a few revisions (read and write changelog, manifest and few files indexes, walk the graph to update some cache, performs various accesses locally and remotely during discovery) Benchmarks were run using the default module policy (c+py) and the rust one. No significant difference were found between the two implementation, so we will present result using the default policy (unless otherwise specified). I ran them on a few repositories : - mercurial: a "public changeset only" copy of mercurial from 2018-08-01 using zstd compression and sparse-revlog - pypy: a copy of pypy from 2018-08-01 using zstd compression and sparse-revlog - netbeans: a copy of netbeans from 2018-08-01 using zstd compression and sparse-revlog - mozilla-try: a copy of mozilla-try from 2019-02-18 using zstd compression and sparse-revlog - mozilla-try persistent-nodemap: Same as the above but with a persistent nodemap. Used for the log --patch benchmark only # Results For the smaller repositories (mercurial, pypy), the impact of mmap is almost imperceptible, other cost dominating the operation. The impact of prepopulating is undiscernible in the benchmark we ran. For larger repositories the benchmark support explanation given above: On netbeans, the log can be about 1% faster without repopulation (for a difference < 100ms) but unbundle becomes a bit slower, even when small. ### data-env-vars.name = netbeans-2018-08-01-zstd-sparse-revlog # benchmark.name = hg.command.unbundle # benchmark.variants.issue6528 = disabled # benchmark.variants.reuse-external-delta-parent = yes # benchmark.variants.revs = any-1-extra-rev # benchmark.variants.source = unbundle # benchmark.variants.verbosity = quiet with-populate: 0.240157 no-populate: 0.265087 (+10.38%, +0.02) # benchmark.variants.revs = any-100-extra-rev with-populate: 1.459518 no-populate: 1.481290 (+1.49%, +0.02) ## benchmark.name = hg.command.push # benchmark.variants.explicit-rev = none # benchmark.variants.issue6528 = disabled # benchmark.variants.protocol = ssh # benchmark.variants.reuse-external-delta-parent = yes # benchmark.variants.revs = any-1-extra-rev with-populate: 0.771919 no-populate: 0.792025 (+2.60%, +0.02) # benchmark.variants.revs = any-100-extra-rev with-populate: 1.459518 no-populate: 1.481290 (+1.49%, +0.02) For mozilla-try, the "slow down" from pre-populate for small `hg log` is more visible, but still small in absolute time. (using rust value for the persistent nodemap value to be relevant). ### data-env-vars.name = mozilla-try-2019-02-18-ds2-pnm # benchmark.name = hg.command.log # bin-env-vars.hg.flavor = rust # benchmark.variants.patch = yes # benchmark.variants.limit-rev = 1 with-populate: 0.237813 no-populate: 0.229452 (-3.52%, -0.01) # benchmark.variants.limit-rev = 10 # benchmark.variants.patch = yes with-populate: 1.213578 no-populate: 1.205189 ### data-env-vars.name = mozilla-try-2019-02-18-zstd-sparse-revlog # benchmark.variants.limit-rev = 1000 # benchmark.variants.patch = no # benchmark.variants.rev = tip with-populate: 0.198607 no-populate: 0.195038 (-1.80%, -0.00) However pre-populating provide a significant boost on more complex operations like unbundle or push: ### data-env-vars.name = mozilla-try-2019-02-18-zstd-sparse-revlog # benchmark.name = hg.command.push # benchmark.variants.explicit-rev = none # benchmark.variants.issue6528 = disabled # benchmark.variants.protocol = ssh # benchmark.variants.reuse-external-delta-parent = yes # benchmark.variants.revs = any-1-extra-rev with-populate: 4.798632 no-populate: 4.953295 (+3.22%, +0.15) # benchmark.variants.revs = any-100-extra-rev with-populate: 4.903618 no-populate: 5.014963 (+2.27%, +0.11) ## benchmark.name = hg.command.unbundle # benchmark.variants.revs = any-1-extra-rev with-populate: 1.423411 no-populate: 1.585365 (+11.38%, +0.16) # benchmark.variants.revs = any-100-extra-rev with-populate: 1.537909 no-populate: 1.688489 (+9.79%, +0.15)
Thu, 11 Jul 2024 11:10:40 -0400 win32mbcs: use str for encoding value stable
Matt Harbison <matt_harbison@yahoo.com> [Thu, 11 Jul 2024 11:10:40 -0400] rev 51680
win32mbcs: use str for encoding value This was reported to the TortoiseHg tracker as: https://foss.heptapod.net/mercurial/tortoisehg/thg/-/issues/5980 It doesn't look like we have any tests for this extension, but the explicit type hints are enough to convince pytype that the module level `_encoding` attr is str. The `encode()` and `decode()` methods are too complex to add type hints for them.
Wed, 10 Jul 2024 18:44:55 -0400 typing: add a trivial type hint to `mercurial/vfs.py`
Matt Harbison <matt_harbison@yahoo.com> [Wed, 10 Jul 2024 18:44:55 -0400] rev 51679
typing: add a trivial type hint to `mercurial/vfs.py` Since hg 3dbc7b1ecaba, pytype stopped seeing the return value of `rmtree` as `None`, and substituted `Any`.
Wed, 10 Jul 2024 18:34:47 -0400 typing: add a few trivial type hints to `mercurial/templater.py`
Matt Harbison <matt_harbison@yahoo.com> [Wed, 10 Jul 2024 18:34:47 -0400] rev 51678
typing: add a few trivial type hints to `mercurial/templater.py` Since hg 3dbc7b1ecaba, pytype started inferring that the second value in the tuple is `BinaryIO`, but still hasn't been able to figure out the rest of `open_template()`. We can be more precise.
Wed, 10 Jul 2024 18:19:32 -0400 typing: add a few type hints to `mercurial/revlog.py`
Matt Harbison <matt_harbison@yahoo.com> [Wed, 10 Jul 2024 18:19:32 -0400] rev 51677
typing: add a few type hints to `mercurial/revlog.py` Somewhere between hg 3dbc7b1ecaba and hg 8e3f6b5bf720, pytype stopped being able to infer the type for `_docket_file` and `compress()`. Lock those types in before they get lost.
Wed, 10 Jul 2024 18:05:40 -0400 typing: add a trivial type hint to `mercurial/posix.py` to avoid an @overload
Matt Harbison <matt_harbison@yahoo.com> [Wed, 10 Jul 2024 18:05:40 -0400] rev 51676
typing: add a trivial type hint to `mercurial/posix.py` to avoid an @overload Since hg 3dbc7b1ecaba, pytype added an `@overload` for this function, without a type on the parameter. That's wrong, and undermines the hints on the non-trivial functions.
Wed, 10 Jul 2024 17:55:14 -0400 typing: add some trivial type hints to `mercurial/match.py`
Matt Harbison <matt_harbison@yahoo.com> [Wed, 10 Jul 2024 17:55:14 -0400] rev 51675
typing: add some trivial type hints to `mercurial/match.py` These were new methods since hg 3dbc7b1ecaba, but surprisingly pytype couldn't figure them out.
Wed, 10 Jul 2024 17:44:49 -0400 typing: add a type hint to `mercurial/hg.py`
Matt Harbison <matt_harbison@yahoo.com> [Wed, 10 Jul 2024 17:44:49 -0400] rev 51674
typing: add a type hint to `mercurial/hg.py` Somewhere between hg 3dbc7b1ecaba and hg 8e3f6b5bf720, the first value of the tuple changed from bytes to str. Let's lock this in, so that pytype flags it if someone mistakenly adds a tuple with bytes somewhere.
Wed, 10 Jul 2024 17:37:35 -0400 typing: restore `encoding.encoding` and `encoding.encodingmode` to bytes
Matt Harbison <matt_harbison@yahoo.com> [Wed, 10 Jul 2024 17:37:35 -0400] rev 51673
typing: restore `encoding.encoding` and `encoding.encodingmode` to bytes Somewhere between hg 3dbc7b1ecaba and hg 8e3f6b5bf720, pytype determined the signature of these fields changed from `bytes` to `Any`. Not sure why- the type of `environ` then and now is: `Union[WindowsEnviron, Dict[bytes, bytes], os._Environ[bytes]]` That said, PyCharm wasn't able to figure out the type of `environ`, and the `WindowsEnviron` class extends `MutableMapping` without specifying bytes for the key and value types in py3.9. But that's not changed in my setup, so I can't explain it.
Wed, 10 Jul 2024 17:16:19 -0400 typing: add some trivial type hints to `mercurial/bundlecaches.py`
Matt Harbison <matt_harbison@yahoo.com> [Wed, 10 Jul 2024 17:16:19 -0400] rev 51672
typing: add some trivial type hints to `mercurial/bundlecaches.py` The function is meant for extensions, but it wasn't obvious what was expected without looking through the code. Also, pytype couldn't figure it out either.
Wed, 10 Jul 2024 17:09:34 -0400 typing: add some type hints for bundle2 capabilities
Matt Harbison <matt_harbison@yahoo.com> [Wed, 10 Jul 2024 17:09:34 -0400] rev 51671
typing: add some type hints for bundle2 capabilities Somewhere between hg 3dbc7b1ecaba and hg 8e3f6b5bf720, pytype determined the signature of `bundle20.capabilities` changed from `Dict[bytes, Tuple[bytes]]` to `Dict[bytes, Union[List[bytes], Tuple[bytes]]]`. First, I did try to simply be explicit about the previously inferred type, but it does seem to mix and match list/tuple now (e.g. in `writenewbundle()`). I tried changing the new list usage to tuple, but a couple of things complained, (and I think lists of one item are a little more clear to read anyway). So then I typed the dict value as `Sequence[bytes]`, which worked fine. But there's also a module level `capabilities` field, and when that's typed, pytype complains about `Sequence[bytes]` lacking `__add__`[1]. So I gave up, and just assigned it the type it wanted, with an alias. If somebody feels motivated to make the type consistent, it's simple enough to change the alias. The mutable default value to the constructor was removed to appease PyCharm's type checking on the field. (I didn't bother running the code through pytype prior to changing it, because we've previously made an effort to remove this pattern anyway.) I'm not sure why `getrepocaps()` has a default value for `role` that apparently raises an exception. It's just flagged for now so this series can land without risking additional problems. [1] https://foss.heptapod.net/mercurial/mercurial-devel/-/jobs/2466903
Wed, 10 Jul 2024 16:04:53 -0400 typing: add a few type hints to `mercurial/utils/urlutil.py`
Matt Harbison <matt_harbison@yahoo.com> [Wed, 10 Jul 2024 16:04:53 -0400] rev 51670
typing: add a few type hints to `mercurial/utils/urlutil.py` Somewhere between hg 3dbc7b1ecaba and hg 8e3f6b5bf720, `_pathsuboptions` changed from `Dict[bytes, Tuple[bytes, Any]]` to `Dict[bytes, Tuple[str, Any]]`, and it caught my attention from diffing the local *.pyi files. The change is correct based on the assertion, so let's get pytype to check for this instead of relying on the assertion alone.
Wed, 10 Jul 2024 15:49:16 -0400 typing: add type hints to `mercurial/utils/resourceutil.py`
Matt Harbison <matt_harbison@yahoo.com> [Wed, 10 Jul 2024 15:49:16 -0400] rev 51669
typing: add type hints to `mercurial/utils/resourceutil.py` The `except` path requires byte args (because of the byte based manipulation in `_package_path()`), while the `else` case tolerates `AnyStr`. Pytype was unable to figure this out, and we should make sure the interface is the same for all environments.
Fri, 12 Jul 2024 15:29:35 +0400 copyright: update to 2024 stable
Anton Shestakov <av6@dwimlabs.net> [Fri, 12 Jul 2024 15:29:35 +0400] rev 51668
copyright: update to 2024
Mon, 08 Jul 2024 17:56:54 +0200 branching: merge stable into default for 6.9 cycle
Raphaël Gomès <rgomes@octobus.net> [Mon, 08 Jul 2024 17:56:54 +0200] rev 51666
branching: merge stable into default for 6.9 cycle
Mon, 08 Jul 2024 17:52:08 +0200 Added signature for changeset 11f41248595b stable
Raphaël Gomès <rgomes@octobus.net> [Mon, 08 Jul 2024 17:52:08 +0200] rev 51665
Added signature for changeset 11f41248595b
Mon, 08 Jul 2024 17:51:56 +0200 Added tag 6.8 for changeset 11f41248595b stable
Raphaël Gomès <rgomes@octobus.net> [Mon, 08 Jul 2024 17:51:56 +0200] rev 51664
Added tag 6.8 for changeset 11f41248595b
Mon, 08 Jul 2024 17:51:04 +0200 relnotes: add 6.8 stable 6.8
Raphaël Gomès <rgomes@octobus.net> [Mon, 08 Jul 2024 17:51:04 +0200] rev 51663
relnotes: add 6.8
Mon, 08 Jul 2024 16:44:07 +0200 test-check: don't report distutils as a local import stable
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 08 Jul 2024 16:44:07 +0200] rev 51662
test-check: don't report distutils as a local import On python 3.12 this is wrongly reported as a local import. So we adjust the checker to avoid it.
Mon, 08 Jul 2024 16:20:04 +0200 Backed out changeset f28c52a9f7b4 stable
Raphaël Gomès <rgomes@octobus.net> [Mon, 08 Jul 2024 16:20:04 +0200] rev 51661
Backed out changeset f28c52a9f7b4 This backout and the previous are due to a large performance regression detected in repositories with a lot of obsmarkers when performing a clone. A better fix will come along at the start of the next cycle.
Mon, 08 Jul 2024 16:19:33 +0200 Backed out changeset ff523675cd69 stable
Raphaël Gomès <rgomes@octobus.net> [Mon, 08 Jul 2024 16:19:33 +0200] rev 51660
Backed out changeset ff523675cd69
Mon, 08 Jul 2024 16:02:54 +0200 rust: use `cpython` 0.7.2 crate to add support for Python 3.12 stable
Raphaël Gomès <rgomes@octobus.net> [Mon, 08 Jul 2024 16:02:54 +0200] rev 51659
rust: use `cpython` 0.7.2 crate to add support for Python 3.12 This will give us more headroom until we can migrate to PyO3 some day.
Mon, 08 Jul 2024 15:52:01 +0200 revbranchcache: disable mmap access by default stable
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 08 Jul 2024 15:52:01 +0200] rev 51658
revbranchcache: disable mmap access by default The revbranchcache can be truncated (if some part of it is detected as invalid). Using mmap on file we truncate is not an option at access to truncated part would result in a SIGBUS signal. So we disable the mmap by default until we fix this issue.
Mon, 24 Jun 2024 18:54:59 +0200 portability: fix build on Solaris-derived systemd stable
Joerg Sonnenberger <joerg@bec.de> [Mon, 24 Jun 2024 18:54:59 +0200] rev 51657
portability: fix build on Solaris-derived systemd Current Illumos and older Solaris require _XOPEN_SOURCE for msg_control. O_DIRECTORY doesn't exist on older systems either, so fallback to O_RDONLY. It's good enough as a repository will require both R and X permission anyway.
Wed, 03 Jul 2024 12:32:57 +0200 mmap: only use mmap to read revlog persistent nodemap if it is safe stable
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 03 Jul 2024 12:32:57 +0200] rev 51656
mmap: only use mmap to read revlog persistent nodemap if it is safe Cf `is_mmap_safe` docstring.
Wed, 03 Jul 2024 12:47:08 +0200 mmap: fix another instance of reverse mmap logic in persistent nodemap stable
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 03 Jul 2024 12:47:08 +0200] rev 51655
mmap: fix another instance of reverse mmap logic in persistent nodemap This fix the same kind of issue as 85d96517e650
Wed, 03 Jul 2024 12:31:21 +0200 mmap: only use mmap to read rev-branch-cache data if it is safe stable
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 03 Jul 2024 12:31:21 +0200] rev 51654
mmap: only use mmap to read rev-branch-cache data if it is safe Cf `is_mmap_safe` docstring.
Wed, 03 Jul 2024 12:26:57 +0200 mmap: only use mmap to read revlog index if it is safe stable
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 03 Jul 2024 12:26:57 +0200] rev 51653
mmap: only use mmap to read revlog index if it is safe Cf `is_mmap_safe` docstring.
Wed, 03 Jul 2024 12:22:48 +0200 mmap: add a `is_mmap_safe` method to vfs stable
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 03 Jul 2024 12:22:48 +0200] rev 51652
mmap: add a `is_mmap_safe` method to vfs This will be useful to safeguard mmap usage to void SIGBUS when repositories lives on a NFS drive.
Mon, 24 Jun 2024 13:15:46 +0200 branching: merge stable into default
Raphaël Gomès <rgomes@octobus.net> [Mon, 24 Jun 2024 13:15:46 +0200] rev 51651
branching: merge stable into default
Mon, 24 Jun 2024 13:14:05 +0200 Added signature for changeset 6454c117c6a4 stable
Raphaël Gomès <rgomes@octobus.net> [Mon, 24 Jun 2024 13:14:05 +0200] rev 51650
Added signature for changeset 6454c117c6a4
Mon, 24 Jun 2024 13:14:04 +0200 Added tag 6.8rc0 for changeset 6454c117c6a4 stable
Raphaël Gomès <rgomes@octobus.net> [Mon, 24 Jun 2024 13:14:04 +0200] rev 51649
Added tag 6.8rc0 for changeset 6454c117c6a4
Mon, 24 Jun 2024 12:05:31 +0200 branching: merge default into stable for 6.8rc0 stable 6.8rc0
Raphaël Gomès <rgomes@octobus.net> [Mon, 24 Jun 2024 12:05:31 +0200] rev 51648
branching: merge default into stable for 6.8rc0
Mon, 24 Jun 2024 12:04:14 +0200 relnotes: add 6.8rc0
Raphaël Gomès <rgomes@octobus.net> [Mon, 24 Jun 2024 12:04:14 +0200] rev 51647
relnotes: add 6.8rc0
Mon, 24 Jun 2024 10:52:46 +0200 branch3: use an explicitely experimental name for files
Raphaël Gomès <rgomes@octobus.net> [Mon, 24 Jun 2024 10:52:46 +0200] rev 51646
branch3: use an explicitely experimental name for files Since this format is still experimental, we don't want to have to side-step the `branch3` name in case people do start using it before it's stable.
Mon, 24 Jun 2024 03:16:52 +0200 obsolete: simplify relevantmarker
Joerg Sonnenberger <joerg@bec.de> [Mon, 24 Jun 2024 03:16:52 +0200] rev 51645
obsolete: simplify relevantmarker Drop duplicate assignment from a merge failure. Save one loop iteration by exploiting that pendingnodes will be seennodes after the first round anyway, so just pre-initialize the set accordingly. From Anton Shestakov's review on !867. Performance difference for my test case is in the noise.
Tue, 11 Jun 2024 18:47:50 +0200 exchange: improve computation of relevant markers for large repos
Joerg Sonnenberger <joerg@bec.de> [Tue, 11 Jun 2024 18:47:50 +0200] rev 51644
exchange: improve computation of relevant markers for large repos Find the candidates for nodes with relevant markers by going over all markers instead of iterating over all nodes. Most nodes will not have markers anyway. Further optimize the code by allowing revsets as well, which reduces the materialization cost.
Thu, 13 Jun 2024 09:52:39 +0200 test: better glob some timing related line to avoid flakiness stable
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 13 Jun 2024 09:52:39 +0200] rev 51643
test: better glob some timing related line to avoid flakiness If we go over 10 seconds, the number of white space changes.
Wed, 12 Jun 2024 11:29:11 +0200 branching: merge stable into default
Raphaël Gomès <rgomes@octobus.net> [Wed, 12 Jun 2024 11:29:11 +0200] rev 51642
branching: merge stable into default
Wed, 12 Jun 2024 11:27:01 +0200 Added signature for changeset a1a011d4b148 stable
Raphaël Gomès <rgomes@octobus.net> [Wed, 12 Jun 2024 11:27:01 +0200] rev 51641
Added signature for changeset a1a011d4b148
Wed, 12 Jun 2024 11:26:57 +0200 Added tag 6.7.4 for changeset a1a011d4b148 stable
Raphaël Gomès <rgomes@octobus.net> [Wed, 12 Jun 2024 11:26:57 +0200] rev 51640
Added tag 6.7.4 for changeset a1a011d4b148
Wed, 12 Jun 2024 11:25:49 +0200 relnotes: add 6.7.4 and warn about 6.7.{1,2,3} stable 6.7.4
Raphaël Gomès <rgomes@octobus.net> [Wed, 12 Jun 2024 11:25:49 +0200] rev 51639
relnotes: add 6.7.4 and warn about 6.7.{1,2,3}
Wed, 12 Jun 2024 02:16:14 +0200 inline-changelog: fix pending transaction visibility when splitting stable
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 12 Jun 2024 02:16:14 +0200] rev 51638
inline-changelog: fix pending transaction visibility when splitting We move the name back to the expected name of `changelog.i.a`.
Wed, 12 Jun 2024 02:15:20 +0200 inline-changelog: fix a critical bug in write_pending that delete data stable
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 12 Jun 2024 02:15:20 +0200] rev 51637
inline-changelog: fix a critical bug in write_pending that delete data Since a93e52f0b6ff we no longer use inline-revlog for the changelog. The goal there was to solve the lack of testing for the two variants (inline vs split) and reduce the complexity of the interaction with "diverted-write" on the changelog level. However many existing repository still have inline-changelog and we automatically move them to normal revlog as soon as we have the chances. Unfortunately This conversion is buggy and can result in the destruction of the changelog.i if hook triggers the "write pending" mechanism. The bugs comes from the "revlog splitting" logic and the "write_pending" logic stepping over each other. Ironically the change in a93e52f0b6ff aims at no longer having this kind of problem. This changesets fix this issue and add associated tests. Fixing this reveal that the transaction hooks end up not seeing the pending transaction content, because the name is not right ("changelog.i.s.a" instead of "changelog.i.s") we fix this in the next changeset.
Tue, 11 Jun 2024 03:05:20 +0200 bookmark: fix remote bookmark deletion when the push is raced stable
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 11 Jun 2024 03:05:20 +0200] rev 51636
bookmark: fix remote bookmark deletion when the push is raced Before this patch, running `hg push -B book` to push the `book` bookmark sideway at the same time as a commit making it moving forward might result in the removal of the bookmark remotely. After this changeset, the push can still be raced, but to remove deletion happens. This is progress.
Tue, 11 Jun 2024 03:03:47 +0200 hooks: add a prewlock and a prelock hooks stable
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 11 Jun 2024 03:03:47 +0200] rev 51635
hooks: add a prewlock and a prelock hooks This is useful for testing.
Tue, 11 Jun 2024 11:14:13 +0200 exchange: fix locking to actually be scoped stable
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 11 Jun 2024 11:14:13 +0200] rev 51634
exchange: fix locking to actually be scoped The previous code was taking locks before entering with statements, so exception before the with statement would not release the lock (except for garbage collection). We need to move to a try except here because the logic is more complicated.
Tue, 11 Jun 2024 11:13:36 +0200 exchange: fix locking to actually be scoped stable
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 11 Jun 2024 11:13:36 +0200] rev 51633
exchange: fix locking to actually be scoped The previous code was taking locks before entering with statements, so exception before the with statement would not release the lock (except for garbage collection).
Wed, 06 Sep 2023 18:23:32 +0200 narrow: add a test for linkrev computation done during widen
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 06 Sep 2023 18:23:32 +0200] rev 51632
narrow: add a test for linkrev computation done during widen This new tests show that the linkrev computed and sent by the server might end up being wrong during a widen operation.
Mon, 10 Jun 2024 13:45:57 +0200 obsolete: quote the feature name
Joerg Sonnenberger <joerg@bec.de> [Mon, 10 Jun 2024 13:45:57 +0200] rev 51631
obsolete: quote the feature name This makes it at least somewhat clearer that hg is talking about some specific feature and not just outdated code.
Mon, 10 Jun 2024 12:12:56 +0200 branching: merge stable into default
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 10 Jun 2024 12:12:56 +0200] rev 51630
branching: merge stable into default
Mon, 10 Jun 2024 10:59:44 +0200 rust-status: sort the failed matches when printing them stable
Raphaël Gomès <rgomes@octobus.net> [Mon, 10 Jun 2024 10:59:44 +0200] rev 51629
rust-status: sort the failed matches when printing them This was making the tests flaky after the recent patch¹ that opened up more of the code to the Rust-augmented status. [1] 865efc020c3355dca1cbaa35db80600009c01dd5
Thu, 23 May 2024 11:05:11 +0200 clonebundles: add missing newline to legacy response
Julien Cristau <jcristau@mozilla.com> [Thu, 23 May 2024 11:05:11 +0200] rev 51628
clonebundles: add missing newline to legacy response This seems to have been removed in 6.5 (likely by 60f9602b413e).
Tue, 07 May 2024 15:15:41 +0400 chistedit: change action for the correct item stable
Anton Shestakov <av6@dwimlabs.net> [Tue, 07 May 2024 15:15:41 +0400] rev 51627
chistedit: change action for the correct item We have an experimental config histedit.later-commits-first from c820866c52f9, and when it's true, the order of commits in histedit UI is reversed, both in text mode and in curses mode. But before this patch key presses in curses mode would change histedit actions in the same old order, i.e. trying to edit the latest commit (which would be first now) would put "edit" action on the last commit in the list. This wasn't a cosmetic issue, histedit would actually proceed to edit the first commit in the list. Let's map rules to display items (hopefully now correctly).
Fri, 26 Apr 2024 19:10:35 +0100 dirstate: remove the python-side whitelist of allowed matchers
Arseniy Alekseyev <aalekseyev@janestreet.com> [Fri, 26 Apr 2024 19:10:35 +0100] rev 51626
dirstate: remove the python-side whitelist of allowed matchers This whitelist is too permissive because it allows matchers that contain disallowed ones deep inside, for example through `intersectionmatcher`. It is also too restrictive because it doesn't pass through some of the matchers we support, such as `patternmatcher`. It's also unnecessary because unsupported matchers raise `FallbackError` and we fall back anyway. Making this change makes more of the tests use rust code path, and therefore subtly change behavior. For example, rust status in largefiles repos seems to have strange behavior.
Fri, 26 Apr 2024 18:53:02 +0100 match: make `was_tampered_with` work recursively
Arseniy Alekseyev <aalekseyev@janestreet.com> [Fri, 26 Apr 2024 18:53:02 +0100] rev 51625
match: make `was_tampered_with` work recursively This is useful if we are to use it outside of Rust, when deciding whether or not to do some fast-path operation with a given matcher.
Fri, 26 Apr 2024 19:43:42 +0100 largefiles: mark more matchers as having been tampered with
Arseniy Alekseyev <aalekseyev@janestreet.com> [Fri, 26 Apr 2024 19:43:42 +0100] rev 51624
largefiles: mark more matchers as having been tampered with These happened to slip through the cracks earlier because they weren't caught by tests. Now that we're enabling rust fast path more widely these start breaking.
Mon, 06 May 2024 18:50:21 +0200 branching: merge stable into default
Raphaël Gomès <rgomes@octobus.net> [Mon, 06 May 2024 18:50:21 +0200] rev 51623
branching: merge stable into default
Mon, 06 May 2024 18:48:37 +0200 Added signature for changeset 028dc3f92dbd stable
Raphaël Gomès <rgomes@octobus.net> [Mon, 06 May 2024 18:48:37 +0200] rev 51622
Added signature for changeset 028dc3f92dbd
Mon, 06 May 2024 18:48:34 +0200 Added tag 6.7.3 for changeset 028dc3f92dbd stable
Raphaël Gomès <rgomes@octobus.net> [Mon, 06 May 2024 18:48:34 +0200] rev 51621
Added tag 6.7.3 for changeset 028dc3f92dbd
Mon, 06 May 2024 17:51:21 +0200 relnotes: add 6.7.3 stable 6.7.3
Raphaël Gomès <rgomes@octobus.net> [Mon, 06 May 2024 17:51:21 +0200] rev 51620
relnotes: add 6.7.3
Mon, 22 Apr 2024 19:47:08 +0200 rust: blanket implementation of Graph for Graph references stable
Georges Racinet <georges.racinet@octobus.net> [Mon, 22 Apr 2024 19:47:08 +0200] rev 51619
rust: blanket implementation of Graph for Graph references The need comes from the fact that `AncestorsIterator` and many Graph-related algorithms take ownership of the `Graph` they work with. This, in turn is due to them needing to accept the `Index` instances that are provided by the Python layers (that neither rhg nor `RHGitaly` use, of course): the fact that nowadays the Python layer holds an object that is itself implemented in Rust does not change the core problem that they cannot be tracked by the borrow checker. Even though it looks like cloning `Changelog` would be cheap, it seems hard to guarantee that on the long run. The object is already too rich for us to be comfortable with it, when using references is the most natural and guaranteed way of proceeding. The added test seems a bit superfleous, but it will act as a reminder that this feature is really useful until something in the Mercurial code base actually uses it.
Mon, 06 May 2024 15:30:21 +0200 rust-cpython: don't swallow the dirstate error message stable
Raphaël Gomès <rgomes@octobus.net> [Mon, 06 May 2024 15:30:21 +0200] rev 51618
rust-cpython: don't swallow the dirstate error message In case we do get a dirstate error, we want to get the full error message and not just an opaque `Dirstate error`.
Mon, 06 May 2024 13:07:02 +0200 dirstate-v2: check that root nodes are at the root before writing stable
Raphaël Gomès <rgomes@octobus.net> [Mon, 06 May 2024 13:07:02 +0200] rev 51617
dirstate-v2: check that root nodes are at the root before writing More explanations in the previous changeset.
Mon, 06 May 2024 13:02:52 +0200 dirstate-v2: add check of parent/child nodes being related when writing stable
Raphaël Gomès <rgomes@octobus.net> [Mon, 06 May 2024 13:02:52 +0200] rev 51616
dirstate-v2: add check of parent/child nodes being related when writing This stems from a corruption seen in a private repository. We're not sure of the source of the corruption, and it's very possible that we're seeing compounded effects of multiple writes on a corrupted dirstate. Adding this check is not expensive in itself and large writes of the dirstate are not common. This change does not catch this problem at the root node, the next one will.
Mon, 06 May 2024 16:29:00 +0200 admin-verify: expect a number of errors to be returned stable
Raphaël Gomès <rgomes@octobus.net> [Mon, 06 May 2024 16:29:00 +0200] rev 51615
admin-verify: expect a number of errors to be returned It's the responsibility of the check to handle errors, we only care about the total count to sum up the check's work. We use `admin::verify -c dirstate` to test this path at least somewhat.
Mon, 06 May 2024 16:16:15 +0200 admin-verify: fix error message handling stable
Raphaël Gomès <rgomes@octobus.net> [Mon, 06 May 2024 16:16:15 +0200] rev 51614
admin-verify: fix error message handling `dirstate.verify` used to return tuples but does not anymore, it returns the pre-formatted error message, which is a nicer interface anyway.
Mon, 06 May 2024 12:31:29 +0200 admin-verify: pass p1 down to the dirstate function stable
Raphaël Gomès <rgomes@octobus.net> [Mon, 06 May 2024 12:31:29 +0200] rev 51613
admin-verify: pass p1 down to the dirstate function This was forgotten and can break with certain kinds of corruption.
Mon, 06 May 2024 11:27:29 +0200 Backed out changeset 3e0f86f09f26 stable
Raphaël Gomès <rgomes@octobus.net> [Mon, 06 May 2024 11:27:29 +0200] rev 51612
Backed out changeset 3e0f86f09f26
Mon, 06 May 2024 11:26:52 +0200 Backed out changeset fc317bd5b637 stable
Raphaël Gomès <rgomes@octobus.net> [Mon, 06 May 2024 11:26:52 +0200] rev 51611
Backed out changeset fc317bd5b637
Thu, 02 May 2024 02:20:42 +0200 re2: make errors quiet stable
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 02 May 2024 02:20:42 +0200] rev 51610
re2: make errors quiet By default, the re2 library will output error on its own instead of keeping the error in an exception. This make re2 printing spurious error before fallback to the stdlib remodule that may accept the pattern or also fails to parse it and raise a proper error that will be handled by Mercurial. So we also pass an Option object that changes this default.
Thu, 02 May 2024 08:46:58 +0200 fold-or-prune-me: update proposal stable
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 02 May 2024 08:46:58 +0200] rev 51609
fold-or-prune-me: update proposal This does the same things but with a narrower wrapping.
Sun, 31 Mar 2024 17:57:46 -0300 subrepo: propagate non-default path on outgoing stable
Felipe Resende <felipe@fcresende.dev.br> [Sun, 31 Mar 2024 17:57:46 -0300] rev 51608
subrepo: propagate non-default path on outgoing There was already a fix made in 5dbff89cf107 for pull and push commands. I did the same for the outgoing command. The problem I identified is that when the parent repository has multiple paths, the outgoing command was not respecting the parent path used and was always using the default path for subrepositories.
Tue, 26 Mar 2024 01:27:27 -0400 hgrc: search XDG_CONFIG_HOME on mac
Hraban Luyat <hraban@0brg.net> [Tue, 26 Mar 2024 01:27:27 -0400] rev 51607
hgrc: search XDG_CONFIG_HOME on mac Searching for hgrc was special cased not to look through ~/.config/hg on Mac, but that’s unnecessary: Macs support it as do other unix based systems. There are plenty tools that use it there, e.g. git, and people expect it to work, e.g. "https://stackoverflow.com/questions/72499837/mercurial-on-macos-doesnt-read-config-hg-hgrc". Initial code introduced in 354020079723.
Tue, 16 Apr 2024 09:51:11 +0200 base-revsets: use an author that actually exercises a lot of changesets
Raphaël Gomès <rgomes@octobus.net> [Tue, 16 Apr 2024 09:51:11 +0200] rev 51606
base-revsets: use an author that actually exercises a lot of changesets This was caught in my big find-and-replace: d4ba4d51f85f. The point of `base-revsets` is to give revsets that will give a good coverage of the repository. Using Pierre-Yves as the second largest committer (in terms of number of changesets) seems like a good idea.
Tue, 16 Apr 2024 17:21:37 +0100 match: simplify the rust-side file pattern kind parsing
Arseniy Alekseyev <aalekseyev@janestreet.com> [Tue, 16 Apr 2024 17:21:37 +0100] rev 51605
match: simplify the rust-side file pattern kind parsing There's no need to add the ':' characters if we're simply pattern matching against constants next.
Tue, 16 Apr 2024 13:51:45 +0100 match: share code between includematcher and patternmatcher
Arseniy Alekseyev <aalekseyev@janestreet.com> [Tue, 16 Apr 2024 13:51:45 +0100] rev 51604
match: share code between includematcher and patternmatcher No need to have this duplication.
Fri, 05 Apr 2024 17:57:26 +0100 matchers: support patternmatcher in rust
Arseniy Alekseyev <aalekseyev@janestreet.com> [Fri, 05 Apr 2024 17:57:26 +0100] rev 51603
matchers: support patternmatcher in rust
Tue, 09 Apr 2024 11:12:24 +0100 match: avoid rust fast path if the matcher was tampered with
Arseniy Alekseyev <aalekseyev@janestreet.com> [Tue, 09 Apr 2024 11:12:24 +0100] rev 51602
match: avoid rust fast path if the matcher was tampered with Otherwise the fast path does not respect the modifications made by the extension (concretely largefiles, but other extensions can start using that too)
Tue, 09 Apr 2024 11:00:52 +0100 largefiles: track if a matcher was tampered with
Arseniy Alekseyev <aalekseyev@janestreet.com> [Tue, 09 Apr 2024 11:00:52 +0100] rev 51601
largefiles: track if a matcher was tampered with This is used to make sure rust fast path is not taken for the modified matchers.
Wed, 17 Apr 2024 12:28:48 +0200 branching: merge stable into default
Raphaël Gomès <rgomes@octobus.net> [Wed, 17 Apr 2024 12:28:48 +0200] rev 51600
branching: merge stable into default
Wed, 13 Mar 2024 12:02:06 +0100 tags-cache: directly perform a monimal walk for hgtagsfnodescache warming
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 13 Mar 2024 12:02:06 +0100] rev 51599
tags-cache: directly perform a monimal walk for hgtagsfnodescache warming We do something narrower than the path retrieving data. So lets use dedicated code instead. This provides further useful speedup: ### data-env-vars.name = mozilla-try-2023-03-22-zstd-sparse-revlog # benchmark.name = hg.debug.debug-update-cache # bin-env-vars.hg.flavor = default # bin-env-vars.hg.py-re2-module = default # benchmark.variants.pre-state = warm before-this-series: 19.947581 skip-fnode-filter: 18.916804 (-5.17%, -1.03) use-rev-num: 17.493725 (-12.30%, -2.45) this-changesets: 15.919466 (-20.19%, -4.03)
Wed, 13 Mar 2024 11:51:11 +0100 tags-cache: directly operate on rev-num warming hgtagsfnodescache
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 13 Mar 2024 11:51:11 +0100] rev 51598
tags-cache: directly operate on rev-num warming hgtagsfnodescache Not having to goes through nodeid speed up things notably. ### data-env-vars.name = mozilla-try-2023-03-22-zstd-sparse-revlog # benchmark.name = hg.debug.debug-update-cache # bin-env-vars.hg.flavor = default # bin-env-vars.hg.py-re2-module = default # benchmark.variants.pre-state = warm before-this-series: 19.947581 before-this-changes: 18.916804 (-5.17%, -1.03) this-changesets: 17.493725 (-12.30%, -2.45)
Wed, 13 Mar 2024 11:38:28 +0100 tags-cache: skip the filternode step if we are not going to use it
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 13 Mar 2024 11:38:28 +0100] rev 51597
tags-cache: skip the filternode step if we are not going to use it When warming the hgtagsfnodescache, we don't need the actual result, so we can simply skip the part that "filter" fnode we read from the cache. So provide a quite visible speed up to the top level `hg debugupdatecache` function. ### data-env-vars.name = mozilla-try-2023-03-22-zstd-sparse-revlog # benchmark.name = hg.debug.debug-update-cache # bin-env-vars.hg.flavor = default # bin-env-vars.hg.py-re2-module = default # benchmark.variants.pre-state = warm before: 19.947581 after: 18.916804 (-5.17%, -1.03)
Wed, 13 Mar 2024 11:34:21 +0100 tags-cache: add a dedicated warm cache function to hgtagsfnodescache
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 13 Mar 2024 11:34:21 +0100] rev 51596
tags-cache: add a dedicated warm cache function to hgtagsfnodescache Having a dedicated API point will help to optimize that specific usage. Right doing a full phases weam takes a long time, even when the cache is already filled.
Tue, 09 Apr 2024 22:37:15 +0200 outgoing: add a simple fastpath when there is no common
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 09 Apr 2024 22:37:15 +0200] rev 51595
outgoing: add a simple fastpath when there is no common This further speed up case like `hg bundle --all` for larger repository. ### data-env-vars.name = mozilla-try-2023-03-22-zstd-sparse-revlog # benchmark.name = hg.command.bundle # bin-env-vars.hg.flavor = default # bin-env-vars.hg.py-re2-module = default # benchmark.variants.revs = all # benchmark.variants.type = none-streamv2 before: 316.749699 after: 311.165461 (-1.76%, -5.58) There is further work to be done in this area like not doing any outgoing computation in the stream case for example. however the recent changes already gives use a large win for a small amount of local work. ### benchmark.name = hg.command.bundle # bin-env-vars.hg.flavor = default # bin-env-vars.hg.py-re2-module = default # benchmark.variants.revs = all # benchmark.variants.type = none-streamv2 ## data-env-vars.name = mercurial-public-2024-03-22-zstd-sparse-revlog pre-%ln-change: 1.263859 the-%ln-change: 0.700229 (-44.60%, -0.56) prev-changeset: 0.496050 (-60.75%, -0.77) this-changeset: 0.495243 (-60.81%, -0.77) ## data-env-vars.name = tryton-public-2024-03-22-zstd-sparse-revlog pre-%ln-change: 2.975765 the-%ln-change: 1.870798 (-37.13%, -1.10) prev-changeset: 1.461583 (-50.88%, -1.51) this-changeset: 1.469185 (-50.63%, -1.51) ## data-env-vars.name = pypy-2024-03-22-zstd-sparse-revlog pre-%ln-change: 4.540080 the-%ln-change: 3.401700 (-25.07%, -1.14) prev-changeset: 2.915810 (-35.78%, -1.62) this-changeset: 2.911643 (-35.87%, -1.63) ## data-env-vars.name = heptapod-public-2024-03-25-zstd-sparse-revlog pre-%ln-change: 10.138396 the-%ln-change: 7.750458 (-23.55%, -2.39) prev-changeset: 6.665565 (-34.25%, -3.47) this-changeset: 6.672078 (-34.19%, -3.47) ## data-env-vars.name = mozilla-try-2023-03-22-zstd-sparse-revlog pre-%ln-change: 399.484481 the-%ln-change: 346.508952 (-13.26%, -52.98) prev-changeset: 316.749699 (-20.71%, -82.73) this-changeset: 311.165461 (-22.11%, -88.32)
Tue, 09 Apr 2024 22:36:35 +0200 outgoing: rework the handling of the `missingroots` case to be faster
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 09 Apr 2024 22:36:35 +0200] rev 51594
outgoing: rework the handling of the `missingroots` case to be faster The previous implementation was slow, to the point it was taking a significant amount of `hg bundle --type none-streamv2` call. We rework the code to compute the same value much faster, making the operation disappear from the `hg bundle --type none-streamv2` profile. Someone would remark that producing a streamclone does not requires an `outgoing` object. However that is a matter for another day. There is other user of `missingroots` (non stream `hg bundle` call for example), and they will also benefit from this rework. We implement an old TODO in the process, directly computing the missing and common attribute as we have most element at hand already. ### benchmark.name = hg.command.bundle # bin-env-vars.hg.flavor = default # bin-env-vars.hg.py-re2-module = default # benchmark.variants.revs = all # benchmark.variants.type = none-streamv2 ## data-env-vars.name = heptapod-public-2024-03-25-zstd-sparse-revlog before: 7.750458 after: 6.665565 (-14.00%, -1.08) ## data-env-vars.name = mercurial-public-2024-03-22-zstd-sparse-revlog before: 0.700229 after: 0.496050 (-29.16%, -0.20) ## data-env-vars.name = mozilla-try-2023-03-22-zstd-sparse-revlog before: 346.508952 after: 316.749699 (-8.59%, -29.76) ## data-env-vars.name = pypy-2024-03-22-zstd-sparse-revlog before: 3.401700 after: 2.915810 (-14.28%, -0.49) ## data-env-vars.name = tryton-public-2024-03-22-zstd-sparse-revlog before: 1.870798 after: 1.461583 (-21.87%, -0.41) note: this whole `missingroots` of outgoing has a limited number of callers and could likely be replace by something simpler (like taking an explicit "missing_revs" set for example). However this is a wider change and we focus on a small impact, quick rework that does not change the API for now.
Sun, 14 Apr 2024 02:27:10 +0200 proxy-vfs: also proxy the `audit` attribute
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 14 Apr 2024 02:27:10 +0200] rev 51593
proxy-vfs: also proxy the `audit` attribute In the previous changeset, we had to do a little dance to access the useful `audit` attribute. We now provide a proper accessors to it. We don't update the code in `perf.py` because it has to remain compatible with older version of Mercurial. This will just be nicer in the future.
Sat, 13 Apr 2024 23:40:28 +0200 perf: clear vfs audit_cache before each run
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 13 Apr 2024 23:40:28 +0200] rev 51592
perf: clear vfs audit_cache before each run When generating a stream clone, we spend a large amount of time auditing path. Before this changes, the first run was warming the vfs cache for the other runs, leading to a large runtime difference and a "faulty" reported timing for the operation. We now clear this important cache between run to get a more realistic timing. Below are some example of median time change when clearing these cases. The maximum time for a run did not changed significantly. ### data-env-vars.name = mozilla-central-2018-08-01-zstd-sparse-revlog # benchmark.name = hg.perf.exchange.stream.generate # bin-env-vars.hg.flavor = default # bin-env-vars.hg.py-re2-module = default # benchmark.variants.version = latest no-clearing: 17.289905 cache-clearing: 21.587965 (+24.86%, +4.30) ## data-env-vars.name = mozilla-central-2024-03-22-zstd-sparse-revlog no-clearing: 32.670748 cache-clearing: 40.467095 (+23.86%, +7.80) ## data-env-vars.name = mozilla-try-2019-02-18-zstd-sparse-revlog no-clearing: 37.838858 cache-clearing: 46.072749 (+21.76%, +8.23) ## data-env-vars.name = mozilla-unified-2024-03-22-zstd-sparse-revlog no-clearing: 32.969395 cache-clearing: 39.646209 (+20.25%, +6.68) In addition, this significantly reduce the timing difference between the performance command, from the perf extensions and a `real `hg bundle` call producing a stream bundle. Some significant differences remain especially on the "mozilla-try" repositories, but they are now smaller. Note that some of that difference will actually not be attributable to the stream generation (like maybe phases or branch map computation). Below are some benchmarks done on a currently draft changeset fixing some unrelated slowness in `hg bundle` (34a78972af409d1ff37c29e60f6ca811ad1a457d) ### data-env-vars.name = mozilla-central-2018-08-01-zstd-sparse-revlog # bin-env-vars.hg.flavor = default # bin-env-vars.hg.py-re2-module = default hg.perf.exchange.stream.generate: 21.587965 hg.command.bundle: 24.301799 (+12.57%, +2.71) ## data-env-vars.name = mozilla-central-2024-03-22-zstd-sparse-revlog hg.perf.exchange.stream.generate: 40.467095 hg.command.bundle: 44.831317 (+10.78%, +4.36) ## data-env-vars.name = mozilla-unified-2024-03-22-zstd-sparse-revlog hg.perf.exchange.stream.generate: 39.646209 hg.command.bundle: 45.395258 (+14.50%, +5.75) ## data-env-vars.name = mozilla-try-2019-02-18-zstd-sparse-revlog hg.perf.exchange.stream.generate: 46.072749 hg.command.bundle: 55.882608 (+21.29%, +9.81) ## data-env-vars.name = mozilla-try-2023-03-22-zlib-general-delta hg.perf.exchange.stream.generate: 334.716708 hg.command.bundle: 377.856767 (+12.89%, +43.14) ## data-env-vars.name = mozilla-try-2023-03-22-zstd-sparse-revlog hg.perf.exchange.stream.generate: 302.972301 hg.command.bundle: 326.098755 (+7.63%, +23.13)
Sun, 14 Apr 2024 02:41:36 +0200 perf: start recording total time after warming
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 14 Apr 2024 02:41:36 +0200] rev 51591
perf: start recording total time after warming The warming might be costly and this should not affect the "time profile" of the actual collection.
Sun, 14 Apr 2024 02:40:15 +0200 perf: run the gc before each run
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 14 Apr 2024 02:40:15 +0200] rev 51590
perf: run the gc before each run The python garbage collector is a large source of performance troubles, we run it right before the timed section to reduce the change for the gc to add noise to the benchmark.
Sun, 14 Apr 2024 02:38:41 +0200 perf: allow profiling of more than one run
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 14 Apr 2024 02:38:41 +0200] rev 51589
perf: allow profiling of more than one run By default, we still profile the first run only. However profiling more run help to understand side effect from one run to the other. So we add an option to be able to do so.
Sun, 14 Apr 2024 02:36:55 +0200 profiler: flush after writing the profiler output
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 14 Apr 2024 02:36:55 +0200] rev 51588
profiler: flush after writing the profiler output Otherwise, the profiler output might only partially appears until the next flush of the buffer. Since profiling often happens for long operation, the next flush can be a long time away.
Sun, 14 Apr 2024 02:33:36 +0200 stream-clone: disable gc for the entry listing section for the v2 format
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 14 Apr 2024 02:33:36 +0200] rev 51587
stream-clone: disable gc for the entry listing section for the v2 format This is similar to the change we did for the v3 format in 6e4c8366c5ce. The benchmark bellow show this gives us a notable gains, especially on larger repositories. ### benchmark.name = hg.perf.stream-locked-section # benchmark.name = hg.perf.stream-locked-section # bin-env-vars.hg.flavor = default # bin-env-vars.hg.py-re2-module = default # benchmark.variants.version = v2 ## data-env-vars.name = pypy-2018-08-01-zstd-sparse-revlog 5e931bf8707c: 0.503820 ~~~~~ 1106d1bf695e: 0.470078 (-6.70%, -0.03) ## data-env-vars.name = pypy-2024-03-22-zstd-sparse-revlog 5e931bf8707c: 0.535756 ~~~~~ 1106d1bf695e: 0.490249 (-8.49%, -0.05) ## data-env-vars.name = heptapod-public-2024-03-25-zstd-sparse-revlog 5e931bf8707c: 1.327041 ~~~~~ 1106d1bf695e: 1.174636 (-11.48%, -0.15) ## data-env-vars.name = netbeans-2018-08-01-zstd-sparse-revlog 5e931bf8707c: 2.439158 ~~~~~ 1106d1bf695e: 2.220515 (-8.96%, -0.22) ## data-env-vars.name = netbeans-2019-11-07-zstd-sparse-revlog 5e931bf8707c: 2.630794 ~~~~~ 1106d1bf695e: 2.261473 (-14.04%, -0.37) ## data-env-vars.name = mozilla-central-2018-08-01-zstd-sparse-revlog 5e931bf8707c: 5.769002 ~~~~~ 1106d1bf695e: 5.062000 (-12.26%, -0.71) ## data-env-vars.name = mozilla-try-2019-02-18-zstd-sparse-revlog 5e931bf8707c: 13.351750 ~~~~~ 1106d1bf695e: 12.346655 (-7.53%, -1.01) ## data-env-vars.name = mozilla-central-2024-03-22-zstd-sparse-revlog 5e931bf8707c: 10.772939 ~~~~~ 1106d1bf695e: 9.495407 (-11.86%, -1.28) ## data-env-vars.name = mozilla-unified-2024-03-22-zstd-sparse-revlog 5e931bf8707c: 10.864297 ~~~~~ 1106d1bf695e: 9.475597 (-12.78%, -1.39) ## data-env-vars.name = mozilla-try-2023-03-22-zstd-sparse-revlog 5e931bf8707c: 17.448335 ~~~~~ 1106d1bf695e: 16.027474 (-8.14%, -1.42)
Tue, 09 Apr 2024 02:54:19 +0200 phases: rework the logic of _pushdiscoveryphase to bound complexity
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 09 Apr 2024 02:54:19 +0200] rev 51586
phases: rework the logic of _pushdiscoveryphase to bound complexity This rework the various graph traversal in _pushdiscoveryphase to keep the complexity in check. This is done though a couple of things: - first, limiting the space we have to explore, for example, if we are not in publishing push, we don't need to consider remote draft roots that are also draft locally, as there is nothing to be moved there. - avoid unbounded descendant computation, and use the faster "rev between" computation. This provide a massive boost to performance when exchanging with repository with a massive amount of draft, like mozilla-try: ### data-env-vars.name = mozilla-try-2023-03-22-zstd-sparse-revlog # benchmark.name = hg.command.push # bin-env-vars.hg.flavor = default # bin-env-vars.hg.py-re2-module = default # benchmark.variants.explicit-rev = all-out-heads # benchmark.variants.issue6528 = disabled # benchmark.variants.protocol = ssh # benchmark.variants.reuse-external-delta-parent = default ## benchmark.variants.revs = any-1-extra-rev before: 20.346590 seconds after: 11.232059 seconds (-38.15%, -7.48 seconds) ## benchmark.variants.revs = any-100-extra-rev before: 24.752051 seconds after: 15.367412 seconds (-37.91%, -9.38 seconds) After this changes, the push operation is still quite too slow. Some of this can be attributed to general phases slowness (reading all the roots from disk for example) and other know slowness (not using persistent-nodemap, branchmap, tags, etc. We are also working on them, but with this series, phase discovery during push no longer showing up in profile and this is a pretty nice and bit low-hanging fruit out of the way. ### (same case as the above) # benchmark.variants.revs = any-1-extra-rev pre-%ln-change: 44.235070 this-changeset: 11.232059 seconds (-74.61%, -33.00 seconds) # benchmark.variants.revs = any-100-extra-rev pre-%ln-change: 49.234697 this-changeset: 15.367412 seconds (-68.79%, -33.87 seconds) Note that with this change, the `hg push` performance is now much closer to the `hg pull` performance, even it still lagging behind a bit. (and the overall performance are still too slow). ### data-env-vars.name = mozilla-try-2023-03-22-ds2-pnm # benchmark.variants.explicit-rev = all-out-heads # benchmark.variants.issue6528 = disabled # benchmark.variants.protocol = ssh # benchmark.variants.pulled-delta-reuse-policy = default # bin-env-vars.hg.flavor = rust ## benchmark.variants.revs = any-1-extra-rev hg.command.pull: 6.517450 hg.command.push: 11.219888 ## benchmark.variants.revs = any-100-extra-rev hg.command.pull: 10.160991 hg.command.push: 14.251107 ### data-env-vars.name = mozilla-try-2023-03-22-zstd-sparse-revlog # bin-env-vars.hg.py-re2-module = default # benchmark.variants.explicit-rev = all-out-heads # benchmark.variants.issue6528 = disabled # benchmark.variants.protocol = ssh # benchmark.variants.pulled-delta-reuse-policy = default ## bin-env-vars.hg.flavor = default ## benchmark.variants.revs = any-1-extra-rev hg.command.pull: 8.577772 hg.command.push: 11.232059 ## bin-env-vars.hg.flavor = default ## benchmark.variants.revs = any-100-extra-rev hg.command.pull: 13.152976 hg.command.push: 15.367412 ## bin-env-vars.hg.flavor = rust ## benchmark.variants.revs = any-1-extra-rev hg.command.pull: 8.731982 hg.command.push: 11.178751 ## bin-env-vars.hg.flavor = rust ## benchmark.variants.revs = any-100-extra-rev hg.command.pull: 13.184236 hg.command.push: 15.620843
Fri, 05 Apr 2024 22:47:44 +0200 phases: introduce a performant efficient way to access revision in a set
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 05 Apr 2024 22:47:44 +0200] rev 51585
phases: introduce a performant efficient way to access revision in a set This will be useful in the next changesets.
Fri, 05 Apr 2024 14:13:47 +0200 phases: use revision number in `_pushdiscoveryphase`
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 05 Apr 2024 14:13:47 +0200] rev 51584
phases: use revision number in `_pushdiscoveryphase` We now reach our target checkpoint in terms of rev-num conversion. The `_pushdiscoveryphase` function is now performing graph computation based on revision number only. Avoiding repeated conversion from node-id to rev-num. See previous changeset updated `new_heads` for rationnal. Again, time saved in the 100 milliseconds order of magnitude for the mozilla-try benchmark I have been using. However, wow that the logic is done using revision number, we can look into having better logic in the next changesets, which will provide a much bigger speedup.
Fri, 05 Apr 2024 14:11:02 +0200 phases: move RemotePhasesSummary to revision number
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 05 Apr 2024 14:11:02 +0200] rev 51583
phases: move RemotePhasesSummary to revision number This continue our quest to align more logic on revision number instead of node-ids. The motivation is similar to the change to `new_heads` and `analyze_remote_phases` a few changeset earlier. Again, we take this as an opportunity to rename the class, and the attribute to the new naming scheme. This will highlight the need for code update for any code using it an expecting node-ids. Many of the rev-num → node-id conversion we had to introduce in the previous changesets can now be removed. More will be removed in the future as we continue to align code toward rev-num usage. time saved in the 100 milliseconds order of magnitude for the mozilla-try benchmark I have been using.
Fri, 05 Apr 2024 12:24:47 +0200 phases: stop using `repo.set` in `remotephasessummary`
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 05 Apr 2024 12:24:47 +0200] rev 51582
phases: stop using `repo.set` in `remotephasessummary` The `repository.set` create changectx on the fly, an expensive operation. Using `repo.revs` and a direct rev-num → node-id translation will be significantly faster. This is especially true as we prepare ourself to no longer do the rev-num → node-id transalation there. The speedup is a bit lost in the overall noisyness of the slow phase discovery algorithm, but it save a small amount of time in my benchmark.
Fri, 05 Apr 2024 12:02:43 +0200 phases: use revision number in analyze_remote_phases
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 05 Apr 2024 12:02:43 +0200] rev 51581
phases: use revision number in analyze_remote_phases Same logic as the previous change to `new_heads`, see rationnal there. This avoids a small number of `nodes -> revs` conversion speeding thing up in the 100 milliseconds order of magnitude for the worses cases. However, the rest of the logic is noisy enough that it hardly matters for now.
Fri, 05 Apr 2024 11:33:47 +0200 phases: use revision number in new_heads
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 05 Apr 2024 11:33:47 +0200] rev 51580
phases: use revision number in new_heads All graph operations will be done using revision numbers, so passing nodes only means they will eventually get converted to revision numbers internally. As part of an effort to align the code on using revision number we make the `phases.newheads` function operated on revision number, taking them as input and using them in returns, instead of the node-id it used to consume and produce. This is part of multiple changesets effort to translate more part of the logic, but is done step by step to facilitate the identification of issue that might arise in mercurial core and extensions. To make the change simpler to handle for third party extensions, we also rename the function, using a more modern form. This will help detecting the different between the node-id version and the rev-num version. I also take this as an opportunity to add some comment about possible performance improvement for the future. They don't matter too much now, but they are worse exploring in a while.
Mon, 08 Apr 2024 15:11:49 +0200 phases: convert remote phase root to node while reading them
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 08 Apr 2024 15:11:49 +0200] rev 51579
phases: convert remote phase root to node while reading them This is currently a bit silly as we will convert them back to node right after, but that is an intermediate step before doing more disruptive changes.
Fri, 05 Apr 2024 11:17:25 +0200 phases: more compact error handling in analyzeremotephases
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 05 Apr 2024 11:17:25 +0200] rev 51578
phases: more compact error handling in analyzeremotephases using an intermediate variable result in more readable code, so let us use it.
Tue, 09 Apr 2024 02:54:12 +0200 push: rework the computation of fallbackheads to be correct
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 09 Apr 2024 02:54:12 +0200] rev 51577
push: rework the computation of fallbackheads to be correct The previous computation tried to be smart but ended up being wrong. This was caught by phase movement test while reworking the phase discovery logic to be faster. The previous logic was failing to catch case where the pushed set was not based on a common heads (i.e. when the discovery seemed to have "over discovered" content, outside the pushed set) In the following graph, `e` is a common head and we `hg push -r f`. We need to detect `c` as a fallback heads and we previous failed to do so:: e | d f |/ c | b | a The performance impact of the change seems minimal. On the most impacted repository at hand (mozilla-try), the slowdown seems mostly mixed in the overall noise `hg push` but seems to be in the hundred of milliseconds order of magnitude. When using rust, we seems to be a bit faster, probably because we leverage more accelaratd internals. I added a couple of performance related common for further investigation later on.
Fri, 05 Apr 2024 11:05:54 +0200 revset: stop serializing node when using "%ln"
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 05 Apr 2024 11:05:54 +0200] rev 51576
revset: stop serializing node when using "%ln" Turning hundred of thousand of node from node to hex and back can be slow… what about we stop doing it? In many case were we are using node id we should be using revision id. However this is not a good reason to have a stupidly slow implementation of "%ln". This caught my attention again because the phase discovery during push make an extensive use of "%ln" or huge set. In absolute, that phase discovery probably should use "%ld" and need to improves its algorithmic complexity, but improving "%ln" seems simple and long overdue. This greatly speeds up `hg push` on repository with many drafts. Here are some relevant poulpe benchmarks: ### data-env-vars.name = mozilla-try-2023-03-22-zstd-sparse-revlog # benchmark.name = hg.command.push # bin-env-vars.hg.flavor = default # bin-env-vars.hg.py-re2-module = default # benchmark.variants.explicit-rev = all-out-heads # benchmark.variants.issue6528 = disabled # benchmark.variants.protocol = ssh # benchmark.variants.reuse-external-delta-parent = default ## benchmark.variants.revs = any-1-extra-rev before: 44.235070 after: 20.416329 (-53.85%, -23.82) ## benchmark.variants.revs = any-100-extra-rev before: 49.234697 after: 26.519829 (-46.14%, -22.71) ### benchmark.name = hg.command.bundle # bin-env-vars.hg.flavor = default # bin-env-vars.hg.py-re2-module = default # benchmark.variants.revs = all # benchmark.variants.type = none-streamv2 ## data-env-vars.name = heptapod-public-2024-03-25-zstd-sparse-revlog before: 10.138396 after: 7.750458 (-23.55%, -2.39) ## data-env-vars.name = mercurial-public-2024-03-22-zstd-sparse-revlog before: 1.263859 after: 0.700229 (-44.60%, -0.56) ## data-env-vars.name = mozilla-try-2023-03-22-zstd-sparse-revlog before: 399.484481 after: 346.5089 (-13.26%, -52.98) ## data-env-vars.name = pypy-2024-03-22-zstd-sparse-revlog before: 4.540080 after: 3.401700 (-25.07%, -1.14) ## data-env-vars.name = tryton-public-2024-03-22-zstd-sparse-revlog before: 2.975765 after: 1.870798 (-37.13%, -1.10)
Tue, 09 Apr 2024 14:41:48 +0200 bundlespec: drop unused _bundlespecvariants dictionary
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 09 Apr 2024 14:41:48 +0200] rev 51575
bundlespec: drop unused _bundlespecvariants dictionary Why do we have a `_bundlespecvariants`?
Tue, 09 Apr 2024 14:37:24 +0200 bundlespec: type the _bundlespeccontentopts dictionary
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 09 Apr 2024 14:37:24 +0200] rev 51574
bundlespec: type the _bundlespeccontentopts dictionary If only we had a tool to detect the kind of stupid error we just fixed… ho wait.
Tue, 09 Apr 2024 14:36:01 +0200 bundlespec: fix the "streamv2" and "streamv3-exp" variant
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 09 Apr 2024 14:36:01 +0200] rev 51573
bundlespec: fix the "streamv2" and "streamv3-exp" variant In c4aab3661f25, we broken this feature by adding unicode instead of bytes to the dictionary. On the other hand, this feature was never tested, so augment the tests to tests this.
Thu, 04 Apr 2024 14:15:32 +0100 wireprotoserver: ensure that output stream gets flushed on exception stable
Arseniy Alekseyev <aalekseyev@janestreet.com> [Thu, 04 Apr 2024 14:15:32 +0100] rev 51572
wireprotoserver: ensure that output stream gets flushed on exception Previously flush was happening due to Python finalizer being run on `BufferedWriter`. With upgrade to Python 3.11 this started randomly failing. My guess is that the finalizer on the raw `FileIO` object may be running before the finalizer of `BufferedWriter` has a chance to run. At any rate, since we're not relying on finalizers in the happy case we should also not rely on them in case of exception.
Mon, 15 Apr 2024 16:33:37 +0100 match: strengthen visit_children_set invariant, Recursive means "all files" stable
Arseniy Alekseyev <aalekseyev@janestreet.com> [Mon, 15 Apr 2024 16:33:37 +0100] rev 51571
match: strengthen visit_children_set invariant, Recursive means "all files" My previous interpretation of "Recursive" was too relaxed: I thought it instructed the caller to do something like this: > you can stop calling `visit_children_set` because you'll need to descend into > every directory recursively, but you should still check every file if it > matches or not Whereas the real instruction seems to be: > I guarantee that everything in this subtree matches, you can stop > querying the matcher for all files and dirs altogether. The evidence to support this: - the test actually passes with the stronger invariant, revealing no exceptions from this rule - the implementation of `visit_children_set` for `DifferenceMatcher` clearly relies on this requirement, so it must hold for that not to lead to bugs.
Fri, 12 Apr 2024 16:09:45 +0100 match: fix the rust-side bug in visit_children_set for rootfilesin matchers stable
Arseniy Alekseyev <aalekseyev@janestreet.com> [Fri, 12 Apr 2024 16:09:45 +0100] rev 51570
match: fix the rust-side bug in visit_children_set for rootfilesin matchers The fix is checked by `test_pattern_matcher_visit_children_set` test, which is what caught the bug in the first place, but also by an end-to-end test that I made for this purpose. Accept the new results of Cargo tests Many of these were already annotated with "FIXME", which is a good sign.
Fri, 12 Apr 2024 15:39:21 +0100 match: fix the "visitdir" method on "rootfilesin" matchers stable
Arseniy Alekseyev <aalekseyev@janestreet.com> [Fri, 12 Apr 2024 15:39:21 +0100] rev 51569
match: fix the "visitdir" method on "rootfilesin" matchers This fixes just the Python side, the fix for the rust side will follow shortly.
Fri, 12 Apr 2024 14:21:14 +0100 match: rename RootFiles to RootFilesIn for more consistency stable
Arseniy Alekseyev <aalekseyev@janestreet.com> [Fri, 12 Apr 2024 14:21:14 +0100] rev 51568
match: rename RootFiles to RootFilesIn for more consistency
Fri, 12 Apr 2024 14:17:10 +0100 match: small tweak to PatternMatcher.visit_children_set stable
Arseniy Alekseyev <aalekseyev@janestreet.com> [Fri, 12 Apr 2024 14:17:10 +0100] rev 51567
match: small tweak to PatternMatcher.visit_children_set This makes it a bit more efficient (avoid a computation in case of early return), and in my opinion clearer.
Fri, 12 Apr 2024 14:09:55 +0100 matchers: fix the bug in rust PatternMatcher that made it cut off early stable
Arseniy Alekseyev <aalekseyev@janestreet.com> [Fri, 12 Apr 2024 14:09:55 +0100] rev 51566
matchers: fix the bug in rust PatternMatcher that made it cut off early This brings the rust output in line with the Python output.
Fri, 12 Apr 2024 13:48:38 +0100 tests: add an end-to-end test to show a bug in `visit_children_set` stable
Arseniy Alekseyev <aalekseyev@janestreet.com> [Fri, 12 Apr 2024 13:48:38 +0100] rev 51565
tests: add an end-to-end test to show a bug in `visit_children_set` Concretely, `rootfilesin` is completely broken with respect to `visit_children_set` optimization.
Thu, 11 Apr 2024 19:57:36 +0100 tests: add tests and document expectations from visit_children_set in rust stable
Arseniy Alekseyev <aalekseyev@janestreet.com> [Thu, 11 Apr 2024 19:57:36 +0100] rev 51564
tests: add tests and document expectations from visit_children_set in rust The tests this patch are adding have the form of formal spec in invariants::visit_children_set::holds, and then a series of checks that all examples must satisfy this formal spec. I tried to make the spec consistent with how this function is used and how it was originally conceived. This is in conflict with how it's documented in Rust. Some of the implementations also fail to implement this spec, which leads to bugs, in particular when complicated patterns are used with `hg status`.
Thu, 11 Apr 2024 15:53:23 +0100 tests: add a test that demonstrates a bug in rhg status pattern handling stable
Arseniy Alekseyev <aalekseyev@janestreet.com> [Thu, 11 Apr 2024 15:53:23 +0100] rev 51563
tests: add a test that demonstrates a bug in rhg status pattern handling The bug is in [visit_children_set], will be elaborated on in follow-up changes.
Fri, 05 Apr 2024 01:07:46 +0200 bundle-spec: properly parse boolean configuration as boolean stable
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 05 Apr 2024 01:07:46 +0200] rev 51562
bundle-spec: properly parse boolean configuration as boolean Before this changesets "v2;revbranchcache=no" would actually request the addition for a revbranchcache part as the non-empty string `"0"` is `True`
Thu, 04 Apr 2024 16:41:43 +0200 bundle-spec: properly identify changegroup-less bundle stable
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 04 Apr 2024 16:41:43 +0200] rev 51561
bundle-spec: properly identify changegroup-less bundle It is possible to produce a bundle without changegroup. For example if we want to only send phases or obsolescence information. However that lead to crash for command that identifies bundle content. So we fix that. The test will come in the next changesets, when we fix another bug preventing to generate such bundle by hand.
Wed, 03 Apr 2024 15:33:25 +0200 perf: create the temporary target next to the source in stream-consume
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 03 Apr 2024 15:33:25 +0200] rev 51560
perf: create the temporary target next to the source in stream-consume See inline comment for rational.
Wed, 03 Apr 2024 16:00:37 +0200 setup: display return code information about failed `hg` call stable
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 03 Apr 2024 16:00:37 +0200] rev 51559
setup: display return code information about failed `hg` call This help to understand what is going wrong when things goes wrong.
Tue, 02 Apr 2024 21:53:17 +0200 bundlespec: rationalize the way we specify stream bundle version
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 02 Apr 2024 21:53:17 +0200] rev 51558
bundlespec: rationalize the way we specify stream bundle version Instead of having weird dedicated option for each version (v2, v3, etc) we reuse the same "stream" parameters. This is consistent with the ability to request a stream clone using "none-v2;stream=v2". This changeset introduce no user visible change, this is pure internal cleaning.
Tue, 02 Apr 2024 17:02:39 +0200 bundle: do no check the changegroup version if no changegroup is included
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 02 Apr 2024 17:02:39 +0200] rev 51557
bundle: do no check the changegroup version if no changegroup is included We don't need to check the compatibility of something we will not use. In practice this was getting in the was of `streamv2` bundles on a narrow repository as the 'cg.version=02' value was rejected by this checks.
Wed, 27 Mar 2024 18:51:33 +0000 perf-stream-consume: use the source repository config when applying
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 27 Mar 2024 18:51:33 +0000] rev 51556
perf-stream-consume: use the source repository config when applying This might contains critical configuration for the benchmark, like enabling of extensions like narrow.
Wed, 27 Mar 2024 17:46:23 +0000 unbundle: move most of the logic on cmdutil to help debug::unbundle reuse
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 27 Mar 2024 17:46:23 +0000] rev 51555
unbundle: move most of the logic on cmdutil to help debug::unbundle reuse This make sure `hg debug::unbundle` focus on the core logic.
Wed, 27 Mar 2024 17:29:48 +0000 postincoming: move to cmdutil
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 27 Mar 2024 17:29:48 +0000] rev 51554
postincoming: move to cmdutil This looks like a good place for it to live.
Wed, 27 Mar 2024 17:21:46 +0000 postincoming: avoid computing branchhead if no report will be posted
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 27 Mar 2024 17:21:46 +0000] rev 51553
postincoming: avoid computing branchhead if no report will be posted This otherwise defeat some of the branch v3 optimization.
Tue, 26 Mar 2024 13:46:44 +0000 streamclone: stop listing files for entries that have no volatile files
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 26 Mar 2024 13:46:44 +0000] rev 51552
streamclone: stop listing files for entries that have no volatile files This will save a lot of python related time. This significantly boost performance. The following number comes from a large private repository using perf::stream-locked-section: base-line: 35.04 seconds prev-change: 24.51 seconds (-30%) prev-change: 20.88 seconds (-40%) prev-change: 14.22 seconds (-60%) this-change: 11.58 seconds (-67% from baseline; -18% from prev)
Tue, 26 Mar 2024 13:34:05 +0000 stream-clone: disable gc for the initial section for the v3 format
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 26 Mar 2024 13:34:05 +0000] rev 51551
stream-clone: disable gc for the initial section for the v3 format The number of small container created turn Python in a gc-frenzy that seriously impact performance. This significantly boost performance. The following number comes from a large private repository using perf::stream-locked-section: base-line: 35.04 seconds prev-change: 24.51 seconds (-30%) prev-change: 20.88 seconds (-40%) this-change: 14.22 seconds (-60% from baseline; -31% from prev)
Tue, 26 Mar 2024 13:32:46 +0000 stream-clone: disable gc for `_entries_walk` duration
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 26 Mar 2024 13:32:46 +0000] rev 51550
stream-clone: disable gc for `_entries_walk` duration The number of small container created turn Python in a gc-frenzy that seriously impact performance. This significantly boost performance. The following number comes from a large private repository using perf::stream-locked-section: base-line: 35.04 seconds prev-change: 24.51 seconds (-30%) this-change: 20.88 seconds (-40% from baseline; -15% from previous changes)
Tue, 26 Mar 2024 13:28:52 +0000 nocg: make the utility work are both a decorator and context manager
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 26 Mar 2024 13:28:52 +0000] rev 51549
nocg: make the utility work are both a decorator and context manager In some case, the context manager version will be simpler.
Tue, 26 Mar 2024 11:24:20 +0000 stream-clone: stop getting the file size of all file in v3
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 26 Mar 2024 11:24:20 +0000] rev 51548
stream-clone: stop getting the file size of all file in v3 The point of v3 is to do less work in the locked section. It was currently not the case. This significantly boost performance. The following number comes from a large private repository using perf::stream-locked-section: base-line: 35.03 seconds this-change: 24.50 seconds (-30%)
Tue, 26 Mar 2024 18:55:40 +0000 stream: in v3, skip the "size" fast path if the entries as some unknown size
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 26 Mar 2024 18:55:40 +0000] rev 51547
stream: in v3, skip the "size" fast path if the entries as some unknown size We are about to prefetch size during the lock less in the v3 case. So we need to avoid trying to use that prefetched size when it is not available. See next changeset for the motivation.
Tue, 26 Mar 2024 08:43:20 +0000 perf-stream-locked-section: advertise the right version key in the help
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 26 Mar 2024 08:43:20 +0000] rev 51546
perf-stream-locked-section: advertise the right version key in the help As the v3 format is still experimental, its key is "v3-exp". The help text was not pointing that out. (we also fix `perf::stream-generate` in the process)
Tue, 26 Mar 2024 08:39:08 +0000 perf-stream-locked-section: fix the call to the v3 generator
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 26 Mar 2024 08:39:08 +0000] rev 51545
perf-stream-locked-section: fix the call to the v3 generator That generator simply return chunks so we should not assign the return to a tuple.
Tue, 26 Mar 2024 08:36:47 +0000 perf-stream-locked-section: actually use v1 generation when requested
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 26 Mar 2024 08:36:47 +0000] rev 51544
perf-stream-locked-section: actually use v1 generation when requested We were fetching a v1 generator but actually using the v2 function…
Fri, 29 Mar 2024 21:39:00 +0100 branching: merge stable into default
Raphaël Gomès <rgomes@octobus.net> [Fri, 29 Mar 2024 21:39:00 +0100] rev 51543
branching: merge stable into default
Fri, 29 Mar 2024 21:37:09 +0100 Added signature for changeset 803e61387e86 stable
Raphaël Gomès <rgomes@octobus.net> [Fri, 29 Mar 2024 21:37:09 +0100] rev 51542
Added signature for changeset 803e61387e86
Fri, 29 Mar 2024 21:37:06 +0100 Added tag 6.7.2 for changeset 803e61387e86 stable
Raphaël Gomès <rgomes@octobus.net> [Fri, 29 Mar 2024 21:37:06 +0100] rev 51541
Added tag 6.7.2 for changeset 803e61387e86
Thu, 28 Mar 2024 14:47:20 +0000 relnotes: add 6.7.2 stable 6.7.2
Raphaël Gomès <rgomes@octobus.net> [Thu, 28 Mar 2024 14:47:20 +0000] rev 51540
relnotes: add 6.7.2
Thu, 28 Mar 2024 07:12:09 +0000 bundle2: make the "hgtagsfnodes" part advisory stable
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 28 Mar 2024 07:12:09 +0000] rev 51539
bundle2: make the "hgtagsfnodes" part advisory This bundle2 part is about helping the client to warms its cache. There is no reason for it to be mandatory. So we mark it advisory.
Mon, 25 Mar 2024 16:27:48 +0000 branching: merge stable into default
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 25 Mar 2024 16:27:48 +0000] rev 51538
branching: merge stable into default
Thu, 07 Mar 2024 10:57:16 +0100 branchcache: allow to detect "pure topological case" for branchmap
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 07 Mar 2024 10:57:16 +0100] rev 51537
branchcache: allow to detect "pure topological case" for branchmap We don't rum this detection every time we run the branchcache, that would be costly. However we now do it when running `hg debugupdatecache`. This will help existing repository to benefit from the fastpath when possible.
Thu, 07 Mar 2024 04:15:23 +0100 branchcache: add a "pure topological head" fast path
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 07 Mar 2024 04:15:23 +0100] rev 51536
branchcache: add a "pure topological head" fast path In a narrow but actually quick common case, all topological heads are all on the same branch and all open. In this case, computing the branch map is very simple. We can quickly detect situation where this situation will not change. So we update the V3 format to be able to express this situation and upgrade the update code to detect we remains in that mode. The branch cache is populated with the actual value when the branch map is accessed, but the update_disk method can do the update without needing to populate it.
Wed, 06 Mar 2024 16:18:03 +0100 branchcache: move the processing of the new data in a dedicated method
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 06 Mar 2024 16:18:03 +0100] rev 51535
branchcache: move the processing of the new data in a dedicated method In a future changeset, this will allow the V3 of the branch cache to use a fast path when possible.
Wed, 06 Mar 2024 16:10:44 +0100 branchcache: gather newly closed head in a dedicated set
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 06 Mar 2024 16:10:44 +0100] rev 51534
branchcache: gather newly closed head in a dedicated set This is part of a series to more clearly split the update in two step. This will allow us to introduce a fast path during update in a future changeset.
Wed, 06 Mar 2024 16:09:42 +0100 branchcache: gather new obsolete revision in a set
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 06 Mar 2024 16:09:42 +0100] rev 51533
branchcache: gather new obsolete revision in a set This is part of a series to more clearly split the update in two step. This will allow us to introduce a fast path during update in a future changeset.
Wed, 06 Mar 2024 15:54:22 +0100 branchcache: filter obsolete revisions sooner
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 06 Mar 2024 15:54:22 +0100] rev 51532
branchcache: filter obsolete revisions sooner Since we won't do anything with the obsolete revisions, we can just ignore them sooner.
Thu, 07 Mar 2024 10:55:22 +0100 branchcache: skip entries that are topological heads in the on disk file
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 07 Mar 2024 10:55:22 +0100] rev 51531
branchcache: skip entries that are topological heads in the on disk file In the majority of cases, topological heads are also branch heads. We have efficient way to get the topological heads and efficient way to retrieve their branch information. So there is little value in putting them in the branch cache file explicitly. On the contrary, writing them explicitly tend to create very large cache file that are inefficient to read and update. So the branch cache v3 format is no longer including them. This changeset focus on the format aspect and have no focus on the performance aspect. We will cover that later.
Thu, 07 Mar 2024 01:35:43 +0100 branchcache: simplify the branch rev cache test
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 07 Mar 2024 01:35:43 +0100] rev 51530
branchcache: simplify the branch rev cache test We don't need that many content dump and this gets in the way in change in access pattern (e.g. accessing revision in a different order change the order of branches in the "names" file). So we simplify this test in advance.
Wed, 06 Mar 2024 11:39:44 +0100 branchcache: store filtered hash and obsolete hash independently for V3
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 06 Mar 2024 11:39:44 +0100] rev 51529
branchcache: store filtered hash and obsolete hash independently for V3 This will avoid the bug covered in tests/test-branches-obsolete.t when we stop storing all heads explicitly in V3.
Wed, 06 Mar 2024 12:07:31 +0100 branchcache: show the cache file content in test-branches-obsoletes.t
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 06 Mar 2024 12:07:31 +0100] rev 51528
branchcache: show the cache file content in test-branches-obsoletes.t This help to track the changes in format between v2 and v3.
Wed, 06 Mar 2024 02:20:53 +0100 branchcache: rework the `filteredhash` logic to be more generic
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 06 Mar 2024 02:20:53 +0100] rev 51527
branchcache: rework the `filteredhash` logic to be more generic We now have a more flexible `key_hashes` tuple. We duplicated various logic in the V2 and V3 version of the cache as the goal is to start changing the logic for V3 in the next few changesets.
Wed, 06 Mar 2024 01:53:52 +0100 filteredhash: rename the filteredhash function
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 06 Mar 2024 01:53:52 +0100] rev 51526
filteredhash: rename the filteredhash function The new name is less ambiguous, as we are about to introduce an alternative function it seems like a good idea to have clearer name to distinct the two.
Wed, 06 Mar 2024 01:43:51 +0100 filteredhash: split the computation of revision sets
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 06 Mar 2024 01:43:51 +0100] rev 51525
filteredhash: split the computation of revision sets The branch2's filteredhash combines the filtered revisions and the obsolete ones, this will creates issue for implicit reference to heads we want to introduce for the v3 of the branch cache format. So we isolate this logic for alternative use.
Tue, 05 Mar 2024 15:21:18 +0100 filteredhash: move the hashing in its own function
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 05 Mar 2024 15:21:18 +0100] rev 51524
filteredhash: move the hashing in its own function This will help us to reuse this logic in variants of the hashes used for branch cache validation.
Sun, 25 Feb 2024 23:31:50 +0100 branchcache: cleanup the final key generation after update
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 25 Feb 2024 23:31:50 +0100] rev 51523
branchcache: cleanup the final key generation after update A lot of duplicated work seemed to be done, as we already update the tiprev and tipnode when needed right before. So we simplify that part to focus on the filtered hash. See inline comment for details.
Wed, 28 Feb 2024 12:56:08 +0100 branchcache: add more test for the logic around obsolescence and branch heads
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 28 Feb 2024 12:56:08 +0100] rev 51522
branchcache: add more test for the logic around obsolescence and branch heads While working on branch-cache-v3, we noticed some ambiguity in the filtered+obsolete hash. However this was only caught by a rebase test by chance. It seems important to explicitly tests these cases.
Mon, 26 Feb 2024 15:44:44 +0100 branchcache-v3: use more explicit header line
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 26 Feb 2024 15:44:44 +0100] rev 51521
branchcache-v3: use more explicit header line The key-value approach is clearer and gives more rooms to have the format evolve in a clear way. It also provides extension (like topic) simpler way to extend the validation scheme. This is just a small evolution, the V3 format is still a work in progress.
Mon, 26 Feb 2024 14:20:36 +0100 branchcache-v3: introduce a v3 format
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 26 Feb 2024 14:20:36 +0100] rev 51520
branchcache-v3: introduce a v3 format For now the format is the very same, however we will start changing it in future changesets.
Tue, 27 Feb 2024 14:04:29 +0100 branchcache: use an explicit class for the v2 version
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 27 Feb 2024 14:04:29 +0100] rev 51519
branchcache: use an explicit class for the v2 version This prepare the introduction of an experimental v3 format version. In the process, we move the description of the format in that new class.
Tue, 27 Feb 2024 15:33:21 +0100 branchcache: add some blank line in a test
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 27 Feb 2024 15:33:21 +0100] rev 51518
branchcache: add some blank line in a test This helps each section to stand out.
Mon, 25 Mar 2024 02:09:15 +0100 phases: update the phase set as we go during retract boundary stable
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 25 Mar 2024 02:09:15 +0100] rev 51517
phases: update the phase set as we go during retract boundary Apparently iterating over the `changed_revs` dictionary is very expensive. On mozilla-try-2019-02-18, a perf::unbundle call with a 10 000 changesets bundle gives give use the following timing. e57d4b868a3e: 4.6 seconds ac1c75188440: 102.5 seconds prev-changeset: 30.0 seconds this-changeset: 4.6 seconds So, the performance regression is gone. Once again: thanks to marvelous Python!
Mon, 25 Mar 2024 01:50:31 +0100 phases: avoid a potentially costly dictionary interation in some case stable
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 25 Mar 2024 01:50:31 +0100] rev 51516
phases: avoid a potentially costly dictionary interation in some case If we retract for the draft phase, there is not non-public item to be retracted and we can skip this part. This part is was apparently super costly thanks to Python. On mozilla-try-2019-02-18, a perf::unbundle call with a 10 000 changesets bundle gives give use the following timing. e57d4b868a3e: 4.6 seconds ac1c75188440: 102.5 seconds this-changeset: 30.0 seconds So we recovered about ⅔ of the regression, the next changeset will give us the rest back.
Thu, 21 Mar 2024 12:26:46 +0100 branching: merge stable into default
Raphaël Gomès <rgomes@octobus.net> [Thu, 21 Mar 2024 12:26:46 +0100] rev 51515
branching: merge stable into default
Thu, 21 Mar 2024 12:24:42 +0100 Added signature for changeset 2e6fde2ed01e stable
Raphaël Gomès <rgomes@octobus.net> [Thu, 21 Mar 2024 12:24:42 +0100] rev 51514
Added signature for changeset 2e6fde2ed01e
Thu, 21 Mar 2024 12:24:36 +0100 Added tag 6.7.1 for changeset 2e6fde2ed01e stable
Raphaël Gomès <rgomes@octobus.net> [Thu, 21 Mar 2024 12:24:36 +0100] rev 51513
Added tag 6.7.1 for changeset 2e6fde2ed01e
Thu, 21 Mar 2024 12:23:25 +0100 relnotes: add 6.7.1 stable 6.7.1
Raphaël Gomès <rgomes@octobus.net> [Thu, 21 Mar 2024 12:23:25 +0100] rev 51512
relnotes: add 6.7.1
Sat, 16 Mar 2024 21:02:19 -0300 subrepo: fix normalizing paths with scheme stable
Felipe Resende <felipe@fcresende.dev.br> [Sat, 16 Mar 2024 21:02:19 -0300] rev 51511
subrepo: fix normalizing paths with scheme After revision 0afe96e374a7, subrepo paths were normalized using posixpath.normpath and that resulted in ssh paths being wrongly converted from ssh://host/path to ssh:/host/path This fix applies the same logic used in urlutil.url to split the path scheme from the rest and only use posixpath.normpath to the string after scheme://
Sat, 16 Mar 2024 18:37:07 -0300 sshpeer: fix path when handling invalid url exception stable
Felipe Resende <felipe@fcresende.dev.br> [Sat, 16 Mar 2024 18:37:07 -0300] rev 51510
sshpeer: fix path when handling invalid url exception In 73ed1d13c0bf the code was refactored but the error handling seems to have been missed (or maybe the object shoud have implemented __bytes__)
Mon, 18 Mar 2024 11:25:21 +0100 delta-search: fix crash caused by unbound variable stable
Raphaël Gomès <rgomes@octobus.net> [Mon, 18 Mar 2024 11:25:21 +0100] rev 51509
delta-search: fix crash caused by unbound variable This code path was apparently not tested. This fixes a crash when cloning the Tryton repo.
Fri, 15 Mar 2024 10:52:51 +0100 branching: merge stable into default
Raphaël Gomès <rgomes@octobus.net> [Fri, 15 Mar 2024 10:52:51 +0100] rev 51508
branching: merge stable into default
Fri, 15 Mar 2024 10:49:44 +0100 Added signature for changeset c9ceb4f60256 stable
Raphaël Gomès <rgomes@octobus.net> [Fri, 15 Mar 2024 10:49:44 +0100] rev 51507
Added signature for changeset c9ceb4f60256
Fri, 15 Mar 2024 10:49:40 +0100 Added tag 6.7 for changeset c9ceb4f60256 stable
Raphaël Gomès <rgomes@octobus.net> [Fri, 15 Mar 2024 10:49:40 +0100] rev 51506
Added tag 6.7 for changeset c9ceb4f60256
Fri, 15 Mar 2024 01:31:57 +0100 phases: avoid N² behavior in `advanceboundary` stable 6.7
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 15 Mar 2024 01:31:57 +0100] rev 51505
phases: avoid N² behavior in `advanceboundary` We allowed duplicated entries in the deque, which each entry could potentially insert all its ancestors. So advancing boundary for the full repository would mean each revision would walk all its ancestors, resulting in O(N²) iteration. For repository of any decent size, N² is quickly insane. We introduce a simple set to avoid this and get back to reasonable performance.
Thu, 14 Mar 2024 16:25:46 +0100 relnotes: add 6.7 stable
Raphaël Gomès <rgomes@octobus.net> [Thu, 14 Mar 2024 16:25:46 +0100] rev 51504
relnotes: add 6.7
Thu, 14 Mar 2024 11:24:52 +0100 admin-commands: move the chainsaw extension to the admin commands module stable
Raphaël Gomès <rgomes@octobus.net> [Thu, 14 Mar 2024 11:24:52 +0100] rev 51503
admin-commands: move the chainsaw extension to the admin commands module Activating an extension is always a little bit of a chore and the long name, options and "chainsaw" bits are deterrent enough. This also allows us to help the discoverability for people looking for repo "administration" tools, with the widest semantic of "administration".
Wed, 13 Mar 2024 16:22:13 -0300 obsutil: sort metadata before comparing in geteffectflag() stable
Anton Shestakov <av6@dwimlabs.net> [Wed, 13 Mar 2024 16:22:13 -0300] rev 51502
obsutil: sort metadata before comparing in geteffectflag() This is probably less important now that we dropped Python 2. We do still support Python 3.6 though, and the dictionaries aren't ordered there either (that was a big change that came with 3.7). Still, maybe it's a good idea to sort metadata explicitly.
Mon, 11 Mar 2024 11:11:34 +0100 tests: disable revlog compression in test-generaldelta.t (issue6867) stable
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 11 Mar 2024 11:11:34 +0100] rev 51501
tests: disable revlog compression in test-generaldelta.t (issue6867) The revlog compression makes a lot of numbers unstable. Since checking revlog compression is not the goal of this test, we disable the compression to get stable numbers. This should avoid wasting more time on this kind of changes in the future.
Mon, 11 Mar 2024 11:09:29 +0100 test-general-delta: actually test optimize-delta-parent-choice=no stable
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 11 Mar 2024 11:09:29 +0100] rev 51500
test-general-delta: actually test optimize-delta-parent-choice=no Since the configuration was not explicit, the case stopped testing what it intended to test when the default value changed.
Mon, 11 Mar 2024 13:09:01 +0100 test-chg: stabilize the log checking stable
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 11 Mar 2024 13:09:01 +0100] rev 51499
test-chg: stabilize the log checking The "worker process exited" line have been making the CI flaky for a long time. Lets sort this out.
Mon, 11 Mar 2024 12:03:40 +0100 tests: fix test-patchbomb-tls.t instability stable
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 11 Mar 2024 12:03:40 +0100] rev 51498
tests: fix test-patchbomb-tls.t instability The flakiness on chg is caused by a client that exit faster than the server output log. So actively wait for the server to issue the expected output (with a small timeout)
Mon, 11 Mar 2024 16:05:28 +0100 test-lock: use synchronisation file instead of sleep stable
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 11 Mar 2024 16:05:28 +0100] rev 51497
test-lock: use synchronisation file instead of sleep This will prevent the test to be flaky on load.
Sun, 10 Mar 2024 03:29:12 +0100 branchcache: use update_disk to refresh 'served' and 'served.hidden'
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 10 Mar 2024 03:29:12 +0100] rev 51496
branchcache: use update_disk to refresh 'served' and 'served.hidden' The `update_disk` method is dedicated to this kind of usecase. Now that the writting patterns are more consistent, we can use it to warm these two important cache. I am dropping the first comment about "refreshing all the others" because it is false. If a branchmap already exist for "served", none of the subset will be updated.
Sun, 10 Mar 2024 03:25:04 +0100 branchcache: explictly update disk state only if no transaction exist
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 10 Mar 2024 03:25:04 +0100] rev 51495
branchcache: explictly update disk state only if no transaction exist If a transaction exist the `write_dirty` call will eventually be done and the state will be synched on disk. It is better to no interfer with that.
Sun, 10 Mar 2024 03:32:50 +0100 branchcache: do not use `__getitem__` in updatecache
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 10 Mar 2024 03:32:50 +0100] rev 51494
branchcache: do not use `__getitem__` in updatecache The `update_disk` method uses `updatecache` and the point of `update_disk` is to be able to do alternative processing to the one we do in `__getitem__`. So we calling `__getitem__` in `updatecache` defeat this purpose. Instead we do the equivalent explicitly to preserve the spirit of `update_disk` (that we will actually put to use soon, I promise)
Sun, 10 Mar 2024 05:10:00 +0100 branchcache: explicitly track inheritence "state"
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 10 Mar 2024 05:10:00 +0100] rev 51493
branchcache: explicitly track inheritence "state" We move from a binary "dirty" flag to a three value "state": "clean", "inherited", "dirty". The "inherited" means that the branch cache is not only "clean", but it is a duplicate of its parent filter. If a branch cache is "inherited", we can non only skip writing its value on disk, but it is a good idea to delete any stale value on disk, as those will just waste time (and possibly induce bug) in the future. We only do this in the update related to transaction or explicit cache update (e.g `hg debugupdatecache`). Deleting the file when we simply detected a stall cache during a read only operation seems more dangerous. We rename `copy` to `inherit_for` to clarify we associate a stronger semantic to the operation.
Sun, 10 Mar 2024 04:53:17 +0100 branchcache: stop writing more branchcache file on disk than needed
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 10 Mar 2024 04:53:17 +0100] rev 51492
branchcache: stop writing more branchcache file on disk than needed Before this change, we were unconditionally writing a branchmap file for the filter level passed to `update_disk`. This is actually counter productive if no update were needed for this filter level. In many case, the branch cache for a filter level is identical to its parent "subset" and it is better to simply keep the subset update and reuse it every time instead of having to do identical work for similar subset. So we change the `update_disk` method to only write a file when that filter level differ from its parent. This removes many cases where identical files were written, requiring multiple boring update in the test suite. The only notable changes is the change to `test-strip-branch-cache.t`, this case was checking a scenario that no longer reproduce the bug as writing less branchmap file result in less stalled cache on disk. Strictly speaking, we could create a more convoluted scenario that create a similar issue. However the next changeset would also cover that scenario so we directly updated that test case to a "no longer buggy" state.
Fri, 08 Mar 2024 16:49:06 +0100 branchcache: do not copy the `_dirty` flag
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 08 Mar 2024 16:49:06 +0100] rev 51491
branchcache: do not copy the `_dirty` flag If the inherited branch cache is dirty, it will be written on disk, and the super-set did not need to modify it, the on disk value for the subset will be re-useable as is. So the super set does not needs to write the very same content itself.
Fri, 08 Mar 2024 16:52:08 +0100 branchcache: explicitly assert that copy is always about inheritance
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 08 Mar 2024 16:52:08 +0100] rev 51490
branchcache: explicitly assert that copy is always about inheritance This would catch cases where copy is used for something else if any existed.
Sat, 09 Mar 2024 02:07:15 +0100 branchcache: stop using `copy(…)` in `replace(…)`
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 09 Mar 2024 02:07:15 +0100] rev 51489
branchcache: stop using `copy(…)` in `replace(…)` The `copy` method is mostly used for a filter level to inherit the branchmap from a subset. So we stop using (abusing) it in "replace" to ensure `copy` is used only for inheritance purposes. Since `replace` is a method of the BranchMapCache, it seems fine to do lower level operation there.
Fri, 08 Mar 2024 16:47:32 +0100 branchcache: change the _delayed flag to an explicit `_dirty` flag
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 08 Mar 2024 16:47:32 +0100] rev 51488
branchcache: change the _delayed flag to an explicit `_dirty` flag This is more consistent with the logic we use for other object and it open the way to a clearer management of the cache state. Now, cache are created clean, cache update mark them dirty, writing them on disk mark them clean again.
Fri, 08 Mar 2024 15:50:15 +0100 branchcache: write branchmap in subset inheritance order
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 08 Mar 2024 15:50:15 +0100] rev 51487
branchcache: write branchmap in subset inheritance order This way, we can guarantee a valid subset has been written before touching the branchmap of another filter. This is especially useful as we are bout to start deleting outdated branchmap file.
Fri, 08 Mar 2024 15:06:54 +0100 branchcache: do not accept "empty update"
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 08 Mar 2024 15:06:54 +0100] rev 51486
branchcache: do not accept "empty update" This currently does not happens and it will be simpler that is remains that way. If all update do something, we will be able to simply declare, in a later changesets, that all update to result in a dirty branchcache.
Thu, 07 Mar 2024 11:04:34 +0100 branchcache: avoid created a `None` filter repoview when writing
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 07 Mar 2024 11:04:34 +0100] rev 51485
branchcache: avoid created a `None` filter repoview when writing The repoview class is not intended to be used for unfiltered repository.
Wed, 28 Feb 2024 22:49:55 +0100 stream-clone-tests: stop filtering non existent warning
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 28 Feb 2024 22:49:55 +0100] rev 51484
stream-clone-tests: stop filtering non existent warning This filtering was introduced in 74c004a515bc, however there is already no warning in that changeset. So I guess the warnings existed when we the patch was created but the problem was solved in another changeset that 74c004a515bc, rebased on.
Wed, 28 Feb 2024 22:46:12 +0100 stream-clone-test: simplify case testing obsolescence
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 28 Feb 2024 22:46:12 +0100] rev 51483
stream-clone-test: simplify case testing obsolescence There is only two important things in this test: - the number of file we send, to show we picked the obsstore. - the resulting state, to show we did alter things in the process. The rest are of the number are very fragile and consume a lot of time for little value when adjusting formats, caches, and protocol.
Wed, 28 Feb 2024 22:43:07 +0100 stream-clone-test: simplify the case testing phases
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 28 Feb 2024 22:43:07 +0100] rev 51482
stream-clone-test: simplify the case testing phases There is only two important things in this test: - the number of file we send, to show we picked the phase roots. - the resulting phases, to show we did not modified them. The rest are of the number are very fragile and consume a lot of time for little value when adjusting formats, caches, and protocol.
Wed, 28 Feb 2024 22:39:10 +0100 stream-clone-test: simplify bookmark clone
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 28 Feb 2024 22:39:10 +0100] rev 51481
stream-clone-test: simplify bookmark clone The important things to test here is the number of file included (to catch that the bookmark file was sent). So we keep that part non glob'ed but glob the rest. The glob'ed numbers are very fragile and consume a lot of time for little value when adjusting formats, caches, and protocol.
Wed, 28 Feb 2024 22:31:42 +0100 stream-clone-test: add a verify call to the "clone while changing" case
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 28 Feb 2024 22:31:42 +0100] rev 51480
stream-clone-test: add a verify call to the "clone while changing" case It seems useful to very that the clone did not result in a corrupted copy.
Fri, 08 Mar 2024 10:59:51 +0100 stream-clone-test: add title to various test cases
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 08 Mar 2024 10:59:51 +0100] rev 51479
stream-clone-test: add title to various test cases These case are fine as is, but as we are adding title to all the other as we simplify them, lets add title for all cases.
Wed, 28 Feb 2024 22:28:07 +0100 stream-clone-test: simplify testing of secret cloning restriction
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 28 Feb 2024 22:28:07 +0100] rev 51478
stream-clone-test: simplify testing of secret cloning restriction Here, we just want to check if the streaming clone is allowed and used or not. We do not care about the details of the clone itself.
Wed, 28 Feb 2024 22:26:27 +0100 stream-clone-test: simplify the background file closing test
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 28 Feb 2024 22:26:27 +0100] rev 51477
stream-clone-test: simplify the background file closing test Here we just care about the fact the background file closing logic actually ran. We don't need to check the details of the cloning. The details of the output is very fragile and consume a lot of time for little value when adjusting formats, caches, and protocol. So we filter it out.
Fri, 08 Mar 2024 10:51:01 +0100 stream-clone-test: simplify the --uncompressed alias check
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 08 Mar 2024 10:51:01 +0100] rev 51476
stream-clone-test: simplify the --uncompressed alias check To check that --uncompressed is an alias we just need to check it trigger a stream clone, we don't need to check anything else.
Fri, 08 Mar 2024 10:50:42 +0100 stream-clone-test: drop an automatic pattern replacement
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 08 Mar 2024 10:50:42 +0100] rev 51475
stream-clone-test: drop an automatic pattern replacement That pattern is nice, but it prevent us to glob the number of bytes when we don't care about them. We don't care about them more often that what we currently checks so dropping this pattern will help use to simplify various tests.
Wed, 28 Feb 2024 22:15:33 +0100 stream-clone-test: simplify the test for getbundle with stream=1
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 28 Feb 2024 22:15:33 +0100] rev 51474
stream-clone-test: simplify the test for getbundle with stream=1 The core of this tests is about checking we receive a stream bundle with such request. We don't need to look at too much of the details of the stream itself. Since the content of the stream if shifting overtime, Such check is very fragile and consume a lot of time for little value when adjusting formats, caches, and protocol. So we reduce the size of what we check to focus on "is this a stream clone" question.
Wed, 28 Feb 2024 22:05:28 +0100 stream-clone-test: factor some piece of basic clone test out
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 28 Feb 2024 22:05:28 +0100] rev 51473
stream-clone-test: factor some piece of basic clone test out Multiple parts of this case (listing cache, checking error) are common to all cases and don't need to be in the conditionnal block. This simplify the test update.
Wed, 28 Feb 2024 22:01:09 +0100 stream-clone-test: simplify the case where server disabled it
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 28 Feb 2024 22:01:09 +0100] rev 51472
stream-clone-test: simplify the case where server disabled it We have an option to disable it, we don't need to test it with all protocol variants. In addition there is little value in looking at the bytes to bytes details of the reply. Such check is very fragile and consume a lot of time for little value when adjusting formats, caches, and protocol.
Mon, 11 Mar 2024 13:36:25 +0100 rust-matchers: raw regular expression builder stable
Georges Racinet <georges.racinet@octobus.net> [Mon, 11 Mar 2024 13:36:25 +0100] rev 51471
rust-matchers: raw regular expression builder Extracting this `re_builder()` from `re_matcher()` makes it reusable in more general cases than matching `HgPath` instances and would help reducing code duplication in RHGitaly.
Mon, 11 Mar 2024 13:23:18 +0100 rust-filepatterns: export glob_to_re function stable
Georges Racinet <georges.racinet@octobus.net> [Mon, 11 Mar 2024 13:23:18 +0100] rev 51470
rust-filepatterns: export glob_to_re function Making this function public should not risk freezing the internal API, and it can be useful for all downstream code that needs to perform glob matching against byte strings, such as RHGitaly where it will be useful to match on branches and tags.
Mon, 11 Mar 2024 01:20:12 +0100 repoview: prevent `None` to be passed as the filtername
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 11 Mar 2024 01:20:12 +0100] rev 51469
repoview: prevent `None` to be passed as the filtername We let such instantiation slip in a previous commit, so we add an explicit check to prevent it to happen in the future.
Thu, 07 Mar 2024 11:04:34 +0100 branchcache: avoid created a `None` filter repoview when writing
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 07 Mar 2024 11:04:34 +0100] rev 51468
branchcache: avoid created a `None` filter repoview when writing The repoview class is not intended to be used for unfiltered repository.
Tue, 05 Mar 2024 15:07:47 +0100 rust-index: don't use mutable borrow to computed filtered heads stable
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 05 Mar 2024 15:07:47 +0100] rev 51467
rust-index: don't use mutable borrow to computed filtered heads This does not need to mutate the index. This is the prime suspect for some RuntimeError raised during some pushes.
Tue, 05 Mar 2024 15:07:04 +0100 rust-index: don't use mutable borrow for head-diff computation stable
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 05 Mar 2024 15:07:04 +0100] rev 51466
rust-index: don't use mutable borrow for head-diff computation It does not needs to mutate the index. This is one of the two suspects of RuntimeError being thrown during push.
Mon, 26 Feb 2024 15:26:08 +0100 branchcache: move head writing in a `_write_headers` method
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 26 Feb 2024 15:26:08 +0100] rev 51465
branchcache: move head writing in a `_write_headers` method Same rational: this will help having format variants.
Mon, 26 Feb 2024 15:25:41 +0100 branchcache: move head writing in a `_write_heads` method
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 26 Feb 2024 15:25:41 +0100] rev 51464
branchcache: move head writing in a `_write_heads` method Same rational: this will help having format variants.
Mon, 26 Feb 2024 15:23:45 +0100 branchcache: move the header loading in a `_load_header` class method
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 26 Feb 2024 15:23:45 +0100] rev 51463
branchcache: move the header loading in a `_load_header` class method This will help changing header parsing in format variants.
Mon, 26 Feb 2024 15:15:10 +0100 branchcache: simplify a long line
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 26 Feb 2024 15:15:10 +0100] rev 51462
branchcache: simplify a long line Gratuitous change to help code readability.
Mon, 26 Feb 2024 15:12:20 +0100 branchcache: rename `load` to `_load_heads`
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 26 Feb 2024 15:12:20 +0100] rev 51461
branchcache: rename `load` to `_load_heads` We are about to have more similar function, we rename the existing one to a more meaningful name and mark it private in the process.
Sun, 25 Feb 2024 20:40:37 +0100 branchcache: move the filename to a class attribute
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 25 Feb 2024 20:40:37 +0100] rev 51460
branchcache: move the filename to a class attribute This prepare the introduction of more variant of cache.
Tue, 27 Feb 2024 22:52:00 +0100 test-clonebundles: simplify matching to be less flavor depends
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 27 Feb 2024 22:52:00 +0100] rev 51459
test-clonebundles: simplify matching to be less flavor depends We keep the files and bytes output for the first call, but then we mostly check that we are being served a stream-clone bundle, not the actual content and size of the bundle. That aspect being tested by the stream clone test themselves.
Sun, 25 Feb 2024 23:05:33 +0100 repoview: fix changelog.__contains__ method
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 25 Feb 2024 23:05:33 +0100] rev 51458
repoview: fix changelog.__contains__ method This have been around for ten years, so we can safely that this method have few callers. However I am about to add one.
Mon, 08 Jan 2024 15:11:34 +0100 branchcache: unconditionally write delayed branchmap
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 08 Jan 2024 15:11:34 +0100] rev 51457
branchcache: unconditionally write delayed branchmap
Sun, 25 Feb 2024 16:14:15 +0100 branchcache: drop the unused `_verifyclosed`
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 25 Feb 2024 16:14:15 +0100] rev 51456
branchcache: drop the unused `_verifyclosed` This code appears dead since its introduction about 5 years ago in this three consecutive commits: - 6578654916ae → introduce the method with two calls - 7c9d4cf23adf → remove first call - be5eeaf5c24a → remove second call o changeset: be5eeaf5c24a | user: Pulkit Goyal <pulkit@yandex-team.ru> | date: Fri Apr 05 15:57:09 2019 +0300 | summary: branchcache: don't verify closed nodes in _branchtip() | o changeset: 7c9d4cf23adf | user: Pulkit Goyal <pulkit@yandex-team.ru> | date: Fri Apr 05 15:56:33 2019 +0300 | summary: branchcache: don't verify closed nodes in iteropen() | o changeset: 6578654916ae | user: Pulkit Goyal <pulkit@yandex-team.ru> ~ date: Mon Apr 01 13:56:47 2019 +0300 summary: branchcache: lazily validate nodes from the branchmap
Mon, 26 Feb 2024 15:46:24 +0100 branchcache: dispatch the code into the dedicated subclass
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 26 Feb 2024 15:46:24 +0100] rev 51455
branchcache: dispatch the code into the dedicated subclass The code useful only to the local brancache have now been moved into the dedicated subclass. This will help improving the branchcache code without subtle breaking the remote variants.
Sun, 25 Feb 2024 14:09:36 +0100 branchcache: introduce a base class for branchmap
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 25 Feb 2024 14:09:36 +0100] rev 51454
branchcache: introduce a base class for branchmap This will help define a clear boundary between the two.
Mon, 19 Feb 2024 12:09:06 +0100 branchcache: fix the copy code
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 19 Feb 2024 12:09:06 +0100] rev 51453
branchcache: fix the copy code We copy some internal attribute along too. This should prevent inconsistency in the resulting branchmap.
Mon, 19 Feb 2024 13:11:42 +0100 branchcache: pass a "verify_node" attribut to __init__ instead of hasnode
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 19 Feb 2024 13:11:42 +0100] rev 51452
branchcache: pass a "verify_node" attribut to __init__ instead of hasnode The hasnode callback cannot be inherited and is dropped on copy, which seems like a bad idea. Instead we pass the actual semantic as a parameter and let the internal logic deal with it.
Mon, 19 Feb 2024 11:59:56 +0100 branchcache: stop storing a repository instance on the cache altogether
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 19 Feb 2024 11:59:56 +0100] rev 51451
branchcache: stop storing a repository instance on the cache altogether We did not really needed it and we do not needs it anymore at all. So lets make things simpler for consistency and garbage collecting and stop storing it altogether.
Mon, 19 Feb 2024 11:43:19 +0100 branchcache: pass the target repository when copying
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 19 Feb 2024 11:43:19 +0100] rev 51450
branchcache: pass the target repository when copying Branchmap are usually copied to be used on a different repoview using a different filter level. Passing the repository around means the repository in `branchcache._repo` will drift from the actual branchmap filter. This is currently "fine" because the repo is only used to retrieve the `nullid` value. However, this is a fairly big trap for any extension or future code using the `_repo` attribute. The replace logic is now using a copy to ensure the right repository view is used to initialized the cached value. We add a couple of assert for make sure this inconsistency does not sneak back.
Fri, 19 Jan 2024 11:30:10 +0100 branchcache: have an explicit method to update the on disk cache
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 19 Jan 2024 11:30:10 +0100] rev 51449
branchcache: have an explicit method to update the on disk cache Explicit is better and will give use more flexibility for future evolution of the storage.
Thu, 29 Feb 2024 14:13:21 -0800 crecord: drop calls to `curses.endwin()` stable
Martin von Zweigbergk <martinvonz@google.com> [Thu, 29 Feb 2024 14:13:21 -0800] rev 51448
crecord: drop calls to `curses.endwin()` We got a bug report where `curses.endwin()` failed with `_curses.error: endwin() returned ERR`. Looking at e306d552dfb12, it seems like we should be able to just remove these calls.
Mon, 04 Mar 2024 04:16:15 +0100 config: move the option to mmap rev branch cache in the storage section stable
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 04 Mar 2024 04:16:15 +0100] rev 51447
config: move the option to mmap rev branch cache in the storage section See previous commit for rational.
Mon, 04 Mar 2024 04:13:33 +0100 config: document the storage and format sections stable
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 04 Mar 2024 04:13:33 +0100] rev 51446
config: document the storage and format sections This should help people to put configuration in the right section.
Mon, 26 Feb 2024 12:59:57 +0100 rust-index: drop offset_override
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 26 Feb 2024 12:59:57 +0100] rev 51445
rust-index: drop offset_override The inline `offsets` value diverge from the one on disk for added value, so the offset_override tricks is not going to work well once we start having the full revlog logic in Rust. We remove it beforehand and align the Rust logic to the Python one (adjusting the segment offset at read time for inline revlog).
Mon, 26 Feb 2024 13:41:02 +0100 rust-index: stop calling `with_offset` in the tests
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 26 Feb 2024 13:41:02 +0100] rev 51444
rust-index: stop calling `with_offset` in the tests We are not adding any data, so why are we setting any offset?
Fri, 23 Feb 2024 15:57:50 +0100 branching: merge stable into default
Raphaël Gomès <rgomes@octobus.net> [Fri, 23 Feb 2024 15:57:50 +0100] rev 51443
branching: merge stable into default
Fri, 23 Feb 2024 15:55:53 +0100 Added signature for changeset d1d48d18db37 stable
Raphaël Gomès <rgomes@octobus.net> [Fri, 23 Feb 2024 15:55:53 +0100] rev 51442
Added signature for changeset d1d48d18db37
Fri, 23 Feb 2024 15:55:49 +0100 Added tag 6.7rc0 for changeset d1d48d18db37 stable
Raphaël Gomès <rgomes@octobus.net> [Fri, 23 Feb 2024 15:55:49 +0100] rev 51441
Added tag 6.7rc0 for changeset d1d48d18db37
Fri, 23 Feb 2024 15:18:29 +0100 relnotes: add 6.7rc0 stable 6.7rc0
Raphaël Gomès <rgomes@octobus.net> [Fri, 23 Feb 2024 15:18:29 +0100] rev 51440
relnotes: add 6.7rc0
Fri, 23 Feb 2024 15:18:17 +0100 relnotes: remove outdated message from `next` stable
Raphaël Gomès <rgomes@octobus.net> [Fri, 23 Feb 2024 15:18:17 +0100] rev 51439
relnotes: remove outdated message from `next`
Fri, 23 Feb 2024 15:10:44 +0100 branching: merge default into stable for 6.7rc0 stable
Raphaël Gomès <rgomes@octobus.net> [Fri, 23 Feb 2024 15:10:44 +0100] rev 51438
branching: merge default into stable for 6.7rc0
Fri, 23 Feb 2024 15:09:18 +0100 branching: merge stable into default
Raphaël Gomès <rgomes@octobus.net> [Fri, 23 Feb 2024 15:09:18 +0100] rev 51437
branching: merge stable into default
Fri, 23 Feb 2024 14:07:33 +0100 perf: add a --as-push option to perf::unbundle
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 23 Feb 2024 14:07:33 +0100] rev 51436
perf: add a --as-push option to perf::unbundle This turned out to make a quite significant difference.
Fri, 23 Feb 2024 06:25:09 +0100 chainsaw-update: exit early if one of the intermediate command fails
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 23 Feb 2024 06:25:09 +0100] rev 51435
chainsaw-update: exit early if one of the intermediate command fails That will prevent the user to be presented with a start that pretend to be consistent with the request, but is not.
Fri, 23 Feb 2024 03:32:35 +0100 chainsaw-update: lock the repository for the duration of the operation
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 23 Feb 2024 03:32:35 +0100] rev 51434
chainsaw-update: lock the repository for the duration of the operation This should prevent and catch some misusage where something else try to touch the repository.
Fri, 23 Feb 2024 11:41:55 +0100 chainsaw-update: taking care of initial cloning
Georges Racinet <georges.racinet@octobus.net> [Fri, 23 Feb 2024 11:41:55 +0100] rev 51433
chainsaw-update: taking care of initial cloning Perhaps we should go just a bit lower level than this `instance()`, since the main added value in our use-case is full path resolution, that we need to do anyway for the rmtree cleanup.
Fri, 23 Feb 2024 11:30:58 +0100 chainsaw-update: use a graph with branching in graph
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 23 Feb 2024 11:30:58 +0100] rev 51432
chainsaw-update: use a graph with branching in graph This will be relevant for the next improvement of `chainsaw-update`.
Wed, 17 Jan 2024 14:39:06 +0100 chainsaw-update: log actual locks breaking
Georges Racinet <georges.racinet@octobus.net> [Wed, 17 Jan 2024 14:39:06 +0100] rev 51431
chainsaw-update: log actual locks breaking Previously, the command would simply state that it was about to break locks, not if there was actually some to break. This version is race-free. It would be also possible to display the content of the lock before hand (not race-free but informative in almost all cases).
Wed, 17 Jan 2024 14:26:58 +0100 vfs: have tryunlink tell what it did
Georges Racinet <georges.racinet@octobus.net> [Wed, 17 Jan 2024 14:26:58 +0100] rev 51430
vfs: have tryunlink tell what it did It is useful in certain circumstances to know whether vfs.tryunlink() actually removed something or not, be it for logging purposes.
Sat, 26 Nov 2022 12:23:56 +0100 chainsaw: new extension for dangerous operations
Georges Racinet <georges.racinet@octobus.net> [Sat, 26 Nov 2022 12:23:56 +0100] rev 51429
chainsaw: new extension for dangerous operations The first provided command is `chainsaw-update`, whose one and single job is to make sure that it will pull, update and purge the target repository, no matter what may be in the way (locks, notably), see docstring for rationale.
Fri, 23 Feb 2024 03:45:07 +0100 rust: disable the RustIndex without persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 23 Feb 2024 03:45:07 +0100] rev 51428
rust: disable the RustIndex without persistent nodemap See rational inline.
Fri, 23 Feb 2024 03:44:56 +0100 rust: stop claiming the C index is compatible with the rust code
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 23 Feb 2024 03:44:56 +0100] rev 51427
rust: stop claiming the C index is compatible with the rust code This is no longer the case since the introduction of the pure Rust Index, and was probably not the case since the MixedIndex itself. So we fix the dedicated attribute value.
Thu, 22 Feb 2024 15:11:26 +0100 rust-index: remove one collect when converting back
Raphaël Gomès <rgomes@octobus.net> [Thu, 22 Feb 2024 15:11:26 +0100] rev 51426
rust-index: remove one collect when converting back Turns out this is slightly faster. Sending the results back to Python is still the most costly (like 75% of the time) of the whole method, but it's about as fast as it can be now. hg perf::phases on mozilla-try-2023-03-22 before: 0.267114 after: 0.247101
Thu, 22 Feb 2024 15:06:16 +0100 rust-index: improve phase computation speed
Raphaël Gomès <rgomes@octobus.net> [Thu, 22 Feb 2024 15:06:16 +0100] rev 51425
rust-index: improve phase computation speed While less memory efficient, using an array is *much* faster than using a HashMap, especially with the default hasher. It even makes the code simpler, so I'm not really sure what I was thinking in the first place, maybe it's more obvious now. This fix a significant performance regression when using the rust version of the code. (however, the C code still outperform rust on this operation) hg perf::phases on mozilla-try-2023-03-22 - 6.6.3: 0.451239 seconds - before: 0.982495 seconds - after: 0.265347 seconds - C code: 0.183241 second
Fri, 23 Feb 2024 06:37:25 +0100 phases: directly update the phase sets in advanceboundary
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 23 Feb 2024 06:37:25 +0100] rev 51424
phases: directly update the phase sets in advanceboundary This is similar to what we do in retractboundary. There is no need to invalidate the cache if we have everything at hand to update it.
Fri, 23 Feb 2024 05:25:35 +0100 phases: large rework of advance boundary
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 23 Feb 2024 05:25:35 +0100] rev 51423
phases: large rework of advance boundary In a similar spirit as the rework of retractboundary, the new algorithm is doing an amount of work in the order of magnitude of the amount of changeset that changes phases. (except to find new roots in impacted higher phases if any may exists). This result in a very significant speedup for repository with many old draft like mozilla try. runtime of perf:unbundle for a bundle constaining a single changeset (C code): before 6.7 phase work: 14.497 seconds before this change: 6.311 seconds (-55%) with this change: 2.240 seconds (-85%) Combined with the other patches that fixes the phases computation in the Rust index, the rust code with a persistent nodemap get back to quite interresting performances with 2.026 seconds for the same operation, about 10% faster than the C code.
Thu, 22 Feb 2024 19:21:14 +0100 phases: apply similar early filtering to advanceboundary
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 22 Feb 2024 19:21:14 +0100] rev 51422
phases: apply similar early filtering to advanceboundary advanceboundary is called the push's unbundle (but not the other unbundle) so advanceboundary did not show up the profile I looked at so far. We start with simple pre-filtering to avoid doing any work if we don't needs too.
Wed, 21 Feb 2024 11:09:25 +0100 phases: filter revision that are already in the right phase
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 21 Feb 2024 11:09:25 +0100] rev 51421
phases: filter revision that are already in the right phase No need to compute new roots if everything is already in order.
Wed, 21 Feb 2024 13:05:29 +0100 phases: invalidate the phases set less often on retract boundary
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 21 Feb 2024 13:05:29 +0100] rev 51420
phases: invalidate the phases set less often on retract boundary We already have the information to update the phase set, so we do so directly instead of invalidating the cache. This show a sizeable speedup in our `perf::unbundle` benchmark on the many-draft mozilla-try repository. ### data-env-vars.name = mozilla-try-2023-03-22-zstd-sparse-revlog # benchmark.name = hg.perf.perf-unbundle # bin-env-vars.hg.flavor = no-rust # bin-env-vars.hg.py-re2-module = default # benchmark.variants.issue6528 = disabled # benchmark.variants.revs = last-10 before: 2.055259 seconds after: 1.887064 seconds (-8.18%) # benchmark.variants.revs = last-100 before: 2.409239 seconds after: 2.222429 seconds (-7.75%) # benchmark.variants.revs = last-1000 before: 3.945648 seconds after: 3.762480 seconds (-4.64%)
Wed, 21 Feb 2024 13:05:23 +0100 phases: incrementally update the phase sets when reasonable
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 21 Feb 2024 13:05:23 +0100] rev 51419
phases: incrementally update the phase sets when reasonable When the amount of manual walking is small, we update the phases set manually instead of computing them from scratch. This should help small update. The next changesets will make this used more often by reducing the amount of full invalidation we do on roots upgrade. The criteria for using an incremental upgrade are arbitrary, however, it "should never hurt".
Fri, 23 Feb 2024 00:01:33 +0100 phasees: properly shallow caopy the phase sets dictionary
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 23 Feb 2024 00:01:33 +0100] rev 51418
phasees: properly shallow caopy the phase sets dictionary We are about to increments the set more incrementally in some case, so we need to make a proper shallow copy of it.
Wed, 21 Feb 2024 14:42:13 +0100 phases: pass an unfiltered repository to _ensure_phase_sets
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 21 Feb 2024 14:42:13 +0100] rev 51417
phases: pass an unfiltered repository to _ensure_phase_sets It seems better for such a low level function to be able to assume it operate on a real repository.
Wed, 21 Feb 2024 13:01:25 +0100 phases: drop set building in `hasnonpublicphases`
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 21 Feb 2024 13:01:25 +0100] rev 51416
phases: drop set building in `hasnonpublicphases` We don't actually use the set, so why do we ensure they are built? (we should also clean up the use of repository argument but that's a quest for later).
Wed, 21 Feb 2024 11:59:28 +0100 phases: gather the logic for phasesets update in a single method
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 21 Feb 2024 11:59:28 +0100] rev 51415
phases: gather the logic for phasesets update in a single method This logic is duplicated around for no good reason, we gather it in a single place. The conditional is the new function are a bit weird as we about going to extend it soon.
Thu, 22 Feb 2024 10:58:54 +0100 phases: change the way we warm the phasecache in repocache
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 22 Feb 2024 10:58:54 +0100] rev 51414
phases: change the way we warm the phasecache in repocache Same logic as for the previous chngeset. We are about to rename and change the method used here.
Thu, 22 Feb 2024 10:56:05 +0100 phases: use a more generic way to trigger a phases computation for perf
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 22 Feb 2024 10:56:05 +0100] rev 51413
phases: use a more generic way to trigger a phases computation for perf Querying the tip most revision will require the cache to warm the same as calling the dedicated method. This avoid using a method that is mostly meant for internal use and will be renamed in a coming changesets.
Wed, 21 Feb 2024 12:01:09 +0100 phases: fix an overzealous invalidation of the phase sets
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 21 Feb 2024 12:01:09 +0100] rev 51412
phases: fix an overzealous invalidation of the phase sets If `len(cl) == self._loadedrevslen` the cache is up to date.
Wed, 21 Feb 2024 11:04:56 +0100 phases: type annotation for `_phasesets`
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 21 Feb 2024 11:04:56 +0100] rev 51411
phases: type annotation for `_phasesets` Does not hurt.
Tue, 20 Feb 2024 23:46:21 +0100 phases: leverage the collected information to record phase update
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 20 Feb 2024 23:46:21 +0100] rev 51410
phases: leverage the collected information to record phase update Since the lower level function already gather this information, we can directly use it. This comes with a small change to the test that are actually fixing them. The previous version over-reported some phase change that did not exists. In both case, we are force revision `1` to be secret and `0` remains draft`, the previous code wrongly reported `0` as moving to secret while it properly remained draft in the repository.
Wed, 21 Feb 2024 10:41:09 +0100 phases: large rewrite on retract boundary
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 21 Feb 2024 10:41:09 +0100] rev 51409
phases: large rewrite on retract boundary The new code is still pure Python, so we still have room to going significantly faster. However its complexity of the complex part is `O(|[min_new_draft, tip]|)` instead of `O(|[min_draft, tip]|` which should help tremendously one repository with old draft (like mercurial-devel or mozilla-try). This is especially useful as the most common "retract boundary" operation happens when we commit/rewrite new drafts or when we push new draft to a non-publishing server. In this case, the smallest new_revs is very close to the tip and there is very few work to do. A few smaller optimisation could be done for these cases and will be introduced in later changesets. We still have iterate over large sets of roots, but this is already a great improvement for a very small amount of work. We gather information on the affected changeset as we go as we can put it to use in the next changesets. This extra data collection might slowdown the `register_new` case a bit, however for register_new, it should not really matters. The set of new nodes is either small, so the impact is negligible, or the set of new nodes is large, and the amount of work to do to had them will dominate the overhead the collecting information in `changed_revs`. As this new code compute the changes on the fly, it unlock other interesting improvement to be done in later changeset.
Thu, 22 Feb 2024 15:49:21 +0100 phases: fast path public phase advance when everything is public
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 22 Feb 2024 15:49:21 +0100] rev 51408
phases: fast path public phase advance when everything is public Everything is already public, so we have nothing to do here.
Wed, 21 Feb 2024 15:24:22 +0100 phases: fast path retract of public phase
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 21 Feb 2024 15:24:22 +0100] rev 51407
phases: fast path retract of public phase There are no boundary to retract, so lets do nothing.
Tue, 20 Feb 2024 21:40:13 +0100 phases: keep internal state as rev-num instead of node-id
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 20 Feb 2024 21:40:13 +0100] rev 51406
phases: keep internal state as rev-num instead of node-id Node-id are expensive to work with, dealing with revision is much simple and faster. The fact we still used node-id here shows how few effort have been put into making the phase logic fast. We tend to no longer use node-id internally for about ten years. This has a large impact of repository with many draft roots. For example this Mozilla-try copy have ½ Million draft roots and `perf::unbundle` see a significant improvement. ### data-env-vars.name = mozilla-try-2023-03-22-zstd-sparse-revlog # benchmark.name = hg.perf.perf-unbundle # bin-env-vars.hg.flavor = no-rust # bin-env-vars.hg.py-re2-module = default # benchmark.variants.issue6528 = disabled # benchmark.variants.revs = last-1 before:: 1.746791 seconds after:: 1.278379 seconds (-26.82%) # benchmark.variants.revs = last-10 before:: 3.145774 seconds after:: 2.103735 seconds (-33.13%) # benchmark.variants.revs = last-100 before:: 3.487635 seconds after:: 2.446749 seconds (-29.85%) # benchmark.variants.revs = last-1000 before:: 5.007568 seconds after:: 3.989923 seconds (-20.32%)
Tue, 20 Feb 2024 21:40:08 +0100 phases: do filtering at read time
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 20 Feb 2024 21:40:08 +0100] rev 51405
phases: do filtering at read time This remove the need for the `filterunknown` method at all.
Tue, 20 Feb 2024 21:38:01 +0100 phases: always write with a repo
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 20 Feb 2024 21:38:01 +0100] rev 51404
phases: always write with a repo In the future change that move the internal representation of phase-roots from node-id to rev-num, we will use a repository to translate revision numbers back to node at write time. Since that future change is quite complicated already, we do this small API change beforehand.
Tue, 20 Feb 2024 17:18:15 +0100 phases: mark `phasecache.phaseroots` private
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 20 Feb 2024 17:18:15 +0100] rev 51403
phases: mark `phasecache.phaseroots` private We are about to change its content from nodeid to revnum. So anyone directly using the content might be in unexpected troubles. We start by making it private to explicitly break any such user (and discourage them to do so).
Tue, 20 Feb 2024 17:17:54 +0100 phases: check secret presence the right way during discovery
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 20 Feb 2024 17:17:54 +0100] rev 51402
phases: check secret presence the right way during discovery There is an official function for this, lets use it. This will prevent the code to break in the future while we refactor the phase code.
Tue, 20 Feb 2024 14:21:18 +0100 phases: explicitly filter stripped revision at strip time
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 20 Feb 2024 14:21:18 +0100] rev 51401
phases: explicitly filter stripped revision at strip time Explicit is better than implicit. The current logic is bit subtle and fragile. It also get in the way of using something else than node-id as internal storage. We replace it with a more explicit filtering while striping.
Fri, 23 Feb 2024 04:26:03 +0100 debug: add a debug::unbundle command that simulate the unbundle from a push
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 23 Feb 2024 04:26:03 +0100] rev 51400
debug: add a debug::unbundle command that simulate the unbundle from a push The code have different behavior when the unbundle comes from a push, so we introduce a command that can simulate such unbundle. For our copy of mozilla-try-2023-03-22, this make the unbundle jump from 2.5 seconds (with `hg unbundle`) to 15 seconds (with `hg debug::unbundle`). That 15 seconds timings is consistent with the issue seen in production.
Thu, 22 Feb 2024 18:28:01 +0100 perf: support --template on perf::phases stable
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 22 Feb 2024 18:28:01 +0100] rev 51399
perf: support --template on perf::phases
Wed, 14 Feb 2024 08:14:46 +0100 annotate: limit output to range of lines
Zeger Van de Vannet <zeger@vandevan.net> [Wed, 14 Feb 2024 08:14:46 +0100] rev 51398
annotate: limit output to range of lines
Mon, 12 Feb 2024 20:01:27 +0000 revlog: add a Rust implementation of `headrevsdiff`
Arseniy Alekseyev <aalekseyev@janestreet.com> [Mon, 12 Feb 2024 20:01:27 +0000] rev 51397
revlog: add a Rust implementation of `headrevsdiff` Python implementation of `headrevsdiff` can be very slow in the worst case compared with the `heads` computation it replaces, since the latter is done in Rust. Even the average case of this Python implementation is still noticeable in the profiles. This patch makes the computation much much faster by doing it in Rust.
Thu, 21 Dec 2023 20:30:03 +0000 revlog: add a C implementation of `headrevsdiff`
Arseniy Alekseyev <aalekseyev@janestreet.com> [Thu, 21 Dec 2023 20:30:03 +0000] rev 51396
revlog: add a C implementation of `headrevsdiff` Python implementation of `headrevsdiff` can be very slow in the worst case compared with the `heads` computation it replaces, since the latter is done in C. Even the average case of this Python implementation is still noticeable in the profiles. This patch makes the computation much much faster by doing it in C.
Thu, 21 Dec 2023 17:38:04 +0000 unbundle: faster computation of changed heads
Arseniy Alekseyev <aalekseyev@janestreet.com> [Thu, 21 Dec 2023 17:38:04 +0000] rev 51395
unbundle: faster computation of changed heads To compute the set of changed heads it's sufficient to look at the recent commits, instead of looking at all heads currently in existence.
Wed, 21 Feb 2024 11:53:30 +0100 branching: merge stable into default
Raphaël Gomès <rgomes@octobus.net> [Wed, 21 Feb 2024 11:53:30 +0100] rev 51394
branching: merge stable into default
Tue, 20 Feb 2024 10:47:47 -0500 hg-core: separate timestamp and extra methods
Arun Kulshreshtha <akulshreshtha@janestreet.com> [Tue, 20 Feb 2024 10:47:47 -0500] rev 51393
hg-core: separate timestamp and extra methods
Wed, 21 Feb 2024 02:12:58 +0100 debugformat: fix formatting for compression level stable
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 21 Feb 2024 02:12:58 +0100] rev 51392
debugformat: fix formatting for compression level `bytes(<int>)` gives a very different result as `str(<int>)` and the display of `hg debugformat` have been broken for a while as a result.
Thu, 15 Feb 2024 11:39:18 -0500 hg-core: implement timestamp line parsing
Arun Kulshreshtha <akulshreshtha@janestreet.com> [Thu, 15 Feb 2024 11:39:18 -0500] rev 51391
hg-core: implement timestamp line parsing
Wed, 14 Feb 2024 15:21:44 -0500 doc: document that labels must have a dot in them to have an effect
Jordi Gutiérrez Hermoso <jordigh@octave.org> [Wed, 14 Feb 2024 15:21:44 -0500] rev 51390
doc: document that labels must have a dot in them to have an effect I noticed that the `hg topics` template has a bare `topic` label with no dot, and that makes it useless, as such a label will never receive any effect by the colour extension. This dot has been required for a long time, at least since 2011, but we never formally documented it!
Thu, 15 Feb 2024 18:10:41 +0000 tests: tweak chg test to make it fail less often stable
Arseniy Alekseyev <aalekseyev@janestreet.com> [Thu, 15 Feb 2024 18:10:41 +0000] rev 51389
tests: tweak chg test to make it fail less often the test apparently sometimes prints the word "start" as a part of profile, so let's no longer match "start": CHGHG=/*/install/bin/hg (glob) + \x1b[90m | 50.0% 0.01s profiling.py: __enter__ line 196: self.start()\x1b[0m (esc) + \x1b[90m | 50.0% 0.01s profiling.py: start line 261: self._profiler.__enter__()\x1b[0m (esc) + \x1b[90m | 50.0% 0.01s profiling.py: statprofile line 125: statprof.start(mechanism=b'...\x1b[0m (esc) + \x1b[90m | 50.0% 0.01s statprof.py: start line 356: state.thread.start()\x1b[0m (esc) + \x1b[90m | 50.0% 0.01s threading.py: start line 852: self._started.wait()\x1b[0m (esc)
Thu, 15 Feb 2024 15:21:43 +0000 cext: fix potential memory leaks of list items appended with PyList_Append stable
Arseniy Alekseyev <aalekseyev@janestreet.com> [Thu, 15 Feb 2024 15:21:43 +0000] rev 51388
cext: fix potential memory leaks of list items appended with PyList_Append Also reduce the duplication in the tricky code that uses PyList_Append by extracting it into a function `pylist_append_owned`.
Wed, 14 Feb 2024 22:55:11 -0500 crecord: enable search hotkeys (issue6834)
Jordi Gutiérrez Hermoso <jordigh@octave.org> [Wed, 14 Feb 2024 22:55:11 -0500] rev 51387
crecord: enable search hotkeys (issue6834) The keys I chose here should be similar to less/vim keybindings, which should fit the overall keybinding theme of crecord.
Wed, 14 Feb 2024 22:54:21 -0500 crecord: add handle(next|prev)search functions
Jordi Gutiérrez Hermoso <jordigh@octave.org> [Wed, 14 Feb 2024 22:54:21 -0500] rev 51386
crecord: add handle(next|prev)search functions These are now just simple wrappers around `searchdirection`
Wed, 14 Feb 2024 22:53:58 -0500 crecord: add a searchdirection function
Jordi Gutiérrez Hermoso <jordigh@octave.org> [Wed, 14 Feb 2024 22:53:58 -0500] rev 51385
crecord: add a searchdirection function If a regex has already been previously set, this function handles the UI elements of searching again forward or backward.
Wed, 14 Feb 2024 22:50:00 -0500 crecord: add a handlesearch function
Jordi Gutiérrez Hermoso <jordigh@octave.org> [Wed, 14 Feb 2024 22:50:00 -0500] rev 51384
crecord: add a handlesearch function This function sets up some of the UI, such as getting the search string from the user and displaying results or their absence.
Wed, 14 Feb 2024 22:48:09 -0500 crecord: add a showsearch function
Jordi Gutiérrez Hermoso <jordigh@octave.org> [Wed, 14 Feb 2024 22:48:09 -0500] rev 51383
crecord: add a showsearch function This function takes a regex and searches either forward or backward, moving the current item to the found item, if any, and unfolding the relevant context.
Wed, 14 Feb 2024 22:46:41 -0500 crecord: add a default regex to curseschunkselector
Jordi Gutiérrez Hermoso <jordigh@octave.org> [Wed, 14 Feb 2024 22:46:41 -0500] rev 51382
crecord: add a default regex to curseschunkselector Whether there is a regex to search or not will affect if we can find the next or the previous search hit.
Wed, 14 Feb 2024 22:43:51 -0500 crecord: add `content` properties to all nodes
Jordi Gutiérrez Hermoso <jordigh@octave.org> [Wed, 14 Feb 2024 22:43:51 -0500] rev 51381
crecord: add `content` properties to all nodes In order to have a unified API of what can be searched, let's provide a `content` property to each node type. This way we can search filenames, context headers (e.g. containing function names, if deducible from patch context) or changed lines themselves.
Wed, 14 Feb 2024 22:42:08 -0500 crecord: update uiheader docstring
Jordi Gutiérrez Hermoso <jordigh@octave.org> [Wed, 14 Feb 2024 22:42:08 -0500] rev 51380
crecord: update uiheader docstring There's no need to move anything to patch.py. The uiheader class only has methods relevant to crecord and overrides __getattr__ in order to use `patch.header` objects as a sort of mixin.
Wed, 14 Feb 2024 22:40:47 -0500 crecord: add skipfolded param to previtem
Jordi Gutiérrez Hermoso <jordigh@octave.org> [Wed, 14 Feb 2024 22:40:47 -0500] rev 51379
crecord: add skipfolded param to previtem This just simplifies the API a bit so it matches `nextitem` and I can handle both nextitem and previtem symmetrically.
Wed, 14 Feb 2024 15:23:59 -0500 dispatch: don't attempt to import debugger as bytestring
Jordi Gutiérrez Hermoso <jordigh@octave.org> [Wed, 14 Feb 2024 15:23:59 -0500] rev 51378
dispatch: don't attempt to import debugger as bytestring The __import__ thingie needs a string, not a bytestring. Guess I'm the only one who uses this once in a while and noticed it was broken.
Wed, 14 Feb 2024 11:53:04 -0500 debugsetparents: fix Marmoutian docstring
Jordi Gutiérrez Hermoso <jordigh@octave.org> [Wed, 14 Feb 2024 11:53:04 -0500] rev 51377
debugsetparents: fix Marmoutian docstring Just some light proofreading.
Tue, 13 Feb 2024 11:49:55 -0800 docs: fix broken `make` in `docs/`
Martin von Zweigbergk <martinvonz@google.com> [Tue, 13 Feb 2024 11:49:55 -0800] rev 51376
docs: fix broken `make` in `docs/` We had some wrapped lines without blank lines between, which made the runrst script think the list was not a list and it got confused about the indentation. I added blank lines, and also some other minor styling for consistency with the rest of the file.
Wed, 10 Jan 2024 18:58:42 +0000 branchmap: use mmap for faster revbranchcache loading
Arseniy Alekseyev <aalekseyev@janestreet.com> [Wed, 10 Jan 2024 18:58:42 +0000] rev 51375
branchmap: use mmap for faster revbranchcache loading A typical revbranchmap usage is: - load the entire revbranchmap file into memory - maybe do a few lookups - add a few bytes to it - write the addition to disk There's no reason to load the entire revbranchmap into memory. We can split it into a large immutable prefix and a mutable suffix, and then memorymap the prefix, thus saving all the useless loading. Benchmarking on some real-world pushes suggests that out of ~100s server-side push handling revbranchcache handling is responsible for: * ~7s with no change * ~1.3s with the change, without mmap * 0.04s with the change, with mmap
Fri, 02 Feb 2024 04:46:54 +0100 hghave: add py312 and py313
Manuel Jacob <me@manueljacob.de> [Fri, 02 Feb 2024 04:46:54 +0100] rev 51374
hghave: add py312 and py313 While not required in the core test suite in the moment, these could be useful in the future or for extensions. For example, Python 3.12 removed distutils and it might make sense to differentiate based on that.
Fri, 02 Feb 2024 04:23:07 +0100 hghave: use strings instead of floats for version numbers passed to checkvers
Manuel Jacob <me@manueljacob.de> [Fri, 02 Feb 2024 04:23:07 +0100] rev 51373
hghave: use strings instead of floats for version numbers passed to checkvers I think it’s a really bad idea to use floats for version numbers. One problem is that 3.10 is the same as 3.1.
Sat, 03 Feb 2024 23:45:08 +0100 py3: fully port doctest to py3
Manuel Jacob <me@manueljacob.de> [Sat, 03 Feb 2024 23:45:08 +0100] rev 51372
py3: fully port doctest to py3
Fri, 02 Feb 2024 04:03:15 +0100 import-checker: make stdlib path detection work in virtual environments
Manuel Jacob <me@manueljacob.de> [Fri, 02 Feb 2024 04:03:15 +0100] rev 51371
import-checker: make stdlib path detection work in virtual environments The previous logic tried to find the directory containing BaseHTTPServer, which didn’t work as indended because it was only present on Python 2. Instead, the argparse module is used now.
Fri, 02 Feb 2024 03:39:37 +0100 cleanup: remove unnecessary list constructor calls around list comprehensions
Manuel Jacob <me@manueljacob.de> [Fri, 02 Feb 2024 03:39:37 +0100] rev 51370
cleanup: remove unnecessary list constructor calls around list comprehensions
Mon, 12 Feb 2024 16:22:47 +0100 branching: merge stable into default
Raphaël Gomès <rgomes@octobus.net> [Mon, 12 Feb 2024 16:22:47 +0100] rev 51369
branching: merge stable into default
Mon, 12 Feb 2024 16:17:08 +0100 Added signature for changeset 3fd1efb3ad12 stable
Raphaël Gomès <rgomes@octobus.net> [Mon, 12 Feb 2024 16:17:08 +0100] rev 51368
Added signature for changeset 3fd1efb3ad12
Mon, 12 Feb 2024 16:16:10 +0100 Added tag 6.6.3 for changeset 3fd1efb3ad12 stable
Raphaël Gomès <rgomes@octobus.net> [Mon, 12 Feb 2024 16:16:10 +0100] rev 51367
Added tag 6.6.3 for changeset 3fd1efb3ad12
Mon, 12 Feb 2024 16:14:18 +0100 relnotes: add 6.6.3 stable 6.6.3
Raphaël Gomès <rgomes@octobus.net> [Mon, 12 Feb 2024 16:14:18 +0100] rev 51366
relnotes: add 6.6.3
Mon, 08 Jan 2024 15:25:33 +0000 tests: fix nondeterministic test failure in test-contrib-perf.t stable
Arseniy Alekseyev <aalekseyev@janestreet.com> [Mon, 08 Jan 2024 15:25:33 +0000] rev 51365
tests: fix nondeterministic test failure in test-contrib-perf.t It turns out (not too shockingly!) the kernel sometimes has some work to do, perhaps at the very least context-switching, so asserting the system time is 0.000000 doesn't work.
Thu, 01 Feb 2024 19:35:35 -0500 grep: restore usage of --include/--exclude options stable
Jordi Gutiérrez Hermoso <jordigh@octave.org> [Thu, 01 Feb 2024 19:35:35 -0500] rev 51364
grep: restore usage of --include/--exclude options The refactor in 4a73df6eb67d accidentally forgot to transform the opts argument for walkopts into a byteskwargs. This resulted in its options being ignored. In particular, the -X/-I pair of options was missing. A simple fix restores its usage. Tests included, of course.
Tue, 30 Jan 2024 22:14:02 +0000 rust-changelog: don't panic on empty file lists stable
Arun Kulshreshtha <akulshreshtha@janestreet.com> [Tue, 30 Jan 2024 22:14:02 +0000] rev 51363
rust-changelog: don't panic on empty file lists
Wed, 24 Jan 2024 13:49:29 -0300 tests: use sha256line.py instead of /dev/random in test-censor.t (issue6858) stable
Anton Shestakov <av6@dwimlabs.net> [Wed, 24 Jan 2024 13:49:29 -0300] rev 51362
tests: use sha256line.py instead of /dev/random in test-censor.t (issue6858) Sometimes the systems that run our test suite don't have enough entropy and they cannot produce target file of the expected size using /dev/random, which results in test failures. Switching to /dev/urandom would give us way more available data at the cost of it being less "random", but we don't really need to use entropy for this task at all, since we only care if the file size after compression is big enough to not be stored inline in the revlog. So let's use something that we already have used to generate this kind of data in other tests.
Wed, 24 Jan 2024 13:35:30 -0300 tests: make sha256line.py available for all tests stable
Anton Shestakov <av6@dwimlabs.net> [Wed, 24 Jan 2024 13:35:30 -0300] rev 51361
tests: make sha256line.py available for all tests This was previously only used in test-revlog-delta-find.t, but it will be useful (and used) in other tests that might need to generate poorly-compressible files.
Thu, 23 Nov 2023 22:51:01 +0100 delta-find: pass the full deltainfo to the _DeltaSearch class
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 23 Nov 2023 22:51:01 +0100] rev 51360
delta-find: pass the full deltainfo to the _DeltaSearch class Having more information is better, so we pass it directly.
Sun, 07 Jan 2024 05:20:00 +0100 delta-find: move sparse-revlog pre-filtering in the associated class
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 07 Jan 2024 05:20:00 +0100] rev 51359
delta-find: move sparse-revlog pre-filtering in the associated class Lets move the specialized code in the specialized class.
Sun, 07 Jan 2024 05:16:08 +0100 delta-find: move sparse-revlog delta checks in the associated class
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 07 Jan 2024 05:16:08 +0100] rev 51358
delta-find: move sparse-revlog delta checks in the associated class Lets move the specialized code in the specialized class.
Sun, 07 Jan 2024 04:39:18 +0100 delta-find: split the _DeltaSearch class in two
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 07 Jan 2024 04:39:18 +0100] rev 51357
delta-find: split the _DeltaSearch class in two We now have things sliced small enough to have two class that use different `_iter_groups` implementation to encode their different logic. The filtering code remains to be moved, but I would rather keep this changeset simple and move them in the next.
Thu, 23 Nov 2023 22:40:11 +0100 delta-find: finish reworking the snapshot logic and drop more layer
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 23 Nov 2023 22:40:11 +0100] rev 51356
delta-find: finish reworking the snapshot logic and drop more layer The refining logic only applies to the snapshot logic, and this is now all contained in a dedicated method. Along the way, we drop the refined_groups // raw_groups layer as they no longer make sense. The result is a more explicit `iter_groups` method. This conclude the splitting and simplification of the groups generation. We are now ready to dispatch this in more diverse classes.
Thu, 23 Nov 2023 22:29:02 +0100 delta-find: move the base of the delta search in its own function
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 23 Nov 2023 22:29:02 +0100] rev 51355
delta-find: move the base of the delta search in its own function That logic is complicated enough that is is worth puting in its own function. Another method will be introduced in the next changeset to deal with the actual refining.
Thu, 23 Nov 2023 21:44:51 +0100 delta-find: move the emotion of prev in a dedicated method
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 23 Nov 2023 21:44:51 +0100] rev 51354
delta-find: move the emotion of prev in a dedicated method After splitting the filtering, and with the `_candidate_groups` layer removed, we can start splitting the group generation too. This helps to organize this code and make it easier to modifying the future.
Thu, 23 Nov 2023 21:51:43 +0100 delta-find: move the emotion of parents in a dedicated method
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 23 Nov 2023 21:51:43 +0100] rev 51353
delta-find: move the emotion of parents in a dedicated method After splitting the filtering, and with the `_candidate_groups` layer removed, we can start splitting the group generation too. This helps to organize this code and make it easier to modifying the future.
Sun, 07 Jan 2024 03:08:46 +0100 delta-find: explicitly deal with usage of the cached revision
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 07 Jan 2024 03:08:46 +0100] rev 51352
delta-find: explicitly deal with usage of the cached revision We can remove this from the general logic path and directly deal with this corner case early. This result in a small change in test-generaldelta.t as it turns out that: - at commit time we (sometimes) precompute a delta against p1 and pass it as the cached delta. - since cached delta where going through the same filtering as everything, we could "optimize" the base if it applied to an empty delta, resulting in not using the pre-computed delta. The simpler logic fix the second item, making the cached delta base always actually tested when requested. Note that the computation of a fast delta against p1 only is questionable, but looking into that is out of scope for this series.
Sun, 07 Jan 2024 03:02:30 +0100 delta-find: remove the "candidate groups" layer
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 07 Jan 2024 03:02:30 +0100] rev 51351
delta-find: remove the "candidate groups" layer We have enough pieces to remove this generator and directly bear it load using the underlying object.
Sun, 07 Jan 2024 03:13:36 +0100 delta-find: stop using heuristic to determine if we are creating a snapshot
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 07 Jan 2024 03:13:36 +0100] rev 51350
delta-find: stop using heuristic to determine if we are creating a snapshot This avoid assuming a changeset is a snapshot when it is actually something simpler.
Sun, 07 Jan 2024 02:38:38 +0100 delta-find: explicitly track stage of the search
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 07 Jan 2024 02:38:38 +0100] rev 51349
delta-find: explicitly track stage of the search Being more explicit about what we are doing is going to be useful. We actually start making use of it in later changesets.
Thu, 23 Nov 2023 20:09:34 +0100 delta-find: drop some dead debug code
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 23 Nov 2023 20:09:34 +0100] rev 51348
delta-find: drop some dead debug code Seems like it was never put to use, so lets simply remove it for now.
Sun, 07 Jan 2024 03:34:27 +0100 delta-find: introduce and use specialized _DeltaSearch class
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 07 Jan 2024 03:34:27 +0100] rev 51347
delta-find: introduce and use specialized _DeltaSearch class For now, we introduce some very simple variant, but they are still useful to display how having the class can helps keeping the simple case simple and their special case out of more advanced logic.
Sun, 07 Jan 2024 01:05:10 +0100 delta-find: introduce a base class for _DeltaSearch
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 07 Jan 2024 01:05:10 +0100] rev 51346
delta-find: introduce a base class for _DeltaSearch This prepare the introduction of specialized the class in the next changesets.
Sun, 07 Jan 2024 03:23:24 +0100 delta-find: simplify the delta checking function for snapshot
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 07 Jan 2024 03:23:24 +0100] rev 51345
delta-find: simplify the delta checking function for snapshot Since the function is all about snapshot, we can safely use an early return and make the result simpler.
Sun, 07 Jan 2024 00:56:15 +0100 delta-find: move good delta code earlier in the class
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 07 Jan 2024 00:56:15 +0100] rev 51344
delta-find: move good delta code earlier in the class Nothing change except the code location. This greatly helps readability of the next future diff,
Thu, 04 Jan 2024 17:20:30 +0100 delta-find: split is_good_delta_info into more thematic function
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 04 Jan 2024 17:20:30 +0100] rev 51343
delta-find: split is_good_delta_info into more thematic function Same logic as for candidate filtering, we group code into related sub method. This will help clarifying later patches as some logic is pre-splitted
Thu, 04 Jan 2024 15:35:57 +0100 delta-find: clarify some comment and code in is_good_delta_info
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 04 Jan 2024 15:35:57 +0100] rev 51342
delta-find: clarify some comment and code in is_good_delta_info We move the comment closer to the code it describ and we compute an intermediate value without using the `textlen` variable, as it will stop being defined in a future patch. This will clarify future patches.
Thu, 04 Jan 2024 15:35:36 +0100 delta-find: move delta size check earlier in is_good_delta_info
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 04 Jan 2024 15:35:36 +0100] rev 51341
delta-find: move delta size check earlier in is_good_delta_info This will clarify future patches by regrouping related logic before larger movement.
Thu, 04 Jan 2024 15:04:10 +0100 delta-find: split the delta-chain part of `_pre_filter_rev` in a method
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 04 Jan 2024 15:04:10 +0100] rev 51340
delta-find: split the delta-chain part of `_pre_filter_rev` in a method Since `_pre_filter_rev` contains logic from various sources of constraint, we start splitting is in subfunction to clarify and document the grouping.
Thu, 04 Jan 2024 14:51:48 +0100 delta-find: split the "sparse" part of `_pre_filter_rev` in a method
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 04 Jan 2024 14:51:48 +0100] rev 51339
delta-find: split the "sparse" part of `_pre_filter_rev` in a method Since `_pre_filter_rev` contains logic from various sources of constraint, we start splitting is in subfunction to clarify and document the grouping.
Thu, 23 Nov 2023 18:56:31 +0100 delta-find: split the generic part of `_pre_filter_rev` in a method
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 23 Nov 2023 18:56:31 +0100] rev 51338
delta-find: split the generic part of `_pre_filter_rev` in a method Since `_pre_filter_rev` contains logic from various sources of constraint, we start splitting is in subfunction to clarify and document the grouping.
Thu, 04 Jan 2024 14:39:10 +0100 delta-find: drop the temporary indent
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 04 Jan 2024 14:39:10 +0100] rev 51337
delta-find: drop the temporary indent Now that the complicated change is made, we can do the noisy one.
Thu, 23 Nov 2023 18:40:47 +0100 delta-find: move pre-filtering of individual revision in its own function
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 23 Nov 2023 18:40:47 +0100] rev 51336
delta-find: move pre-filtering of individual revision in its own function This goes one step further than the previous change by making the pre-filtering of individual candicates revision in its own function. This will allow subclass to easily configure this filtering with their own constrains. The `if True:` part help the readability of this diff a lot and will be drop in to the next changesets.
Thu, 23 Nov 2023 04:21:07 +0100 delta-find: move pre-filtering of candidates in its own function
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 23 Nov 2023 04:21:07 +0100] rev 51335
delta-find: move pre-filtering of candidates in its own function This organise the code further and open the way to specialization via sub-classing. Something important for the coming changes.
Fri, 29 Dec 2023 13:35:08 +0100 delta-find: move away from the generator API for _DeltaSearch
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 29 Dec 2023 13:35:08 +0100] rev 51334
delta-find: move away from the generator API for _DeltaSearch We use more explicit function call. This make operations more explicit and will make future refactoring simpler.
Thu, 23 Nov 2023 21:13:14 +0100 delta-find: use "-1" as depth snapshot-dept for non snapshot in debug
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 23 Nov 2023 21:13:14 +0100] rev 51333
delta-find: use "-1" as depth snapshot-dept for non snapshot in debug This will help do distinct full snapshot (level 0) and normal delta (not a snapshot, no snapshot level)
Thu, 23 Nov 2023 21:45:45 +0100 delta-find: fix the computation of the `prev` value
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 23 Nov 2023 21:45:45 +0100] rev 51332
delta-find: fix the computation of the `prev` value The previous computation was "wrong" it always used the tiprev, even when computing a delta in a non-append case (mostly benchmark). This never produced wrong delta on disk, but would misled debug or performance command. Since it does not have any actual user impact, I did not put this on stable. With the code fixed we can now use revisions in some search and it makes the test display more interesting behavior since the algorithm has more to work with.
Fri, 22 Dec 2023 01:33:40 +0100 delta-find: move is_good_delta_info on the _DeltaSearch class
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 22 Dec 2023 01:33:40 +0100] rev 51331
delta-find: move is_good_delta_info on the _DeltaSearch class There is a lot of format specific code in `is_good_delta_info`, moving it on _DeltaSearch will allow to split this into subclass soon.
Fri, 22 Dec 2023 01:33:33 +0100 delta-find: feed revinfo to _DeltaSearch
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 22 Dec 2023 01:33:33 +0100] rev 51330
delta-find: feed revinfo to _DeltaSearch The revinfo has more information and will allow for even more function to be turned into method.
Thu, 23 Nov 2023 03:23:11 +0100 delta-find: clarify that revisioninfo.p1/p2 constains nodeid
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 23 Nov 2023 03:23:11 +0100] rev 51329
delta-find: clarify that revisioninfo.p1/p2 constains nodeid This clarify the content of these attributes.
Thu, 23 Nov 2023 03:23:41 +0100 delta-find: move filing of some debug data in `_one_dbg_data`
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 23 Nov 2023 03:23:41 +0100] rev 51328
delta-find: move filing of some debug data in `_one_dbg_data` Since the `_one_dbg_data` method is meant to create a valid debug dictionnary. We can as well prefill the relevant value to reduce the amount of debug code in the main code.
Thu, 23 Nov 2023 01:28:30 +0100 delta-find: add more explanation to the the deltas_limit < length check
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 23 Nov 2023 01:28:30 +0100] rev 51327
delta-find: add more explanation to the the deltas_limit < length check More explanations is always good.
Thu, 23 Nov 2023 01:13:40 +0100 delta-find: move tested in the _DeltaSearch.__init__
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 23 Nov 2023 01:13:40 +0100] rev 51326
delta-find: move tested in the _DeltaSearch.__init__ Now that we have an object we can initialize that attribute at initialization time. This will make it available for more method in the future, allowing to split the code.
Mon, 20 Nov 2023 05:05:29 +0100 delta-find: check DELTA_BASE_REUSE_FORCE in the _DeltaSearch.__init__
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 20 Nov 2023 05:05:29 +0100] rev 51325
delta-find: check DELTA_BASE_REUSE_FORCE in the _DeltaSearch.__init__ Now that we have an object we can check that DELTA_BASE_REUSE_FORCE cases does not reach this code at in a more suitable location.
Mon, 20 Nov 2023 05:04:23 +0100 delta-find: move target_rev in the _DeltaSearch.__init__
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 20 Nov 2023 05:04:23 +0100] rev 51324
delta-find: move target_rev in the _DeltaSearch.__init__ Now that we have an object we can initialize that attribute at initialization time.
Mon, 20 Nov 2023 05:03:21 +0100 delta-find: move snapshot_cache in the _DeltaSearch.__init__
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 20 Nov 2023 05:03:21 +0100] rev 51323
delta-find: move snapshot_cache in the _DeltaSearch.__init__ Now that we have an object we can initialize that attribute at initialization time.
Mon, 20 Nov 2023 04:59:25 +0100 delta-find: move `_rawgroups` on the `_DeltaSearch` object
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 20 Nov 2023 04:59:25 +0100] rev 51322
delta-find: move `_rawgroups` on the `_DeltaSearch` object Moving more code before doing more logic changes.
Mon, 20 Nov 2023 04:53:11 +0100 delta-find: move `_refinedgroups` on the `_DeltaSearch` object
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 20 Nov 2023 04:53:11 +0100] rev 51321
delta-find: move `_refinedgroups` on the `_DeltaSearch` object Moving more code before doing more logic changes.
Mon, 20 Nov 2023 04:44:40 +0100 delta-find: introduce a _DeltaSearch object
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 20 Nov 2023 04:44:40 +0100] rev 51320
delta-find: introduce a _DeltaSearch object That object represent the search of a good delta for one revision. It will replace the interleaved generator currently in use. It will make the logic more explicit and easier to split into different subclass for the algorithm variant. We will move content gradually before doing deeper rework. For now, we only move the `_candidategroups` function here. More will follow in the same series.
Fri, 22 Dec 2023 12:58:54 +0100 delta-find: add a small docstring to deltacomputer
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 22 Dec 2023 12:58:54 +0100] rev 51319
delta-find: add a small docstring to deltacomputer As we are about to introduce another object related to finding delta. So lets have a minimal docstring to the existing one.
Thu, 11 Jan 2024 16:41:54 +0100 revlog: stop using `atomictmp` for the split revlog
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 11 Jan 2024 16:41:54 +0100] rev 51318
revlog: stop using `atomictmp` for the split revlog Since we already manually deal with writing on the side and delaying visibily, we no longer need this.
Thu, 11 Jan 2024 16:39:31 +0100 changelog: drop the side_write argument to revlog splitting
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 11 Jan 2024 16:39:31 +0100] rev 51317
changelog: drop the side_write argument to revlog splitting The only user is now gone.
Thu, 11 Jan 2024 16:35:52 +0100 changelog: stop useless enforcing split at the end of transaction
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 11 Jan 2024 16:35:52 +0100] rev 51316
changelog: stop useless enforcing split at the end of transaction Changelogs are no longer created inline, and existing changelogs are automatically split. Since we now enforce splitting at the start of any write, we don't need to enforce splitting at the end of the transaction. This has the nice side effect of killing the only user of "side_write".
Sun, 14 Jan 2024 16:03:08 -0300 tests: don't use "status" operand of dd in test-censor.t (issue6858) stable
Anton Shestakov <av6@dwimlabs.net> [Sun, 14 Jan 2024 16:03:08 -0300] rev 51315
tests: don't use "status" operand of dd in test-censor.t (issue6858) Some implementations don't have this operand, let's just direct stderr into /dev/null, that's pretty cross-platform. Also specify bs=512 (the default for me), because the default might be different on different systems. Other uses of dd in the tests do specify it, so this is more consistent.
Thu, 11 Jan 2024 17:52:13 +0100 branching: merge stable into default
Raphaël Gomès <rgomes@octobus.net> [Thu, 11 Jan 2024 17:52:13 +0100] rev 51314
branching: merge stable into default
Thu, 11 Jan 2024 17:49:51 +0100 Added signature for changeset 136902b3a95d stable
Raphaël Gomès <rgomes@octobus.net> [Thu, 11 Jan 2024 17:49:51 +0100] rev 51313
Added signature for changeset 136902b3a95d
Thu, 11 Jan 2024 17:49:37 +0100 Added tag 6.6.2 for changeset 136902b3a95d stable
Raphaël Gomès <rgomes@octobus.net> [Thu, 11 Jan 2024 17:49:37 +0100] rev 51312
Added tag 6.6.2 for changeset 136902b3a95d
Thu, 11 Jan 2024 17:49:04 +0100 relnotes: add 6.6.2 stable 6.6.2
Raphaël Gomès <rgomes@octobus.net> [Thu, 11 Jan 2024 17:49:04 +0100] rev 51311
relnotes: add 6.6.2
Wed, 03 Jan 2024 18:33:39 +0100 pycompat: fix bytestr(bytes) in Python 3.11 stable
Georges Racinet <georges.racinet@octobus.net> [Wed, 03 Jan 2024 18:33:39 +0100] rev 51310
pycompat: fix bytestr(bytes) in Python 3.11 In Python 3.10, the `bytes` type itself does not have a `__bytes__` attribute, but it does in 3.11. Yet `bytes(bytes)` does not give the wished output, so we have to add an exceptional case. The added case in the doctest reproduces the problem with Python 3.11. Impact: error treatment in expressions such as `repo[b'invalid']` gets broken.
Thu, 04 Jan 2024 14:45:31 -0500 narrow: prevent removal of ACL-defined excludes stable
Arun Kulshreshtha <akulshreshtha@janestreet.com> [Thu, 04 Jan 2024 14:45:31 -0500] rev 51309
narrow: prevent removal of ACL-defined excludes
Thu, 04 Jan 2024 14:41:18 -0500 narrow: add test demonstrating bug in acl exclusion enforcement stable
Arun Kulshreshtha <akulshreshtha@janestreet.com> [Thu, 04 Jan 2024 14:41:18 -0500] rev 51308
narrow: add test demonstrating bug in acl exclusion enforcement
Mon, 08 Jan 2024 13:35:02 +0100 contrib: add a set of scripts to run pytype in Docker
Anton Shestakov <av6@dwimlabs.net> [Mon, 08 Jan 2024 13:35:02 +0100] rev 51307
contrib: add a set of scripts to run pytype in Docker Having a simple way to run pytype for developers can massively shorten development cycle. Using the same Docker image and scripts that we use on our CI guarantees that the result achieved locally will be very similar to (if not the same as) the output of our CI runners. Things to note: the Dockerfile needs to do a little dance around user permissions inside /home/ci-runner/ because: - on one hand, creating new files on the host (e.g. .pyi files inside .pytype/) should use host user's uid and gid - on the other hand, when we run the image as uid:gid of host user, it needs to be able to read/execute files inside the image that are owned by ci-runner Since local user's uid might be different from ci-runner's uid, we execute this very broad chmod command inside /home/ci-runner/, but then run the image as the host user's uid:gid. There might be a better way to do this.
Mon, 18 Dec 2023 15:52:17 -0300 pytype: use "$(hg root)" instead of `hg root` to make shellcheck happier
Anton Shestakov <av6@dwimlabs.net> [Mon, 18 Dec 2023 15:52:17 -0300] rev 51306
pytype: use "$(hg root)" instead of `hg root` to make shellcheck happier
Mon, 18 Dec 2023 15:40:48 -0300 pytype: update check-pytype.sh to select target automatically
Anton Shestakov <av6@dwimlabs.net> [Mon, 18 Dec 2023 15:40:48 -0300] rev 51305
pytype: update check-pytype.sh to select target automatically We have python3.11 on CI, so we can run pytype targeting that version. On the other hand, we don't have python3.7 on CI anymore, so we can't run pytype for 3.7 anymore (interpreter not found). I think it's fine to make pytype select the appropriate target depending on the version of the interpreter it's running under.
Tue, 19 Dec 2023 22:54:52 +0100 git-hgext: adjust to the lack of `changelog.heads` method
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 19 Dec 2023 22:54:52 +0100] rev 51304
git-hgext: adjust to the lack of `changelog.heads` method We don't have a `heads` method returning nodeid, but this is very easy to get the same result. This was flagged by pytype. We can note that the fact this code did not break is probably a good sign that it is dead code. However this is a question outside of the scop of this series.
Tue, 19 Dec 2023 22:21:31 +0100 remotefilelog: drop dead code
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 19 Dec 2023 22:21:31 +0100] rev 51303
remotefilelog: drop dead code As pytype flagged bug in this method it highlighted that this methode being never called anywhere.
Tue, 19 Dec 2023 22:07:59 +0100 pytype: use the right signature for the `__delitem__`
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 19 Dec 2023 22:07:59 +0100] rev 51302
pytype: use the right signature for the `__delitem__` It is not because it is NotImplemented that it should use a bad signature. Fix it to please pytype.
Tue, 19 Dec 2023 22:07:21 +0100 pytype: use the right signature for the `__setitem__`
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 19 Dec 2023 22:07:21 +0100] rev 51301
pytype: use the right signature for the `__setitem__` It is not because it is NotImplemented that it should use a bad signature. Fix it to please pytype.
Tue, 19 Dec 2023 22:03:34 +0100 sparse: use with statement for wlock
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 19 Dec 2023 22:03:34 +0100] rev 51300
sparse: use with statement for wlock This will avoid pytype complaining about the try/except range.
Tue, 19 Dec 2023 22:00:47 +0100 remotefilelog: adjust the signature of basepack.createindex
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 19 Dec 2023 22:00:47 +0100] rev 51299
remotefilelog: adjust the signature of basepack.createindex pytype point that the subclass signature have been updated.
Thu, 21 Dec 2023 00:19:19 +0100 pytype: add the couple annotations for pytype to understands the lrunode
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 21 Dec 2023 00:19:19 +0100] rev 51298
pytype: add the couple annotations for pytype to understands the lrunode After loosing 2d6 SAN, I eventually understood that pytype was confused by method return type. Pytype is now happy.
Tue, 19 Dec 2023 21:40:06 +0100 pytype: ignore some signature mismatch in registrar
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 19 Dec 2023 21:40:06 +0100] rev 51297
pytype: ignore some signature mismatch in registrar pytype is grumpy about a sub method having a different signature than the one we use here. pytype error: internalmerge: Overriding method signature mismatch [signature-mismatch] Base signature: 'def _funcregistrarbase._extrasetup(self, name, func) -> Any'. Subclass signature: 'def internalmerge._extrasetup(self, name, func, mergetype, onfailure = None, precheck = None, binary = False, symlink = False) -> Any'. Parameter 'mergetype' must have a default value.
Tue, 19 Dec 2023 21:38:46 +0100 hgweb: update _runwsgi try/except range to be valid
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 19 Dec 2023 21:38:46 +0100] rev 51296
hgweb: update _runwsgi try/except range to be valid The `tmpl` variable is used in the `except` and `finally`, so we need it created before the `try` is open.
Tue, 19 Dec 2023 21:36:52 +0100 pytype: add type information for `annotateresult.lines`
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 19 Dec 2023 21:36:52 +0100] rev 51295
pytype: add type information for `annotateresult.lines` This seems to appease a confused pytype.
Tue, 19 Dec 2023 21:34:47 +0100 pytype: ignore attribute error for time.clock
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 19 Dec 2023 21:34:47 +0100] rev 51294
pytype: ignore attribute error for time.clock This seems to be a Windows only attribute.
Tue, 19 Dec 2023 21:27:49 +0100 pytype: ignore certifi import error
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 19 Dec 2023 21:27:49 +0100] rev 51293
pytype: ignore certifi import error This is an optional import so we should not complains about it.
Tue, 19 Dec 2023 21:26:30 +0100 pytype: ignore some signature mismatch in configitems
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 19 Dec 2023 21:26:30 +0100] rev 51292
pytype: ignore some signature mismatch in configitems pytype is grumpy about the dict.update having a more complex signature than the one we use here. pytype error: itemregister: Overriding method signature mismatch [signature-mismatch] Base signature: 'def builtins.dict.update(self) -> None'. Subclass signature: 'def itemregister.update(self, other) -> Any'. Parameter 'other' must have a default value.
Wed, 20 Dec 2023 16:30:32 +0100 pytype: only output the "pytype crashed" message on error
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 20 Dec 2023 16:30:32 +0100] rev 51291
pytype: only output the "pytype crashed" message on error If pytype did not crash while generating stub, that message is kind of confusing. It seems simple enough to avoid it in this case.
Wed, 20 Dec 2023 22:17:03 +0100 pytype: drop the now useless assert
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 20 Dec 2023 22:17:03 +0100] rev 51290
pytype: drop the now useless assert As the imported types are now used by type annotation, these ugly assert are no longer needed.
Wed, 20 Dec 2023 16:39:03 +0100 pytype: drop the last inline type comment
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 20 Dec 2023 16:39:03 +0100] rev 51289
pytype: drop the last inline type comment We can't assign type to the "for" variant on the fly, so we type the variable and method used instead.
Wed, 20 Dec 2023 11:23:09 +0100 pytype: convert type comment for inline variable too
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 20 Dec 2023 11:23:09 +0100] rev 51288
pytype: convert type comment for inline variable too Same logic as for the previous changeset, but for "type comment" annotating variables, not function/method. As for the previous changeset, we had to adjust for of the types to actually match what was happening.
Tue, 19 Dec 2023 21:29:34 +0100 pytype: move some type comment to proper annotation
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 19 Dec 2023 21:29:34 +0100] rev 51287
pytype: move some type comment to proper annotation We support direct type annotations now, while pytype is starting to complains about them.
Wed, 20 Dec 2023 20:13:22 +0100 lock: properly convert error to bytes
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 20 Dec 2023 20:13:22 +0100] rev 51286
lock: properly convert error to bytes Flagged by pytype when a later changeset is applied moving typing comment to annotation. We fix this ahead of the annotation change to make sure pytype remains happy after the change. We have to do fairly crazy dance for pytype to be happy. This probably comes from the fact IOError.filename probably claims to be `str` while it is actually `bytes` if the filename raising that `IOError` is bytes. At the same time, `IOError.strerror` is consistently `str` and should be passed as `str` everywhere.
Wed, 20 Dec 2023 12:51:20 +0100 pytype: import typing directly
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 20 Dec 2023 12:51:20 +0100] rev 51285
pytype: import typing directly First we no longer needs the pycompat layer, second having the types imported in all case will allow to use them more directly in type annotation, something important to upgrade the old "type comment" to proper type annotation. A lot a stupid assert are needed to keep pyflakes happy. We should be able to remove most of them once the type comment have been upgraded.
Wed, 08 Nov 2023 01:58:16 +0100 usage: configure uncompressed chunk cache through resource configuration
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 08 Nov 2023 01:58:16 +0100] rev 51284
usage: configure uncompressed chunk cache through resource configuration Let's use this new concept for what it is meant for. This provides a sizable speed up for reading multiple revision for some complexe repositories. ### data-env-vars.name = pypy-2018-08-01-zstd-sparse-revlog # benchmark.name = hg.perf.read-revisions # benchmark.variants.order = reverse memory-medium: 1.892400 memory-high: 1.722934 (-8.61%) # benchmark.variants.order = default memory-medium: 1.751542 memory-high: 1.589340 (-9.49%)
Mon, 09 Oct 2023 15:12:16 +0200 usage: add configuration option to adjust resources usage
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 09 Oct 2023 15:12:16 +0200] rev 51283
usage: add configuration option to adjust resources usage They currently do nothing, but this open the way to actually use them.
Mon, 09 Oct 2023 15:06:21 +0200 usage: add a `usage.repository-role` config
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 09 Oct 2023 15:06:21 +0200] rev 51282
usage: add a `usage.repository-role` config This config will be used for behavior and performance adjustment depending of the repository role.
Wed, 13 Dec 2023 13:46:28 +0100 common-pattern: cover "elapsed time" line
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 13 Dec 2023 13:46:28 +0100] rev 51281
common-pattern: cover "elapsed time" line These are perfect targets for the common-pattern matching.
Wed, 27 Dec 2023 18:02:26 +0100 bundle: do not detect --base argument that match nothing as lack of argument stable
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 27 Dec 2023 18:02:26 +0100] rev 51280
bundle: do not detect --base argument that match nothing as lack of argument With the previous version of the code, if --base did not match anything, it will be handled as if no --base was provided and will fallback to using discovery with the default path. This has two issues : - The resulting bundle won't match what the user requested, - if not default path is configured, it will crash. We now properly distinct between the two cases and if the --base query does not find any changeset, we will assume that everything under --rev needs to be sent.
Wed, 27 Dec 2023 18:42:13 +0100 bundle: highlight misbehavior when --base does not match any revision stable
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 27 Dec 2023 18:42:13 +0100] rev 51279
bundle: highlight misbehavior when --base does not match any revision See next changeset for fix and details.
Sun, 24 Dec 2023 02:43:53 +0100 branching: merge with stable
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 24 Dec 2023 02:43:53 +0100] rev 51278
branching: merge with stable I need the fix to `generate-churning-bundle.py`.
Sat, 18 Nov 2023 00:16:15 +0100 generate-churning-bundle: fix script for python3 stable
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 18 Nov 2023 00:16:15 +0100] rev 51277
generate-churning-bundle: fix script for python3 This script has apparently not run for a long time.
Sat, 16 Dec 2023 10:48:20 -0800 narrow: strip trailing `/` from manifest dir before matching it
Martin von Zweigbergk <martinvonz@google.com> [Sat, 16 Dec 2023 10:48:20 -0800] rev 51276
narrow: strip trailing `/` from manifest dir before matching it Commit 17a822d7943e broke some of our internal tests at Google because the `dir` variable contains a trailing slash since that commit. Let's restore the old behavior by stripping that trailing slash.
Mon, 18 Dec 2023 10:13:41 -0800 tests: demonstrate error when narrowing with `rootfilesin:` pattern
Martin von Zweigbergk <martinvonz@google.com> [Mon, 18 Dec 2023 10:13:41 -0800] rev 51275
tests: demonstrate error when narrowing with `rootfilesin:` pattern This demonstrates a bug introduced in 17a822d7943e.
Mon, 18 Dec 2023 14:51:20 -0800 matchers: use correct method for finding index in vector
Martin von Zweigbergk <martinvonz@google.com> [Mon, 18 Dec 2023 14:51:20 -0800] rev 51274
matchers: use correct method for finding index in vector The path matcher has an optimization for when all paths are `rootfilesin:`. This optimization exists in both Python and Rust. However, the Rust implementation currently has a bug that makes it fail in most cases. The bug is that it `rfind()` where it was clearly intended to use `rposition()`. This patch fixes that and adds a test.
Tue, 12 Dec 2023 17:08:45 +0100 dirstate: make the `transaction` argument of `setbranch` mandatory
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 12 Dec 2023 17:08:45 +0100] rev 51273
dirstate: make the `transaction` argument of `setbranch` mandatory This is deprecated since 6.4. We should drop it now.
Wed, 20 Dec 2023 14:59:31 +0100 rust-clippy: apply some more trivial fixes
Raphaël Gomès <rgomes@octobus.net> [Wed, 20 Dec 2023 14:59:31 +0100] rev 51272
rust-clippy: apply some more trivial fixes All of these were hinted at by clippy and make the code simpler.
Wed, 20 Dec 2023 14:58:36 +0100 rust-clippy: simplify `match` to `if let`
Raphaël Gomès <rgomes@octobus.net> [Wed, 20 Dec 2023 14:58:36 +0100] rev 51271
rust-clippy: simplify `match` to `if let` This was hinted at by clippy, and makes it more obvious that nothing is happening in the `None` case.
Fri, 01 Dec 2023 22:56:08 +0100 censor: accept multiple revision in a single call
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 01 Dec 2023 22:56:08 +0100] rev 51270
censor: accept multiple revision in a single call This is useful when dealing with corruption, as all the corrupted revision can be dealt with in one go.
Fri, 01 Dec 2023 22:46:46 +0100 censor: be more verbose about the other steps too
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 01 Dec 2023 22:46:46 +0100] rev 51269
censor: be more verbose about the other steps too If we informs the user about head checking, we should tell him when the other operation happens too. Otherwise the user can imagine to still be in the head checking part.
Fri, 01 Dec 2023 22:44:33 +0100 censor: add a command flag to skip the head checks
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 01 Dec 2023 22:44:33 +0100] rev 51268
censor: add a command flag to skip the head checks In some case we spend hours of time checking the heads to censors a simple file is not a good behavior. Especially when censors is used to removed corrupted content.
Fri, 01 Dec 2023 22:33:35 +0100 censor: inform the user that we are spending time checking heads
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 01 Dec 2023 22:33:35 +0100] rev 51267
censor: inform the user that we are spending time checking heads The time this can consume can be a surprise to the user, lets be explicit about it.
Fri, 01 Dec 2023 22:25:52 +0100 censor: mention that we check the heads in the help
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 01 Dec 2023 22:25:52 +0100] rev 51266
censor: mention that we check the heads in the help And add a message to will explain the possibly long time spent doing this.
Thu, 21 Dec 2023 01:45:43 +0100 persistent-nodemap: respect the mmap setting when refreshing data stable
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 21 Dec 2023 01:45:43 +0100] rev 51265
persistent-nodemap: respect the mmap setting when refreshing data After writing updated data, we reload the in-memory data. However, that logic was… wrong. We were doing file read when mmap was requested and when the configuration was requesting to not use mmap… we were using it. This should now be fine.
Thu, 14 Dec 2023 09:57:25 +0100 rust-index: only access offsets if revlog is inline
Raphaël Gomès <rgomes@octobus.net> [Thu, 14 Dec 2023 09:57:25 +0100] rev 51264
rust-index: only access offsets if revlog is inline Accessing the `RwLock` ended up showing up in profiles even with no contention. Offsets only exist for inline revlogs, so gate everything behind an inline check.
Wed, 06 Dec 2023 11:04:18 +0100 rust-index: cache the head nodeids python list
Raphaël Gomès <rgomes@octobus.net> [Wed, 06 Dec 2023 11:04:18 +0100] rev 51263
rust-index: cache the head nodeids python list Same optimization as before, but for the nodeids this time.
Tue, 05 Dec 2023 14:50:05 +0100 rust-index: add fast-path for getting a list of all heads as nodes
Raphaël Gomès <rgomes@octobus.net> [Tue, 05 Dec 2023 14:50:05 +0100] rev 51262
rust-index: add fast-path for getting a list of all heads as nodes This avoids a lot of back-and-forth between Python and Rust. We forgo adding a fast-path in the `filteredchangelog` case yet. If it shows up in profiling, we might add the variant with a filter.
Wed, 29 Nov 2023 23:22:51 -0500 rust-index-cpython: cache the heads' PyList representation
Raphaël Gomès <rgomes@octobus.net> [Wed, 29 Nov 2023 23:22:51 -0500] rev 51261
rust-index-cpython: cache the heads' PyList representation This is the same optimization that the C index does, we just have more separation of the Python and native sides.
Wed, 29 Nov 2023 15:58:24 -0500 rust-index: use a `BitVec` instead of plain `Vec` for heads computation
Raphaël Gomès <rgomes@octobus.net> [Wed, 29 Nov 2023 15:58:24 -0500] rev 51260
rust-index: use a `BitVec` instead of plain `Vec` for heads computation The `Vec` method uses one byte per revision, this uses 1 per 8 revisions, which improves our memory footprint. For large graphs (10+ millions), this can make a measurable difference server-side. I have seen no measurable impact on execution speed.
Wed, 29 Nov 2023 10:04:41 -0500 rust-index: implement faster retain heads using a vec instead of a hashset
Raphaël Gomès <rgomes@octobus.net> [Wed, 29 Nov 2023 10:04:41 -0500] rev 51259
rust-index: implement faster retain heads using a vec instead of a hashset This is the same optimization that the C index does, we're only catching up now because this showed up as slow in benchmarking.
Thu, 14 Dec 2023 11:52:05 +0100 rust-index: allow inlining VCSGraph parents across crates
Raphaël Gomès <rgomes@octobus.net> [Thu, 14 Dec 2023 11:52:05 +0100] rev 51258
rust-index: allow inlining VCSGraph parents across crates
Thu, 23 Nov 2023 18:48:07 +0100 rust-index: allow inlining `parents` across crates
Raphaël Gomès <rgomes@octobus.net> [Thu, 23 Nov 2023 18:48:07 +0100] rev 51257
rust-index: allow inlining `parents` across crates
Thu, 23 Nov 2023 18:47:42 +0100 rust-index: allow inlining `check_revision` across crates
Raphaël Gomès <rgomes@octobus.net> [Thu, 23 Nov 2023 18:47:42 +0100] rev 51256
rust-index: allow inlining `check_revision` across crates
Thu, 23 Nov 2023 03:41:58 +0100 rust-index: document safety invariants being upheld for every `unsafe` block
Raphaël Gomès <rgomes@octobus.net> [Thu, 23 Nov 2023 03:41:58 +0100] rev 51255
rust-index: document safety invariants being upheld for every `unsafe` block We've added a lot of `unsafe` code that shares Rust structs with Python. While this is unfortunate, it is also unavoidable, so let's at least systematically explain why each call to `unsafe` is sound. If any of the unsafe code ends up being wrong (because everyone screws up at some point), this change at least continues the unspoken rule of always explaining the need for `unsafe`, so we at least get a chance to think.
Sun, 29 Oct 2023 12:18:03 +0100 rust-index: renamed `MixedIndex` as `Index`
Georges Racinet on incendie.racinet.fr <georges@racinet.fr> [Sun, 29 Oct 2023 12:18:03 +0100] rev 51254
rust-index: renamed `MixedIndex` as `Index` It is simply not mixed any more, hence the name had become a future source of confusion.
Sun, 29 Oct 2023 23:54:05 +0100 rust-index: stop instantiating a C Index
Georges Racinet <georges.racinet@octobus.net> [Sun, 29 Oct 2023 23:54:05 +0100] rev 51253
rust-index: stop instantiating a C Index The only missing piece was the `cache` to be returned from `revlog.parse_index_v1_mixed`, and it really seems that it is essentially repetition of the input, if `inline` is `True`. Not worth a Rust implementation (C implementation is probably there for historical reasons).
Mon, 30 Oct 2023 21:28:30 +0100 rust-revlog: using the ad-hoc `NodeTree` in scmutil
Georges Racinet <georges.racinet@octobus.net> [Mon, 30 Oct 2023 21:28:30 +0100] rev 51252
rust-revlog: using the ad-hoc `NodeTree` in scmutil Now that we have an independent `NodeTree` class able to work natively on the pure Rust index, we use it in `mercurial.scmutil`, with automatic invalidation after mutation of the index. This code path is tested by `test-revisions.t` and `test-template-functions.t`
Mon, 30 Oct 2023 22:36:30 +0100 rust-revlog: add invalidation detection to `NodeTree` class
Georges Racinet <georges.racinet@octobus.net> [Mon, 30 Oct 2023 22:36:30 +0100] rev 51251
rust-revlog: add invalidation detection to `NodeTree` class This will be useful for callers, such as `scmutil` who reuse a `NodeTree` instance as a cache. They would otherwise get hard errors if any mutation of the index occurred since instantiation. This is something the C index does not provide.
Thu, 02 Nov 2023 15:50:13 +0100 rust-index: add support for `del index[r]`
Raphaël Gomès <rgomes@octobus.net> [Thu, 02 Nov 2023 15:50:13 +0100] rev 51250
rust-index: add support for `del index[r]` Only the `del index[r:]` syntax was supported, but the comment said otherwise. It's not actually used in core code, but the C index supports it.
Mon, 30 Oct 2023 21:26:17 +0100 rust-revlog: bare minimal NodeTree exposition
Georges Racinet <georges.racinet@octobus.net> [Mon, 30 Oct 2023 21:26:17 +0100] rev 51249
rust-revlog: bare minimal NodeTree exposition The independent `NodeTree` instances needs to be associated to an index (for forward-checks of candidates) but do not need to encompass all revisions from that index. This is exactly how it is used in `scmutil.shortesthenodeidprefix` and we restrict the implementation to the bare minimum needed there and to write convincing tests. It would of course be fairly trivial to add more.
Mon, 30 Oct 2023 21:25:28 +0100 rust-index: a property to identify the Rust index as such
Georges Racinet <georges.racinet@octobus.net> [Mon, 30 Oct 2023 21:25:28 +0100] rev 51248
rust-index: a property to identify the Rust index as such Will be useful soon in `mercurial.scmutil` and potentially elsewhere
Mon, 30 Oct 2023 15:32:33 +0100 rust-cpython-revlog: renamed NodeTree import as CoreNodeTree
Georges Racinet <georges.racinet@octobus.net> [Mon, 30 Oct 2023 15:32:33 +0100] rev 51247
rust-cpython-revlog: renamed NodeTree import as CoreNodeTree We're about to introduce a `NodeTree` Python class (hence also a Rust struct) and it would be a collision with the import
Fri, 20 Oct 2023 09:48:53 +0200 rust-index: stop using C index
Georges Racinet <georges.racinet@octobus.net> [Fri, 20 Oct 2023 09:48:53 +0200] rev 51246
rust-index: stop using C index We still keep its wrapper implementation in `hg-cpython::cindex`, because we might want to recreate ancestors handling objects using it for the case of REVLOGV2. Also, we still instantiate it (from Python code) and store it as attribute, for the likes of `get_cindex` and the caller that relies on it, but that is soon to be removed, too.
Sun, 29 Oct 2023 12:07:05 +0100 rust-index: using `hg::index::Index` in discovery
Georges Racinet <georges.racinet@octobus.net> [Sun, 29 Oct 2023 12:07:05 +0100] rev 51245
rust-index: using `hg::index::Index` in discovery At this point the C index is not used any more: we had to remove `pyindex_to_graph()` to avoid the dead code warning.
Sun, 29 Oct 2023 12:01:57 +0100 rust-python-testing: separated base test classes
Georges Racinet on incendie.racinet.fr <georges@racinet.fr> [Sun, 29 Oct 2023 12:01:57 +0100] rev 51244
rust-python-testing: separated base test classes This will allow, e.g., to change `test-rust-discovery.py` simply by adding the appropriate base class.
Sun, 29 Oct 2023 11:21:18 +0100 rust-discovery: encapsulated conversions to vec for instance methods
Georges Racinet <georges.racinet@octobus.net> [Sun, 29 Oct 2023 11:21:18 +0100] rev 51243
rust-discovery: encapsulated conversions to vec for instance methods This new `pyiter_to_vec` is pretty trivial, and only mildly reduces code duplication. The main advantage is that it encapsulates access to the `index` attribute, which will be changed when we replace the C index by the Rust index, given as `PySharedRef`.
Sun, 29 Oct 2023 11:10:09 +0100 rust-discovery: moving most of hg-cpython methods to regular code blocks
Georges Racinet <georges.racinet@octobus.net> [Sun, 29 Oct 2023 11:10:09 +0100] rev 51242
rust-discovery: moving most of hg-cpython methods to regular code blocks The chosen methods are those with conversion of an incoming Python iterable, as they will be changed the most when we will remove the C index, and `takefullsample` for consistency with `takequicksample`.
Sun, 29 Oct 2023 10:47:54 +0100 rust-index: using `hg::index::Index` in `hg-cpython::dagops`
Georges Racinet <georges.racinet@octobus.net> [Sun, 29 Oct 2023 10:47:54 +0100] rev 51241
rust-index: using `hg::index::Index` in `hg-cpython::dagops` Hooking `headrevs` to the Rust index is straightforward as long as we go the `PySharedRef` way. Direct attempts of obtaining a reference to the inner `hg::index::Index` fail for lifetime reasons: the reference is bound to the GIL, yet the `as_set` local variable is considered to be static (the borrow checker clearly does not realize or care that this set only stores `Revision` values). In `rank()`, the chosen solution is the simplest as far as `hg-cpython` is concerned, but it has the defect of removing an implementation that would be easily adaptable if the core index did implement `RankedGraph` (returning the same error as long as only `REVLOGV1` is supported), but that would introduce a direct dependency of `hg-core` on the ``vcsgraph` crate.
Sat, 28 Oct 2023 22:50:10 +0200 rust-index: using `hg::index::Index` in MissingAncestors
Georges Racinet on incendie.racinet.fr <georges@racinet.fr> [Sat, 28 Oct 2023 22:50:10 +0200] rev 51240
rust-index: using `hg::index::Index` in MissingAncestors With this, the whole `hg-cpython::ancestors` module can now work without the C index.
Fri, 27 Oct 2023 22:11:05 +0200 rust-index: using the `hg::index::Index` in ancestors iterator and lazy set
Georges Racinet <georges.racinet@octobus.net> [Fri, 27 Oct 2023 22:11:05 +0200] rev 51239
rust-index: using the `hg::index::Index` in ancestors iterator and lazy set Since there is no Rust implementation for REVLOGV2/CHANGELOGv2, we declare them to be incompatible with Rust, hence indexes in these formats will use the implementations from Python `mercurial.ancestor`. If this is an unacceptable performance hit for current users of these formats, we can later on add Rust implementations based on the C index for them or implement these formats for the Rust indexes. Among the challenges that we had to meet, we wanted to avoid taking the GIL each time the inner (vcsgraph) iterator has to call the parents function. This would probably still be acceptable in terms of performance with `AncestorsIterator`, but not with `LazyAncestors` nor for the upcoming change in `MissingAncestors`. Hence we enclose the reference to the index in a `PySharedRef`, leading to more rigourous checking of mutations, which does pass now that there no logically immutable methods of `hg::index::Index` that take a mutable reference as input.
Fri, 27 Oct 2023 23:29:29 +0200 revlog: always use a Rust index for REVLOGv1 if rustext is present
Georges Racinet on incendie.racinet.fr <georges@racinet.fr> [Fri, 27 Oct 2023 23:29:29 +0200] rev 51238
revlog: always use a Rust index for REVLOGv1 if rustext is present We are about to change classes such as `rustext.AncestorsIterator` to take a Rust index, hence we cannot have the option not to use the Rust index. Note: this can be refined depending on whether we want to keep this option or not. We will have to make two versions of `AncestorsIterator` and its sibling to support REVLOGV2 and CHANGELOGv2 anyway. Meanwhile, this is the simplest change to make the tests pass.
Sun, 29 Oct 2023 18:35:32 +0100 rust-index: disabling flagprocessor tests
Georges Racinet on incendie.racinet.fr <georges@racinet.fr> [Sun, 29 Oct 2023 18:35:32 +0100] rev 51237
rust-index: disabling flagprocessor tests The list of flags supported by the Rust index is not dynamic, hence flagprocessor has no chance to work.
Tue, 31 Oct 2023 17:58:56 +0100 rust-index: support `unionrepo`'s compressed length hack
Raphaël Gomès <rgomes@octobus.net> [Tue, 31 Oct 2023 17:58:56 +0100] rev 51236
rust-index: support `unionrepo`'s compressed length hack Explanations inline.
Fri, 27 Oct 2023 23:21:50 +0200 rust-index: honour incoming using_general_delta in `deltachain`
Georges Racinet on incendie.racinet.fr <georges@racinet.fr> [Fri, 27 Oct 2023 23:21:50 +0200] rev 51235
rust-index: honour incoming using_general_delta in `deltachain` It looks to be a leftover from some past, but the C index considers only the value passed from Python whereas up to now the Rust index was using the value of its attribute. As a middle ground, we make this argument of `deltachain` optional from the Python side, with the Rust implementation only defaulting to its attribute. This way, we reduce false leads when a difference in results is spotted.
Fri, 27 Oct 2023 21:48:45 +0200 rust-index: use interior mutability in head revs and caches
Georges Racinet on incendie.racinet.fr <georges@racinet.fr> [Fri, 27 Oct 2023 21:48:45 +0200] rev 51234
rust-index: use interior mutability in head revs and caches For upcoming changes in `hg-cpython` switching to the `hg-core` index in ancestors iterators, we will need to avoid excessive mutability, restricting the use of mutable references on `hg::index::Index` to methods that actually logically mutate it, whereas the maintenance of caches such as `head_revs` clearly does not. We illustrate that immediately by switching to immutable borrows in the corresponding methods of `hg-cpython::MixedIndex`
Thu, 26 Oct 2023 15:26:19 +0200 rust-index: add Sync bound to all relevant mmap-derived values
Raphaël Gomès <rgomes@octobus.net> [Thu, 26 Oct 2023 15:26:19 +0200] rev 51233
rust-index: add Sync bound to all relevant mmap-derived values All readonly mmaps are Sync as far as Rust is concerned. Integrity of the mmap'ed file is a concern separate to Rust's memory model, since it requires out-of-program handling via locks, etc. This will help when we start sharing the Rust Index with Python.
Tue, 31 Oct 2023 18:09:43 +0100 debugindexstats: handle the lack of Rust support better
Raphaël Gomès <rgomes@octobus.net> [Tue, 31 Oct 2023 18:09:43 +0100] rev 51232
debugindexstats: handle the lack of Rust support better We don't have any stats in the Rust index. Currently it is not known which stats would be interesting to get, so if they end up being important, we can add them later.
Tue, 31 Oct 2023 17:36:59 +0100 rust-python-index: don't panic on a corrupted index when calling from Python
Raphaël Gomès <rgomes@octobus.net> [Tue, 31 Oct 2023 17:36:59 +0100] rev 51231
rust-python-index: don't panic on a corrupted index when calling from Python This makes `test-verify.t` pass again. In an ideal world, we would find the exact commit where this test breaks and amend part of this change there, but this is a long enough series.
Tue, 31 Oct 2023 17:34:31 +0100 tests: ignore test-storage when using Rust
Raphaël Gomès <rgomes@octobus.net> [Tue, 31 Oct 2023 17:34:31 +0100] rev 51230
tests: ignore test-storage when using Rust This is only relevant for Python code and the SQLite backend, which is in a half-abandoned state.
Fri, 20 Oct 2023 09:12:22 +0200 rust-index: optimize find_gca_candidates() on less than 8 revisions
Georges Racinet <georges.racinet@octobus.net> [Fri, 20 Oct 2023 09:12:22 +0200] rev 51229
rust-index: optimize find_gca_candidates() on less than 8 revisions This is expected to be by far the most common case, given that, e.g., merging involves using it on two revisions. Using a `u8` as support for the bitset obviously divides the amount of RAM needed by 8. To state the obvious, on a repository with 10 million changesets, this spares 70MB. It is also possible that it'd be slightly faster, because it is easier to allocate and provides better cache locality. It is possible that some exhaustive listing of the traits implemented by `u8` and `u64` would avoid the added duplication, but that can be done later and would need a replacement for the `MAX` consts.
Fri, 20 Oct 2023 08:54:49 +0200 rust-index: simplification in find_gca_candidates()
Georges Racinet <georges.racinet@octobus.net> [Fri, 20 Oct 2023 08:54:49 +0200] rev 51228
rust-index: simplification in find_gca_candidates() `parent_seen` can be made a mutable ref, making this part more obvious, not needing to be commented so much. The micro-optimization of avoiding the union if `parent_seen` and `current_seen` agree is pushed down in the `union()` method of the fast, `u64` based bit set implementation (in case it matters).
Fri, 20 Oct 2023 08:43:00 +0200 rust-index: avoid double negation in find_gca_candidates()
Georges Racinet <georges.racinet@octobus.net> [Fri, 20 Oct 2023 08:43:00 +0200] rev 51227
rust-index: avoid double negation in find_gca_candidates()
Fri, 20 Oct 2023 08:17:00 +0200 rust-index: avoid some cloning in find_gca_candidates()
Georges Racinet <georges.racinet@octobus.net> [Fri, 20 Oct 2023 08:17:00 +0200] rev 51226
rust-index: avoid some cloning in find_gca_candidates() Instead of keeping the information whether the current revision is poisoned on `current_seen`, we extract it as a boolean. This also allows us to simplify the explanation of `seen[r].is_poisoned()`, as the exceptional case where it is poisoned right after `r` has been determined to be a solution does no longer exist.
Wed, 18 Oct 2023 15:35:38 +0200 rust-index: implement common_ancestors_heads() and ancestors()
Georges Racinet <georges.racinet@octobus.net> [Wed, 18 Oct 2023 15:35:38 +0200] rev 51225
rust-index: implement common_ancestors_heads() and ancestors() The only differences betwwen `common_ancestors_heads()` and `find_gca_candidates()` seems to be that: - the former accepts "overlapping" input revisions (meaning with duplicates). - limitation to 24 inputs (in the C code), that we translate to using the arbitrary size bit sets in the Rust code because we cannot bail to Python. Given that the input is expected to be small in most cases, we take the heavy handed approach of going through a HashSet and wait for perfomance assessment In case this is used via `hg-cpython`, we can anyway absorb the overhead by having `commonancestorheads` build a vector of unique values directly, and introduce a thin wrapper over `find_gca_candidates`, to take care of bit set type dispatching only. As far as `ancestors` is concerneed, this is just chaining `common_ancestors_heads()` with `find_deepest_revs`.
Tue, 17 Oct 2023 22:42:40 +0200 rust-index: find_gca_candidates bit sets genericization
Georges Racinet on incendie.racinet.fr <georges@racinet.fr> [Tue, 17 Oct 2023 22:42:40 +0200] rev 51224
rust-index: find_gca_candidates bit sets genericization This allows to use arbitratry size of inputs in `find_gca_candidates()`. We're genericizing so that the common case of up to 63 inputs can be treated with the efficient implementation backed by `u64`. Some complications with the borrow checker came, because arbitrary sized bit sets will not be `Copy`, hence mutating them keeps a mut ref on the `seen` vector. This is solved by some cloning, most of which can be avoided, preferably in a follow-up after proof that this works (hence after exposition to Python layer). As far as performance is concerned, calling `clone()` on a `Copy` object (good case when number of revs is less than 64) should end up just doing a copy, according to this excerpt of the `Clone` trait documentation: Types that are Copy should have a trivial implementation of Clone. More formally: if T: Copy, x: T, and y: &T, then let x = y.clone(); is equivalent to let x = *y;. Manual implementations should be careful to uphold this invariant; however, unsafe code must not rely on it to ensure memory safety. We kept the general structure, hence why there are some double negations. This also could be made nicer in a follow-up. The `NonStaticPoisonableBitSet` is included to ensure that the `PoisonableBitSet` trait is general enough (had to correct `vec_of_empty()` for instance). Moving the genericization one level to encompass the `seen` vector and not its elements would be better for performance, if worth it.
Thu, 02 Nov 2023 11:45:20 +0100 rust-index: core impl for find_gca_candidates and find_deepest
Raphaël Gomès <rgomes@octobus.net> [Thu, 02 Nov 2023 11:45:20 +0100] rev 51223
rust-index: core impl for find_gca_candidates and find_deepest This still follows closely the C original and not able to treat more than 63 input revisions (bitset backed by `u64` and one bit reserved for poisoning).
Mon, 30 Oct 2023 11:57:36 +0100 rust-index: add support for `reachableroots2`
Raphaël Gomès <rgomes@octobus.net> [Mon, 30 Oct 2023 11:57:36 +0100] rev 51222
rust-index: add support for `reachableroots2` Exposition in `hg-cpython` done in regular impl block, again for rustfmt support etc.
Thu, 02 Nov 2023 12:17:06 +0100 hg-cpython: rev_pyiter_collect_or_else
Georges Racinet <georges.racinet@octobus.net> [Thu, 02 Nov 2023 12:17:06 +0100] rev 51221
hg-cpython: rev_pyiter_collect_or_else It will be useful to give callers the control on the generated errors
Mon, 30 Oct 2023 11:54:42 +0100 rust-index: add support for `computephasesmapsets`
Raphaël Gomès <rgomes@octobus.net> [Mon, 30 Oct 2023 11:54:42 +0100] rev 51220
rust-index: add support for `computephasesmapsets` Exposition in `hg-cpython` done in the regular `impl` block to enjoy rustfmt and clearer compilartion errors.
Sat, 30 Sep 2023 15:59:03 +0200 rust-index: slicechunktodensity returns Rust result
Georges Racinet <georges.racinet@octobus.net> [Sat, 30 Sep 2023 15:59:03 +0200] rev 51219
rust-index: slicechunktodensity returns Rust result Ready for removal of the scaffolding. This time, we allow ourselves a minor optimization: we avoid allocating for each chunk. Instead, we reuse the same vector, and perform at most one allocation per chunk. The `PyList` constructor will copy the buffer anyway.
Thu, 02 Nov 2023 11:40:23 +0100 rust-index: add support for `_slicechunktodensity`
Raphaël Gomès <rgomes@octobus.net> [Thu, 02 Nov 2023 11:40:23 +0100] rev 51218
rust-index: add support for `_slicechunktodensity`
Fri, 29 Sep 2023 20:51:49 +0200 rust-index: headrevsfiltered() returning Rust result
Georges Racinet <georges.racinet@octobus.net> [Fri, 29 Sep 2023 20:51:49 +0200] rev 51217
rust-index: headrevsfiltered() returning Rust result
Mon, 30 Oct 2023 11:14:25 +0100 rust-index: add support for `headrevsfiltered`
Raphaël Gomès <rgomes@octobus.net> [Mon, 30 Oct 2023 11:14:25 +0100] rev 51216
rust-index: add support for `headrevsfiltered` The implementation is merged with that of `headrevs` also to make sure that caches are up to date.
Tue, 19 Sep 2023 15:21:43 +0200 rust-index: implement headrevs
Raphaël Gomès <rgomes@octobus.net> [Tue, 19 Sep 2023 15:21:43 +0200] rev 51215
rust-index: implement headrevs
Sat, 30 Sep 2023 16:52:40 +0200 rust-index: variant of assert_py_eq with normalizer expression
Georges Racinet <georges.racinet@octobus.net> [Sat, 30 Sep 2023 16:52:40 +0200] rev 51214
rust-index: variant of assert_py_eq with normalizer expression The example given in doc-comment is the main use case: some methods may require ordering insensitive comparison. This is about to be used for `reachableroots2`
Thu, 03 Aug 2023 15:50:14 +0200 rust-index: add support for delta-chain computation
Raphaël Gomès <rgomes@octobus.net> [Thu, 03 Aug 2023 15:50:14 +0200] rev 51213
rust-index: add support for delta-chain computation
Thu, 03 Aug 2023 15:01:34 +0200 rust-index: add support for `find_snapshots`
Raphaël Gomès <rgomes@octobus.net> [Thu, 03 Aug 2023 15:01:34 +0200] rev 51212
rust-index: add support for `find_snapshots`
Thu, 03 Aug 2023 12:05:32 +0200 rust-index: add `is_snapshot` method
Raphaël Gomès <rgomes@octobus.net> [Thu, 03 Aug 2023 12:05:32 +0200] rev 51211
rust-index: add `is_snapshot` method
Wed, 02 Aug 2023 16:49:33 +0200 rust-index: use the Rust index in `partialmatch`
Raphaël Gomès <rgomes@octobus.net> [Wed, 02 Aug 2023 16:49:33 +0200] rev 51210
rust-index: use the Rust index in `partialmatch`
Thu, 03 Aug 2023 14:50:17 +0200 rust-index: add missing special case for null rev
Raphaël Gomès <rgomes@octobus.net> [Thu, 03 Aug 2023 14:50:17 +0200] rev 51209
rust-index: add missing special case for null rev This was an oversight, it was never a problem because we didn't use the index much for user-facing things in the past, which is the only real way of getting to this edge case.
Wed, 02 Aug 2023 16:49:17 +0200 rust-index: use the rust index in `shortest`
Raphaël Gomès <rgomes@octobus.net> [Wed, 02 Aug 2023 16:49:17 +0200] rev 51208
rust-index: use the rust index in `shortest`
Wed, 02 Aug 2023 14:34:21 +0200 rust-index: add checks that `__contains__` is synchronized
Raphaël Gomès <rgomes@octobus.net> [Wed, 02 Aug 2023 14:34:21 +0200] rev 51207
rust-index: add checks that `__contains__` is synchronized
Mon, 30 Oct 2023 11:03:57 +0100 rust-index: using the Rust index in nodemap updating methods
Georges Racinet <georges.racinet@octobus.net> [Mon, 30 Oct 2023 11:03:57 +0100] rev 51206
rust-index: using the Rust index in nodemap updating methods
Thu, 02 Nov 2023 11:19:54 +0100 rust-index: implementation of __getitem__
Raphaël Gomès <rgomes@octobus.net> [Thu, 02 Nov 2023 11:19:54 +0100] rev 51205
rust-index: implementation of __getitem__ Although the removed panic tends to prove if the full test suite did pass that the case when the input is a node id does not happen, it is best not to remove it right now. Raising IndexError is crucial for iteration on the index to stop, given the default CPython sequence iterator, see for instance https://github.com/zpoint/CPython-Internals/blobs/master/BasicObject/iter/iter.md This was spotted by `test-rust-ancestors.py`, which does simple interations on indexes (as preflight checks). In `revlog.c`, `index_getitem` defaults to `index_get` when called on revision numbers, which does raise `IndexError` with the same message as the one we are introducing here.
Wed, 27 Sep 2023 11:34:52 +0200 rust-index: optim note for post-scaffolding removal
Georges Racinet <georges.racinet@octobus.net> [Wed, 27 Sep 2023 11:34:52 +0200] rev 51204
rust-index: optim note for post-scaffolding removal
Thu, 02 Nov 2023 11:16:13 +0100 rust-index: check that the entry bytes are the same in both indexes
Raphaël Gomès <rgomes@octobus.net> [Thu, 02 Nov 2023 11:16:13 +0100] rev 51203
rust-index: check that the entry bytes are the same in both indexes This is a temporary measure to show that both the Rust and C indexes are kept in sync. Comes with some related documentation precisions. For comparison of error cases, see `index_entry_binary()` in `revlog.c`.
Sat, 30 Sep 2023 16:15:56 +0200 rust-index: return variables systematic naming convention
Georges Racinet <georges.racinet@octobus.net> [Sat, 30 Sep 2023 16:15:56 +0200] rev 51202
rust-index: return variables systematic naming convention To help knowing at a glance when a method is ready, making us more comofortable when we are close to the final removal of scaffolding, we introduce the systematic variable names `rust_res` and `c_res`. The goal of this series is to always return the formet. We take again the case of `pack_header` as example. Our personal opinion is to usually avoid such poor semantics as `res`, but usually accept it when it close to the actual return, which will be the case in most methods of this series. Also, the name can simply be dropped when we remove the scaffolding. To follow on the example, the body of `pack_header()` should become this in the final version: ``` let index = self.index(py).borrow(); let packed = index.pack_header(args.get_item(py, 0).extract(py)?); Ok(PyBytes::new(py, &packed).into_object()); ``` in these cases it is close to the actual return and will be removed at the end entirely.
Fri, 29 Sep 2023 15:51:49 +0200 rust-index: results comparison helper with details
Georges Racinet <georges.racinet@octobus.net> [Fri, 29 Sep 2023 15:51:49 +0200] rev 51201
rust-index: results comparison helper with details This is a bit simpler to call and has the advantage of systematically log the encountered deviation. To avoid committing dead code, we apply it to the `pack_header` method, that was already returning the Rust result.
Wed, 27 Sep 2023 10:59:04 +0200 rust-index: helper for revision not in index not involving nodemap
Georges Racinet <georges.racinet@octobus.net> [Wed, 27 Sep 2023 10:59:04 +0200] rev 51200
rust-index: helper for revision not in index not involving nodemap This is a good match for exceptions raised from the C implementation, when it is not about a nodemap inconsistency.
Wed, 18 Oct 2023 19:54:18 +0200 rust-index: renamed nodemap error function for rev not in index
Georges Racinet <georges.racinet@octobus.net> [Wed, 18 Oct 2023 19:54:18 +0200] rev 51199
rust-index: renamed nodemap error function for rev not in index The function name was misleading, as the error wording mentions the nodemap, hence would not be appropriate for missing revisions not related to a nodemap lookup.
Thu, 03 Aug 2023 10:28:10 +0200 rust-index: add `pack_header` support
Raphaël Gomès <rgomes@octobus.net> [Thu, 03 Aug 2023 10:28:10 +0200] rev 51198
rust-index: add `pack_header` support
Mon, 30 Oct 2023 10:34:48 +0100 rust-index: support cache clearing
Raphaël Gomès <rgomes@octobus.net> [Mon, 30 Oct 2023 10:34:48 +0100] rev 51197
rust-index: support cache clearing I'm not 100% sure how useful it is outside of perf, but it's still worth implementing.
Thu, 29 Jun 2023 11:37:19 +0200 rust-index: check rindex and cindex return the same get_rev
Raphaël Gomès <rgomes@octobus.net> [Thu, 29 Jun 2023 11:37:19 +0200] rev 51196
rust-index: check rindex and cindex return the same get_rev This is a temporary safeguard while we synchronize both indexes.
Wed, 28 Jun 2023 16:43:39 +0200 rust-index: synchronize remove to Rust index
Raphaël Gomès <rgomes@octobus.net> [Wed, 28 Jun 2023 16:43:39 +0200] rev 51195
rust-index: synchronize remove to Rust index Future steps will bring the two indexes further together until we can rip the C index entirely when running Rust code.
Wed, 28 Jun 2023 11:59:43 +0200 rust-index: remove `__setitem__` method from the mixed index
Raphaël Gomès <rgomes@octobus.net> [Wed, 28 Jun 2023 11:59:43 +0200] rev 51194
rust-index: remove `__setitem__` method from the mixed index This is not defined on the Python or C one, and isn't used anywhere.
Wed, 28 Jun 2023 11:36:22 +0200 rust-index: check equality between rust and cindex for `__len__`
Raphaël Gomès <rgomes@octobus.net> [Wed, 28 Jun 2023 11:36:22 +0200] rev 51193
rust-index: check equality between rust and cindex for `__len__`
Tue, 27 Jun 2023 18:24:54 +0200 rust-index: synchronize append method
Raphaël Gomès <rgomes@octobus.net> [Tue, 27 Jun 2023 18:24:54 +0200] rev 51192
rust-index: synchronize append method We now append to the Rust index just as we do to the C index. Future steps will bring the two indexes further together until we can rip the C index entirely when running Rust code.
Mon, 18 Sep 2023 17:11:11 +0200 rust-revlog: teach the revlog opening code to read the repo options
Raphaël Gomès <rgomes@octobus.net> [Mon, 18 Sep 2023 17:11:11 +0200] rev 51191
rust-revlog: teach the revlog opening code to read the repo options This will become necessary as we start writing revlog data from Rust.
Tue, 27 Jun 2023 17:34:51 +0200 rust-index: pass data down to the Rust index
Raphaël Gomès <rgomes@octobus.net> [Tue, 27 Jun 2023 17:34:51 +0200] rev 51190
rust-index: pass data down to the Rust index This will allow us to start keeping the Rust index synchronized with the cindex as we gradually implement more and more methods in Rust. This will eventually be removed.
Tue, 27 Jun 2023 16:32:09 +0200 rust-index: add append method
Raphaël Gomès <rgomes@octobus.net> [Tue, 27 Jun 2023 16:32:09 +0200] rev 51189
rust-index: add append method This is the first time the Rust index has any notion of mutability. This will be used in a future patch from Python, to start synchronizing the Rust index and the C index.
Mon, 26 Jun 2023 19:16:07 +0200 rust-index: add an abstraction to support bytes added at runtimes
Raphaël Gomès <rgomes@octobus.net> [Mon, 26 Jun 2023 19:16:07 +0200] rev 51188
rust-index: add an abstraction to support bytes added at runtimes In order to support appending data to the Rust index, we need to abstract data access away from the immutable (on-disk) bytes, to seemlessly fetch either from the preexisting data or from the newly added data.
Thu, 29 Jun 2023 16:09:57 +0200 rust-mixed-index: move the mmap keepalive into a function
Raphaël Gomès <rgomes@octobus.net> [Thu, 29 Jun 2023 16:09:57 +0200] rev 51187
rust-mixed-index: move the mmap keepalive into a function The same code will be used for keeping the new index mmap around.
Thu, 29 Jun 2023 15:00:46 +0200 rust-mixed-index: rename variable to make the next change clearer
Raphaël Gomès <rgomes@octobus.net> [Thu, 29 Jun 2023 15:00:46 +0200] rev 51186
rust-mixed-index: rename variable to make the next change clearer We're going to add another mmap reference holder, so let's rename this one first.
Wed, 27 Sep 2023 10:08:32 +0200 rust: fix cargo doc for hg-cpython
Georges Racinet <georges.racinet@octobus.net> [Wed, 27 Sep 2023 10:08:32 +0200] rev 51185
rust: fix cargo doc for hg-cpython
Fri, 15 Dec 2023 11:10:24 +0100 branching: merge with default
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 15 Dec 2023 11:10:24 +0100] rev 51184
branching: merge with default We merge with the current children of the bad merge (37b52b938579)
Fri, 15 Dec 2023 11:08:41 +0100 branching: merge with stable
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 15 Dec 2023 11:08:41 +0100] rev 51183
branching: merge with stable This recreates `37b52b938579` right as a `hg branch --rev 5b186ba40001` screwed up the content.
Thu, 07 Dec 2023 02:07:16 +0100 changelog: disallow delayed write on inline changesets
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 07 Dec 2023 02:07:16 +0100] rev 51182
changelog: disallow delayed write on inline changesets Since this will never happens, we can make the situation invalid and to stop to handling the associated the case. This simplify the random access file reading too.
Mon, 11 Dec 2023 22:27:59 +0100 changelog: never inline changelog
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 11 Dec 2023 22:27:59 +0100] rev 51181
changelog: never inline changelog The test suite mostly use small repositories, that implies that most changelog in the tests are inlined. As a result, non-inlined changelog are quite poorly tested. Since non-inline changelog are most common case for serious repositories, this lack of testing is a significant problem that results in high profile issue like the one recently fixed by 66417f55ea33 and 849745d7da89. Inlining the changelog does not bring much to the table, the number of total file saved is negligible, and the changelog will be read by most operation anyway. So this changeset is make it so we never inline the changelog, and de-inline the one that are still inlined whenever we touch them. By doing that, we remove the "dual code path" situation for writing new entry to the changelog and move to a "single code path" situation. Having a single code path simplify the code and make sure it is covered by test (if test cover that situation obviously) This impact all tests that care about the number of file and the exchange size, but there is nothing too complicated in them just a lot of churn. The churn is made "worse" by the fact rust will use the persistent nodemap on any changelog now. Which is overall a win as it means testing the persistent nodemap more and having less special cases. In short, having inline changelog is mostly useless and an endless source of pain. We get rid of it.
Mon, 11 Dec 2023 11:50:55 +0100 test-transaction-safety: glog out irrelevant flag
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 11 Dec 2023 11:50:55 +0100] rev 51180
test-transaction-safety: glog out irrelevant flag The test is focussing on the inline flag, so we glob out the other to highlight that fact and prevent noise in the future.
(0) -30000 -10000 -3000 -1000 -960 tip