Tue, 08 Nov 2022 13:59:16 -0500 typing: add type hints to bdiff implementations
Matt Harbison <matt_harbison@yahoo.com> [Tue, 08 Nov 2022 13:59:16 -0500] rev 49598
typing: add type hints to bdiff implementations Not super important code, but this was an exercise in using `merge-pyi` to fold type stubs back into the code on something small. The cext stubs don't seem to be getting used (at least the only thing in `.pytype/pyi/mercurial/cext` after a run generating the stubs is `__init__.pyi`), so maybe this will help some.
Tue, 08 Nov 2022 13:52:46 -0500 cffi: adjust the list returned by bdiff.blocks to never have a None entry
Matt Harbison <matt_harbison@yahoo.com> [Tue, 08 Nov 2022 13:52:46 -0500] rev 49597
cffi: adjust the list returned by bdiff.blocks to never have a None entry This was flagged by pytype after merging the corresponding bdiff.pyi in cext: File ".../mercurial/cffi/bdiff.py", line 44, in blocks: bad return type [bad-return-type] Expected: List[Tuple[int, int, int, int]] Actually returned: List[None] AFAICT, all callers immediately unpack the tuple into 4 variables, so a `None` entry would simply crash if they aren't all overwritten. As long a `count` and the link list are consistent, this shouldn't be a problem. This placates both pytype and PyCharm (which complained about the `i` in `rl[i]` having the wrong type with the old code).
Tue, 08 Nov 2022 13:38:06 -0500 typing: fix a syntax error in mercurial/cext/bdiff.pyi
Matt Harbison <matt_harbison@yahoo.com> [Tue, 08 Nov 2022 13:38:06 -0500] rev 49596
typing: fix a syntax error in mercurial/cext/bdiff.pyi I noticed because `merge-pyi` on the non-cext implementations with this file as input skipped the return type for this. `pytype-single --parse-pyi` confirmed it was a problem.
Mon, 14 Nov 2022 13:35:56 +0100 hg-core: relax dependencies pinning stable
Raphaël Gomès <rgomes@octobus.net> [Mon, 14 Nov 2022 13:35:56 +0100] rev 49595
hg-core: relax dependencies pinning Being this rigid makes packagers' job more difficult since they might not carry the exact version. This hard pinning was introduced in eb02decdf but wasn't strictly necessary to achieve its compatibility goal.
Mon, 14 Nov 2022 19:58:44 +0400 tests: make running ls in a no longer existing directory more portable stable
Anton Shestakov <av6@dwimlabs.net> [Mon, 14 Nov 2022 19:58:44 +0400] rev 49594
tests: make running ls in a no longer existing directory more portable On Linux, ls -A simply returns nothing and the exit code is 0. On NetBSD, ls -A complains that . doesn't exist and the exit code is 1. Sadly, it's not possible to do something like "[1] (?)", so " || true" is the best I could come up with.
Mon, 14 Nov 2022 19:38:57 +0400 tests: move some lines inside #if windows-#else block test-removeemptydirs.t stable
Anton Shestakov <av6@dwimlabs.net> [Mon, 14 Nov 2022 19:38:57 +0400] rev 49593
tests: move some lines inside #if windows-#else block test-removeemptydirs.t This is done to make it's clear that windows is not affected by this test case, IOW windows and non-windows platforms are now tested separately, because their results are very different.
Mon, 20 Jun 2022 12:53:08 +0400 tests: use ls -A instead of ls -1 in test-removeemptydirs.t stable
Anton Shestakov <av6@dwimlabs.net> [Mon, 20 Jun 2022 12:53:08 +0400] rev 49592
tests: use ls -A instead of ls -1 in test-removeemptydirs.t In case the tests are run as root, ls assumes -A by default on some systems (e.g. NetBSD). Tests probably shouldn't be run as root, but let's use -A just in case, for convenience.
Tue, 15 Nov 2022 10:28:39 +0100 release: add the "6.3" to the 6.3 release stable
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 15 Nov 2022 10:28:39 +0100] rev 49591
release: add the "6.3" to the 6.3 release The release was tagged "6.3.0" while the custom have been to omit the third ".0" for initial release for the history of the project. For consistency, we add the customary version of the tag to the 6.3 release.
Mon, 14 Nov 2022 20:21:53 +0100 tests: fix new git protocol policy in convert-git.t stable
pacien <pacien.trangirard@pacien.net> [Mon, 14 Nov 2022 20:21:53 +0100] rev 49590
tests: fix new git protocol policy in convert-git.t Recent versions of git restrict the use of the "file" protocol for security reasons (https://github.com/git/git/commit/a1d4f67). This broke this test, which failed with the following hidden error: "fatal: transport 'file' not allowed". This patch relaxes the git configuration for the test to solve this.
Fri, 04 Nov 2022 19:38:47 -0400 debug-delta-find: add a --source option
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 04 Nov 2022 19:38:47 -0400] rev 49589
debug-delta-find: add a --source option This will help us to understand the delta-find operation in different situations.
Wed, 02 Nov 2022 09:34:03 -0400 demandimport: ensure lazyloaderex sets loader attributes (issue6725)
Jason R. Coombs <jaraco@jaraco.com> [Wed, 02 Nov 2022 09:34:03 -0400] rev 49588
demandimport: ensure lazyloaderex sets loader attributes (issue6725) Adds test capturing missed expectation.
Tue, 30 Aug 2022 09:59:53 -0400 shelve: add test for Shelf.changed_files
Jason R. Coombs <jaraco@jaraco.com> [Tue, 30 Aug 2022 09:59:53 -0400] rev 49587
shelve: add test for Shelf.changed_files
Mon, 29 Aug 2022 14:11:26 -0400 shelve: add Shelf.changed_files for resolving changed files in a plugin
Jason R. Coombs <jaraco@jaraco.com> [Mon, 29 Aug 2022 14:11:26 -0400] rev 49586
shelve: add Shelf.changed_files for resolving changed files in a plugin
Mon, 14 Nov 2022 10:59:09 +0100 branching: merge stable into default
Raphaël Gomès <rgomes@octobus.net> [Mon, 14 Nov 2022 10:59:09 +0100] rev 49585
branching: merge stable into default
Mon, 14 Nov 2022 10:57:44 +0100 relnotes: add final 6.3 relnotes stable
Raphaël Gomès <rgomes@octobus.net> [Mon, 14 Nov 2022 10:57:44 +0100] rev 49584
relnotes: add final 6.3 relnotes
Mon, 14 Nov 2022 10:35:09 +0100 Added signature for changeset 04f1dba53c96 stable
Raphaël Gomès <rgomes@octobus.net> [Mon, 14 Nov 2022 10:35:09 +0100] rev 49583
Added signature for changeset 04f1dba53c96
Mon, 14 Nov 2022 10:34:17 +0100 Added tag 6.3.0 for changeset 04f1dba53c96 stable
Raphaël Gomès <rgomes@octobus.net> [Mon, 14 Nov 2022 10:34:17 +0100] rev 49582
Added tag 6.3.0 for changeset 04f1dba53c96
Wed, 09 Nov 2022 23:28:01 -0500 rust: create wrapper struct to reduce `regex` contention issues stable 6.3
Raphaël Gomès <rgomes@octobus.net> [Wed, 09 Nov 2022 23:28:01 -0500] rev 49581
rust: create wrapper struct to reduce `regex` contention issues Explanations inline.
Sat, 12 Nov 2022 02:38:53 +0100 tags-fnode-cache: skip building a changectx in getfnode stable
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 12 Nov 2022 02:38:53 +0100] rev 49580
tags-fnode-cache: skip building a changectx in getfnode Building a changectx object is costly, doing it just to retrieve the revision number is suboptimal. Directly fetching the revision number from the changelog provide a sizeable speedup to `hg debugupdatecache`. ### data-env-vars.name = mercurial-2018-08-01-zstd-sparse-revlog # benchmark.name = debug-update-cache # benchmark.variants.pre-state = warm before: 0.213229 seconds after: 0.165577 seconds (-22.35%) # data-env-vars.name = mercurial-filtered-2019-11-22-zstd-sparse-revlog before: 1.200383 seconds after: 1.071618 seconds (-10.73%) # data-env-vars.name = mozilla-central-2018-08-01-zstd-sparse-revlog before: 1.465735 seconds after: 0.923128 seconds (-37.02%) # data-env-vars.name = mozilla-try-2019-02-18-zstd-sparse-revlog before: 6.511771 seconds after: 4.507316 seconds (-30.78%) # data-env-vars.name = netbeans-2018-08-01-zstd-sparse-revlog before: 1.023007 seconds after: 0.645026 seconds (-36.95%) # data-env-vars.name = pypy-2018-08-01-zstd-sparse-revlog before: 0.381141 seconds after: 0.268654 seconds (-29.51%)
Sat, 12 Nov 2022 02:38:26 +0100 tags-fnode-cache: do not repeatedly open the filelog in a loop stable
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 12 Nov 2022 02:38:26 +0100] rev 49579
tags-fnode-cache: do not repeatedly open the filelog in a loop While getting multiple hgtagsfnodecache entries, we were opening (and closing) the `.hgtags` filelog for each iteration. The meant repeatedly reading and parsing the version same information from disk. A quite costly operation. We no longer do this, leading to a sizable improvement in `hg debugupdatecache` run for an already warm repositories. ### data-env-vars.name = mercurial-2018-08-01-zstd-sparse-revlog # benchmark.name = debug-update-cache # benchmark.variants.pre-state = warm before: 1.711778 seconds after: 0.213229 seconds (-87.54%) # data-env-vars.name = pypy-2018-08-01-zstd-sparse-revlog before: 4.010817 seconds after: 0.381141 seconds (-90.50%) # data-env-vars.name = netbeans-2018-08-01-zstd-sparse-revlog before: 13.574141 after: 1.023007 seconds (-92.46%) # data-env-vars.name = mozilla-central-2018-08-01-zstd-sparse-revlog before: 18.884656 after: 1.465735 seconds (-92.24%) # data-env-vars.name = mozilla-try-2019-02-18-zstd-sparse-revlog before: 88.924823 after: 6.511771 seconds (-92.68%)
Sat, 12 Nov 2022 02:30:41 +0100 profile: prevent a crash when line number is unknown stable
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 12 Nov 2022 02:30:41 +0100] rev 49578
profile: prevent a crash when line number is unknown For some unknown reason, `self.lineno` can be None. The previous code crashed in such case, we now ignore the case, as we do for other error in this function. We also fallback to using `-1` in the output when this lack of line number makes it to the display code. The reason of unknown line-numbers is… unknown.
Mon, 07 Nov 2022 09:25:20 +0100 configitems: enable pullbundles by default
Mathias De Mare <mathias.de_mare@nokia.com> [Mon, 07 Nov 2022 09:25:20 +0100] rev 49577
configitems: enable pullbundles by default The use of pullbundles is already protected: they are only used when a pullbundles.manifest file is created on the server. Having an additional flag doesn't really make sense and can confuse users (as indicated in the mercurial mailing list on the topic "Can't get pull-bundles working").
Sun, 06 Nov 2022 12:15:35 -0500 upgrade: byteify requirement changes written to output stable
Matt Harbison <matt_harbison@yahoo.com> [Sun, 06 Nov 2022 12:15:35 -0500] rev 49576
upgrade: byteify requirement changes written to output ui.write() expects bytes, and internally uses `b''` as the default when getting the `label` keyword from `*args`. So either we're missing test coverage, or there's some very subtle conversion from unicode somewhere. Also, slip in a type hint to flag this in the future.
Fri, 04 Nov 2022 22:59:16 -0400 typing: add basic type hints to stringutil.py
Matt Harbison <matt_harbison@yahoo.com> [Fri, 04 Nov 2022 22:59:16 -0400] rev 49575
typing: add basic type hints to stringutil.py
Fri, 04 Nov 2022 17:54:43 -0400 vfs: make the default opener mode binary
Matt Harbison <matt_harbison@yahoo.com> [Fri, 04 Nov 2022 17:54:43 -0400] rev 49574
vfs: make the default opener mode binary The default was already binary for `abstractvfs`, and the `vfs` implementation adds binary mode if the caller didn't supply it. Therefore, it should be safe for all vfs objects (and I don't think we want text reads anyway).
Wed, 02 Nov 2022 17:30:57 -0400 typing: add basic type hints to vfs.py
Matt Harbison <matt_harbison@yahoo.com> [Wed, 02 Nov 2022 17:30:57 -0400] rev 49573
typing: add basic type hints to vfs.py Again, there's a lot more that could be done, but this sticks to the obviously correct stuff that is related to primitives or `vfs` objects. Hopefully this helps smoke out more path related bytes vs str issues in TortoiseHg. PyCharm seems smart enough to apply hints from annotated superclass functions, but pytype isn't (according to the *.pyi file generated), so those are annotated too. There was some discussion about changing the default path arg from `None` to `b''` in order to avoid the more verbose `Optional` declarations. This would be more in line with `os.path.join()` (which rejects `None`, but ignores empty strings), and still not change the behavior for callers still passing `None` (because the check is `if path` instead of an explicit check for `None`). But I didn't want to hold this up while discussing that, so this documents what _is_.
Fri, 04 Nov 2022 17:35:44 -0400 util: implement `writelines()` on atomictempfile
Matt Harbison <matt_harbison@yahoo.com> [Fri, 04 Nov 2022 17:35:44 -0400] rev 49572
util: implement `writelines()` on atomictempfile With typehints on the vfs objects, pytype will flag this: FAILED: /mnt/c/Users/Matt/hg/.pytype/pyi/mercurial/patch.pyi /usr/bin/python3.8 -m pytype.single --imports_info /mnt/c/Users/Matt/hg/.pytype/imports/mercurial.patch.imports --module-name mercurial.patch -V 3.7 -o /mnt/c/Users/Matt/hg/.pytype/pyi/mercurial/patch.pyi --analyze-annotated --nofail --quick /mnt/c/Users/Matt/hg/mercurial/patch.py File "/mnt/c/Users/Matt/hg/mercurial/patch.py", line 535, in writerej: No attribute 'writelines' on mercurial.util.atomictempfile [attribute-error] In Union[ mercurial.util.atomictempfile, mercurial.vfs.checkambigatclosing, mercurial.vfs.delayclosedfile, mercurial.windows.fdproxy, mercurial.windows.mixedfilemodewrapper ] It's not a real problem there (atomictempfile is only created by passing different args), but it's reasonable for this to implement the function and behave like a normal file. There are other functions missing that can be added if/when needed.
Wed, 02 Nov 2022 16:43:01 -0400 typing: add basic type hints to localrepo.py
Matt Harbison <matt_harbison@yahoo.com> [Wed, 02 Nov 2022 16:43:01 -0400] rev 49571
typing: add basic type hints to localrepo.py There's a lot more that could be done, but this sticks to the obviously correct stuff that is either related to existing imports or primitives. Hopefully this helps smoke out more path related bytes vs str issues in TortoiseHg. I'm avoiding the interfaces for now, because they seem to confuse pytype and/or PyCharm. It might be worth typing the return of `makelocalrepository` to `localrepository`, but that leaks an implementation detail, so that can be revisited later.
Sat, 05 Nov 2022 00:38:02 -0400 check-code: drop the check for whitespace around named parameters
Matt Harbison <matt_harbison@yahoo.com> [Sat, 05 Nov 2022 00:38:02 -0400] rev 49570
check-code: drop the check for whitespace around named parameters This check flags py3 annotations of named parameters, because `black` adds spaces around the assignment in this case. Since the chosen formatter has opinions (and pylint also wants the space in the case of annotations), drop the check so we can use py3 annotations.
Thu, 03 Nov 2022 16:30:35 +0100 rhg: add a config option to fall back immediately stable
Raphaël Gomès <rgomes@octobus.net> [Thu, 03 Nov 2022 16:30:35 +0100] rev 49569
rhg: add a config option to fall back immediately This is useful for debugging the behavior of the "default" `hg` in tests without having to manually substitute the fallback path.
(0) -30000 -10000 -3000 -1000 -300 -100 -50 -30 +30 +50 +100 +300 +1000 tip