Matt Harbison <matt_harbison@yahoo.com> [Tue, 14 Dec 2021 17:25:46 -0500] rev 48487
pytype: stop excluding procutil.py
This avoids these false warnings:
File "/mnt/c/Users/Matt/hg/mercurial/utils/procutil.py", line 78, in <module>:
No attribute 'register' on Type[io.BufferedIOBase] [attribute-error]
File "/mnt/c/Users/Matt/hg/mercurial/utils/procutil.py", line 117, in <module>:
No attribute 'register' on Type[io.IOBase] [attribute-error]
File "/mnt/c/Users/Matt/hg/mercurial/utils/procutil.py", line 770, in runbgcommandpy3:
No attribute 'close' on int [attribute-error]
In Union[IO[Union[bytes, str]], int]
Differential Revision: https://phab.mercurial-scm.org/D11927
Matt Harbison <matt_harbison@yahoo.com> [Tue, 14 Dec 2021 17:06:32 -0500] rev 48486
pytype: stop excluding chgserver.py
This teaches pytype about some lazy initialization, and avoids the following:
File "/mnt/c/Users/Matt/hg/mercurial/chgserver.py", line 666, in _checkextensions:
No attribute '_hashstate' on chgunixservicehandler [attribute-error]
File "/mnt/c/Users/Matt/hg/mercurial/chgserver.py", line 672, in _checkextensions:
No attribute '_hashstate' on chgunixservicehandler [attribute-error]
File "/mnt/c/Users/Matt/hg/mercurial/chgserver.py", line 677, in _bind:
No attribute '_realaddress' on chgunixservicehandler [attribute-error]
File "/mnt/c/Users/Matt/hg/mercurial/chgserver.py", line 683, in _bind:
No attribute '_realaddress' on chgunixservicehandler [attribute-error]
File "/mnt/c/Users/Matt/hg/mercurial/chgserver.py", line 686, in _createsymlink:
No attribute '_baseaddress' on chgunixservicehandler [attribute-error]
File "/mnt/c/Users/Matt/hg/mercurial/chgserver.py", line 686, in _createsymlink:
No attribute '_realaddress' on chgunixservicehandler [attribute-error]
File "/mnt/c/Users/Matt/hg/mercurial/chgserver.py", line 688, in _createsymlink:
No attribute '_baseaddress' on chgunixservicehandler [attribute-error]
File "/mnt/c/Users/Matt/hg/mercurial/chgserver.py", line 689, in _createsymlink:
No attribute '_realaddress' on chgunixservicehandler [attribute-error]
File "/mnt/c/Users/Matt/hg/mercurial/chgserver.py", line 690, in _createsymlink:
No attribute '_baseaddress' on chgunixservicehandler [attribute-error]
Differential Revision: https://phab.mercurial-scm.org/D11926
Matt Harbison <matt_harbison@yahoo.com> [Mon, 13 Dec 2021 22:46:43 -0500] rev 48485
pytype: stop excluding webcommands.py
I have no idea why, but asserting that each value added to `emptydirs` is not
None didn't fix this:
File "/mnt/c/Users/Matt/hg/mercurial/hgweb/webcommands.py", line 621, in dirlist:
Function bytes.join was called with the wrong arguments [wrong-arg-types]
Expected: (self, iterable: Iterable[bytes])
Actually passed: (self, iterable: List[None])
Differential Revision: https://phab.mercurial-scm.org/D11924
Matt Harbison <matt_harbison@yahoo.com> [Mon, 13 Dec 2021 20:45:31 -0500] rev 48484
tests: drop an obsolete comment about a pytype failure
Differential Revision: https://phab.mercurial-scm.org/D11923
Matt Harbison <matt_harbison@yahoo.com> [Mon, 13 Dec 2021 20:19:09 -0500] rev 48483
pytype: stop excluding patch.py
The underlying `email.generator.BytesGenerator` is documented as requiring an
`fp` that accepts bytes, so I'm not sure why pytype is getting confused:
File "/mnt/c/Users/Matt/hg/mercurial/patch.py", line 112, in msgfp:
Function Generator.__init__ was called with the wrong arguments [wrong-arg-types]
Expected: (self, outfp: TextIO, ...)
Actually passed: (self, outfp: io.BytesIO, ...)
Differential Revision: https://phab.mercurial-scm.org/D11922
Matt Harbison <matt_harbison@yahoo.com> [Mon, 13 Dec 2021 19:34:06 -0500] rev 48482
pytype: stop excluding statprof.py
This seems to have worked fine before (at least on Linux). We could just add
suppression comments, but this file already imports from the mercurial package,
which seems to prevent this from running as a standalone program because of the
relative import of `pycompat`. PyCharm isn't happy either way.
File "/mnt/c/Users/Matt/hg/mercurial/statprof.py", line 501, in display:
Function TextIO.write was called with the wrong arguments [wrong-arg-types]
Expected: (self, s: str)
Actually passed: (self, s: bytes)
Called from (traceback):
line 1091, in main
File "/mnt/c/Users/Matt/hg/mercurial/statprof.py", line 501, in display:
Function TextIO.write was called with the wrong arguments [wrong-arg-types]
Expected: (self, s: str)
Actually passed: (self, s: bytes)
Called from (traceback):
line 431, in profile
File "/mnt/c/Users/Matt/hg/mercurial/statprof.py", line 522, in display:
Function TextIO.write was called with the wrong arguments [wrong-arg-types]
Expected: (self, s: str)
Actually passed: (self, s: bytes)
Called from (traceback):
line 1091, in main
File "/mnt/c/Users/Matt/hg/mercurial/statprof.py", line 522, in display:
Function TextIO.write was called with the wrong arguments [wrong-arg-types]
Expected: (self, s: str)
Actually passed: (self, s: bytes)
Called from (traceback):
line 431, in profile
File "/mnt/c/Users/Matt/hg/mercurial/statprof.py", line 523, in display:
Function TextIO.write was called with the wrong arguments [wrong-arg-types]
Expected: (self, s: str)
Actually passed: (self, s: bytes)
Called from (traceback):
line 1091, in main
File "/mnt/c/Users/Matt/hg/mercurial/statprof.py", line 523, in display:
Function TextIO.write was called with the wrong arguments [wrong-arg-types]
Expected: (self, s: str)
Actually passed: (self, s: bytes)
Called from (traceback):
line 431, in profile
File "/mnt/c/Users/Matt/hg/mercurial/statprof.py", line 524, in display:
Function TextIO.write was called with the wrong arguments [wrong-arg-types]
Expected: (self, s: str)
Actually passed: (self, s: bytes)
Called from (traceback):
line 1091, in main
File "/mnt/c/Users/Matt/hg/mercurial/statprof.py", line 524, in display:
Function TextIO.write was called with the wrong arguments [wrong-arg-types]
Expected: (self, s: str)
Actually passed: (self, s: bytes)
Called from (traceback):
line 431, in profile
File "/mnt/c/Users/Matt/hg/mercurial/statprof.py", line 796, in _write:
Function TextIO.write was called with the wrong arguments [wrong-arg-types]
Expected: (self, s: str)
Actually passed: (self, s: bytes)
Differential Revision: https://phab.mercurial-scm.org/D11921
Matt Harbison <matt_harbison@yahoo.com> [Mon, 13 Dec 2021 17:59:36 -0500] rev 48481
statprof: convert a few exception byte strings to str
That way these display without the b'' prefix.
Differential Revision: https://phab.mercurial-scm.org/D11920
Matt Harbison <matt_harbison@yahoo.com> [Mon, 13 Dec 2021 16:42:36 -0500] rev 48480
pytype: stop excluding wireprotov2server.py
This fixes:
File "/mnt/c/Users/Matt/hg/mercurial/wireprotov2server.py", line 584, in _capabilitiesv2:
unsupported operand type(s) for item assignment: Set[bytes] [unsupported-operands]
No attribute '__setitem__' on Set[bytes]
File "/mnt/c/Users/Matt/hg/mercurial/wireprotov2server.py", line 611, in _capabilitiesv2:
No attribute 'append' on dict [attribute-error]
In Union[List[bytes], List[nothing], dict]
Called from (traceback):
line 543, in httpv2apidescriptor
Differential Revision: https://phab.mercurial-scm.org/D11919
Matt Harbison <matt_harbison@yahoo.com> [Mon, 13 Dec 2021 14:43:10 -0500] rev 48479
pytype: stop excluding stringutil.py
This fixes the following:
File "/mnt/c/Users/Matt/hg/mercurial/utils/stringutil.py", line 267, in prettyrepr:
Function bytes.startswith expects 2 arg(s), got 3 [wrong-arg-count]
Expected: (self, prefix)
Actually passed: (self, prefix, _)
File "/mnt/c/Users/Matt/hg/mercurial/utils/stringutil.py", line 695, in escapestr:
No attribute 'escape_encode' on module 'codecs' [module-attr]
File "/mnt/c/Users/Matt/hg/mercurial/utils/stringutil.py", line 699, in unescapestr:
No attribute 'escape_decode' on module 'codecs' [module-attr]
Differential Revision: https://phab.mercurial-scm.org/D11918
Matt Harbison <matt_harbison@yahoo.com> [Mon, 13 Dec 2021 00:25:38 -0500] rev 48478
pytype: stop excluding cmdutil.py
Whatever was broken here seems to have been previously fixed.
Differential Revision: https://phab.mercurial-scm.org/D11917
Matt Harbison <matt_harbison@yahoo.com> [Mon, 13 Dec 2021 00:04:53 -0500] rev 48477
pytype: stop excluding copies.py
I can't prove that `targetrev` is always in `all_copies`, but it would have been
a runtime error before too if it's not.
Differential Revision: https://phab.mercurial-scm.org/D11916
Matt Harbison <matt_harbison@yahoo.com> [Sun, 12 Dec 2021 22:29:46 -0500] rev 48476
copies: fix some documentation typos
Differential Revision: https://phab.mercurial-scm.org/D11915
Matt Harbison <matt_harbison@yahoo.com> [Sun, 12 Dec 2021 22:24:16 -0500] rev 48475
copies: drop an unused variable
Differential Revision: https://phab.mercurial-scm.org/D11914
Matt Harbison <matt_harbison@yahoo.com> [Sun, 12 Dec 2021 22:09:13 -0500] rev 48474
pytype: stop excluding lsprof.py
Whatever was previously flagged in this file appears to have been fixed.
Differential Revision: https://phab.mercurial-scm.org/D11913
Matt Harbison <matt_harbison@yahoo.com> [Sun, 12 Dec 2021 21:10:02 -0500] rev 48473
pytype: stop excluding changegroup.py
The false positives that were detected seem to be related to what happens to the
variables after the local methods are used:
File "/mnt/c/Users/Matt/hg/mercurial/changegroup.py", line 353, in ondupchangelog:
No attribute 'append' on range [attribute-error]
In Union[List[nothing], range]
File "/mnt/c/Users/Matt/hg/mercurial/changegroup.py", line 357, in onchangelog:
No attribute 'update' on None [attribute-error]
Differential Revision: https://phab.mercurial-scm.org/D11912
Matt Harbison <matt_harbison@yahoo.com> [Sun, 12 Dec 2021 20:01:05 -0500] rev 48472
pytype: stop excluding upgrade.py
The sole failure here was this, which is fixed by simply creating a set like the
caller, instead of a dict:
File "/mnt/c/Users/Matt/hg/mercurial/upgrade.py", line 73, in upgraderepo:
No attribute 'discard' on Dict[nothing, nothing] [attribute-error]
In Union[Any, Dict[nothing, nothing]]
Differential Revision: https://phab.mercurial-scm.org/D11911
Simon Sapin <simon.sapin@octobus.net> [Tue, 14 Dec 2021 20:36:36 +0100] rev 48471
rhg: Skip reading the contents of ambiguous files in some cases
If the size of the file in the working directory does not match the length of
the filelog data, we know its contents will be different and don’t need to
read it.
rhg still decodes the filelog revision, which is not needed in some cases.
Differential Revision: https://phab.mercurial-scm.org/D11910
Simon Sapin <simon.sapin@octobus.net> [Tue, 14 Dec 2021 19:47:33 +0100] rev 48470
rhg: Mark it as expected that the
issue6528 bug is not reproduced
Differential Revision: https://phab.mercurial-scm.org/D11909
Martin von Zweigbergk <martinvonz@google.com> [Tue, 14 Dec 2021 13:41:34 -0800] rev 48469
filemerge: remove leftover documentation of removed argument
I removed the `premerge` argument in
https://phab.mercurial-scm.org/D11859.
Differential Revision: https://phab.mercurial-scm.org/D11925
Matt Harbison <matt_harbison@yahoo.com> [Mon, 13 Dec 2021 14:44:16 -0500] rev 48468
merge with stable
Simon Sapin <simon.sapin@octobus.net> [Mon, 13 Dec 2021 14:37:16 +0100] rev 48467
rhg: Print "bad match" errors in rhg status
Previously these would only be visible if enabled with some RUST_LOG
environment variable.
Differential Revision: https://phab.mercurial-scm.org/D11908
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 07 Dec 2021 15:14:08 +0100] rev 48466
share: make it possible to control the working copy format variant
A share will use the same format as its source for the store, but there are no
reason to not lets it control the working copy variant at creation time.
So we make it so.
Differential Revision: https://phab.mercurial-scm.org/D11892
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 07 Dec 2021 14:51:45 +0100] rev 48465
share: move the requirement initialisation code around
We will make this logic more flexible in the next patch. We start by moving it
at the end of the function without any other change for clarity.
Differential Revision: https://phab.mercurial-scm.org/D11891
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 08 Dec 2021 05:35:32 +0100] rev 48464
test: use `hg debugrequires` instead of `cat` in some tests
This give the "same" result, while taking in account that the requirement file
might be in different location, like what `share-safe` is doing.
Differential Revision: https://phab.mercurial-scm.org/D11895