Fri, 17 Sep 2021 13:33:45 +0200 rust: Make the fields of DirstateEntry private
Simon Sapin <simon.sapin@octobus.net> [Fri, 17 Sep 2021 13:33:45 +0200] rev 48044
rust: Make the fields of DirstateEntry private This is a first step toward making its internal structure equivalent to Python’s DirstateItem. Differential Revision: https://phab.mercurial-scm.org/D11461
Mon, 20 Sep 2021 13:16:36 +0200 rust: Remove support for passing a dict to the Rust pathutil.dirs()
Simon Sapin <simon.sapin@octobus.net> [Mon, 20 Sep 2021 13:16:36 +0200] rev 48043
rust: Remove support for passing a dict to the Rust pathutil.dirs() That is only used by the Python dirstatemap, which not used when Rust is enabled. This allows removing the private `extract_dirstate` function which creates `DirstateEntry` values. This in turn will make easier upcoming changes to `DirstateEntry`. Differential Revision: https://phab.mercurial-scm.org/D11460
Mon, 20 Sep 2021 12:52:32 +0200 rust: Remove the `rustext.parsers` module
Simon Sapin <simon.sapin@octobus.net> [Mon, 20 Sep 2021 12:52:32 +0200] rev 48042
rust: Remove the `rustext.parsers` module It only exported Rust implementations of the parse_dirstate and pack_dirtate functions, which are only used (anymore) when Rust is not enabled. fakedirstatewritetime.py was detecting the presence of `rustext.parsers` but what it really wants to know is whether the Rust implementation of `dirstatemap` is used. This changes it to detect `rustext.dirstate` instead. Differential Revision: https://phab.mercurial-scm.org/D11459
Fri, 17 Sep 2021 14:36:54 +0200 dirstate: remove now-unused .directories() method
Simon Sapin <simon.sapin@octobus.net> [Fri, 17 Sep 2021 14:36:54 +0200] rev 48041
dirstate: remove now-unused .directories() method It calls _rustmap.directories() which was already removed Differential Revision: https://phab.mercurial-scm.org/D11458
Fri, 17 Sep 2021 12:42:24 +0200 rust: Move DirstateEntry to its own module
Simon Sapin <simon.sapin@octobus.net> [Fri, 17 Sep 2021 12:42:24 +0200] rev 48040
rust: Move DirstateEntry to its own module … and RawEntry to the dirstate::parsers module, the only one that uses it. Differential Revision: https://phab.mercurial-scm.org/D11457
Mon, 20 Sep 2021 14:21:18 -0400 extensions: prevent a crash on py3 with a `minimumhgversion` str value
Matt Harbison <matt_harbison@yahoo.com> [Mon, 20 Sep 2021 14:21:18 -0400] rev 48039
extensions: prevent a crash on py3 with a `minimumhgversion` str value The expectation is that this field is bytes, but unported extensions are a thing and it shouldn't explode on a bad value. We already do this transformation in the version reporting mechanism. Differential Revision: https://phab.mercurial-scm.org/D11476
Mon, 20 Sep 2021 14:16:10 -0400 extensions: prevent a crash on py3 when testing a bad extension minimum
Matt Harbison <matt_harbison@yahoo.com> [Mon, 20 Sep 2021 14:16:10 -0400] rev 48038
extensions: prevent a crash on py3 when testing a bad extension minimum A `None` placeholder is populated for each missing component by `util.versiontuple()`, which could safely be used with `>` on py2, but not py3. I guess there's another hole here where if the string is entirely bogus (i.e no numbers), it will be treated as 0.0, and always load. But that's always been the case. Differential Revision: https://phab.mercurial-scm.org/D11475
Mon, 20 Sep 2021 11:22:27 -0400 typing: drop annotations on `mercurial/logcmdutil.walkopts` attributes
Matt Harbison <matt_harbison@yahoo.com> [Mon, 20 Sep 2021 11:22:27 -0400] rev 48037
typing: drop annotations on `mercurial/logcmdutil.walkopts` attributes Pytype 2021-09-09 must have learned some things about `@attr`, because while these were presumably required to help it before (c1d0f83d62c4::9a26fea2b518 and c11099cc1de4::224c786f4fce), these instances now get flagged as an assignment mismatch: File "/mnt/c/Users/Matt/hg/mercurial/logcmdutil.py", line 717, in walkopts: Type annotation for pats does not match type of assignment [annotation-type-mismatch] Annotation: List[bytes] Assignment: mercurial.thirdparty.attr._make._CountingAttr File "/mnt/c/Users/Matt/hg/mercurial/logcmdutil.py", line 718, in walkopts: Type annotation for opts does not match type of assignment [annotation-type-mismatch] Annotation: Dict[bytes, Any] Assignment: mercurial.thirdparty.attr._make._CountingAttr File "/mnt/c/Users/Matt/hg/mercurial/logcmdutil.py", line 722, in walkopts: Type annotation for revspec does not match type of assignment [annotation-type-mismatch] Annotation: List[bytes] Assignment: mercurial.thirdparty.attr._make._CountingAttr File "/mnt/c/Users/Matt/hg/mercurial/logcmdutil.py", line 725, in walkopts: Type annotation for bookmarks does not match type of assignment [annotation-type-mismatch] Annotation: List[bytes] Assignment: mercurial.thirdparty.attr._make._CountingAttr File "/mnt/c/Users/Matt/hg/mercurial/logcmdutil.py", line 726, in walkopts: Type annotation for branches does not match type of assignment [annotation-type-mismatch] Annotation: List[bytes] Assignment: mercurial.thirdparty.attr._make._CountingAttr File "/mnt/c/Users/Matt/hg/mercurial/logcmdutil.py", line 727, in walkopts: Type annotation for date does not match type of assignment [annotation-type-mismatch] Annotation: Optional[bytes] Assignment: mercurial.thirdparty.attr._make._CountingAttr File "/mnt/c/Users/Matt/hg/mercurial/logcmdutil.py", line 728, in walkopts: Type annotation for keywords does not match type of assignment [annotation-type-mismatch] Annotation: List[bytes] Assignment: mercurial.thirdparty.attr._make._CountingAttr File "/mnt/c/Users/Matt/hg/mercurial/logcmdutil.py", line 729, in walkopts: Type annotation for no_merges does not match type of assignment [annotation-type-mismatch] Annotation: bool Assignment: mercurial.thirdparty.attr._make._CountingAttr File "/mnt/c/Users/Matt/hg/mercurial/logcmdutil.py", line 730, in walkopts: Type annotation for only_merges does not match type of assignment [annotation-type-mismatch] Annotation: bool Assignment: mercurial.thirdparty.attr._make._CountingAttr File "/mnt/c/Users/Matt/hg/mercurial/logcmdutil.py", line 731, in walkopts: Type annotation for prune_ancestors does not match type of assignment [annotation-type-mismatch] Annotation: List[bytes] Assignment: mercurial.thirdparty.attr._make._CountingAttr File "/mnt/c/Users/Matt/hg/mercurial/logcmdutil.py", line 732, in walkopts: Type annotation for users does not match type of assignment [annotation-type-mismatch] Annotation: List[bytes] Assignment: mercurial.thirdparty.attr._make._CountingAttr File "/mnt/c/Users/Matt/hg/mercurial/logcmdutil.py", line 735, in walkopts: Type annotation for include_pats does not match type of assignment [annotation-type-mismatch] Annotation: List[bytes] Assignment: mercurial.thirdparty.attr._make._CountingAttr File "/mnt/c/Users/Matt/hg/mercurial/logcmdutil.py", line 736, in walkopts: Type annotation for exclude_pats does not match type of assignment [annotation-type-mismatch] Annotation: List[bytes] Assignment: mercurial.thirdparty.attr._make._CountingAttr File "/mnt/c/Users/Matt/hg/mercurial/logcmdutil.py", line 739, in walkopts: Type annotation for follow does not match type of assignment [annotation-type-mismatch] Annotation: int Assignment: mercurial.thirdparty.attr._make._CountingAttr File "/mnt/c/Users/Matt/hg/mercurial/logcmdutil.py", line 743, in walkopts: Type annotation for force_changelog_traversal does not match type of assignment [annotation-type-mismatch] Annotation: bool Assignment: mercurial.thirdparty.attr._make._CountingAttr File "/mnt/c/Users/Matt/hg/mercurial/logcmdutil.py", line 747, in walkopts: Type annotation for filter_revisions_by_pats does not match type of assignment [annotation-type-mismatch] Annotation: bool Assignment: mercurial.thirdparty.attr._make._CountingAttr File "/mnt/c/Users/Matt/hg/mercurial/logcmdutil.py", line 750, in walkopts: Type annotation for sort_revisions does not match type of assignment [annotation-type-mismatch] Annotation: Optional[bytes] Assignment: mercurial.thirdparty.attr._make._CountingAttr File "/mnt/c/Users/Matt/hg/mercurial/logcmdutil.py", line 753, in walkopts: Type annotation for limit does not match type of assignment [annotation-type-mismatch] Annotation: Optional[int] Assignment: mercurial.thirdparty.attr._make._CountingAttr Differential Revision: https://phab.mercurial-scm.org/D11474
Mon, 20 Sep 2021 11:05:30 -0400 util: eliminate the possibility of returning None from `versiontuple()`
Matt Harbison <matt_harbison@yahoo.com> [Mon, 20 Sep 2021 11:05:30 -0400] rev 48036
util: eliminate the possibility of returning None from `versiontuple()` This fixes the following error flagged by pytype: File "/mnt/c/Users/Matt/hg/mercurial/extensions.py", line 228, in load: unsupported operand types for > [unsupported-operands] Primitive types 'Optional[tuple]' and 'curver: Optional[tuple]' are not comparable. Differential Revision: https://phab.mercurial-scm.org/D11473
Mon, 20 Sep 2021 11:03:46 -0400 archival: force a `CompressionError` to bytes before passing to `error.Abort`
Matt Harbison <matt_harbison@yahoo.com> [Mon, 20 Sep 2021 11:03:46 -0400] rev 48035
archival: force a `CompressionError` to bytes before passing to `error.Abort` I'm not sure what changed before pytype 09-09-2021 (from 04-15-2021), but this started getting flagged. This fixes: File "/mnt/c/Users/Matt/hg/mercurial/archival.py", line 199, in taropen: Function bytestr.__init__ was called with the wrong arguments [wrong-arg-types] Expected: (self, ints: Iterable[int]) Actually passed: (self, ints: tarfile.CompressionError) Attributes of protocol Iterable[int] are not implemented on tarfile.CompressionError: __iter__ Differential Revision: https://phab.mercurial-scm.org/D11472
Mon, 20 Sep 2021 10:59:26 -0400 parser: force a `ValueError` to bytes before passing to `error.ParseError`
Matt Harbison <matt_harbison@yahoo.com> [Mon, 20 Sep 2021 10:59:26 -0400] rev 48034
parser: force a `ValueError` to bytes before passing to `error.ParseError` I'm not sure what changed before pytype 09-09-2021 (from 04-15-2021), but this started getting flagged. I think there's a pytype bug here, because I don't see how `.lower()` can be getting called on a `ValueError` after it is forced to a byte string. That's suppressed for now to make progress. This fixes: File "/mnt/c/Users/Matt/hg/mercurial/parser.py", line 219, in unescapestr: Function bytestr.__init__ was called with the wrong arguments [wrong-arg-types] Expected: (self, ints: Iterable[int]) Actually passed: (self, ints: ValueError) Attributes of protocol Iterable[int] are not implemented on ValueError: __iter__ File "/mnt/c/Users/Matt/hg/mercurial/parser.py", line 219, in unescapestr: No attribute 'lower' on ValueError [attribute-error] In Union[ValueError, mercurial.pycompat.bytestr] Differential Revision: https://phab.mercurial-scm.org/D11471
Mon, 20 Sep 2021 10:46:35 -0400 util: avoid a name-error warning in the `mmapread` exception handler
Matt Harbison <matt_harbison@yahoo.com> [Mon, 20 Sep 2021 10:46:35 -0400] rev 48033
util: avoid a name-error warning in the `mmapread` exception handler Newly caught by pytype 2021-09-09. File "/mnt/c/Users/Matt/hg/mercurial/util.py", line 458, in mmapread: Name 'fd' is not defined [name-error] Differential Revision: https://phab.mercurial-scm.org/D11470
Mon, 20 Sep 2021 10:45:18 -0400 typing: suppress an name-error warning in `mercurial/windows.py`
Matt Harbison <matt_harbison@yahoo.com> [Mon, 20 Sep 2021 10:45:18 -0400] rev 48032
typing: suppress an name-error warning in `mercurial/windows.py` Newly caught by pytype 2021-09-09. Differential Revision: https://phab.mercurial-scm.org/D11469
Mon, 20 Sep 2021 10:44:25 -0400 typing: suppress an import-error warning in `mercurial/utils/resourceutil.py`
Matt Harbison <matt_harbison@yahoo.com> [Mon, 20 Sep 2021 10:44:25 -0400] rev 48031
typing: suppress an import-error warning in `mercurial/utils/resourceutil.py` Newly caught by pytype 2021-09-09. Differential Revision: https://phab.mercurial-scm.org/D11468
Mon, 20 Sep 2021 10:42:38 -0400 encoding: force a few Errors to bytes before passing to `error.Abort`
Matt Harbison <matt_harbison@yahoo.com> [Mon, 20 Sep 2021 10:42:38 -0400] rev 48030
encoding: force a few Errors to bytes before passing to `error.Abort` I'm not sure what changed before pytype 09-09-2021 (from 04-15-2021), but these started getting flagged. PyCharm also flagged these. This fixes the following: File "/mnt/c/Users/Matt/hg/mercurial/encoding.py", line 243, in fromlocal: Function Abort.__init__ was called with the wrong arguments [wrong-arg-types] Expected: (self, message: Union[bytearray, bytes, memoryview], ...) Actually passed: (self, message: LookupError, ...) File "/mnt/c/Users/Matt/hg/mercurial/encoding.py", line 309, in lower: Function Abort.__init__ was called with the wrong arguments [wrong-arg-types] Expected: (self, message: Union[bytearray, bytes, memoryview], ...) Actually passed: (self, message: LookupError, ...) File "/mnt/c/Users/Matt/hg/mercurial/encoding.py", line 336, in upperfallback: Function Abort.__init__ was called with the wrong arguments [wrong-arg-types] Expected: (self, message: Union[bytearray, bytes, memoryview], ...) Actually passed: (self, message: LookupError, ...) Called from (traceback): line 391, in current file line 348, in get line 318, in upper Differential Revision: https://phab.mercurial-scm.org/D11467
Tue, 21 Sep 2021 00:16:35 -0400 typing: add a fake `__init__()` to bytestr to distract pytype
Matt Harbison <matt_harbison@yahoo.com> [Tue, 21 Sep 2021 00:16:35 -0400] rev 48029
typing: add a fake `__init__()` to bytestr to distract pytype I'm not sure what changed before pytype 09-09-2021 (from 04-15-2021), but these started getting flagged. This wrapping an exception in a `bytestr` pattern has been flagged before, and I've fixed it then with `stringutil.forcebytestr()`. But that doesn't work here, because it would create a circular import. I suspect the issue is `bytes.__new__()` wants `Iterable[int]`, so it just assumes the subclass will also take that. The referenced pytype bug isn't an exact match, but seems related and the suggested workaround helps. The specific warnings fixed are: File "/mnt/c/Users/Matt/hg/mercurial/encoding.py", line 212, in tolocal: Function bytestr.__init__ was called with the wrong arguments [wrong-arg-types] Expected: (self, ints: Iterable[int]) Actually passed: (self, ints: LookupError) Attributes of protocol Iterable[int] are not implemented on LookupError: __iter__ Called from (traceback): line 353, in current file File "/mnt/c/Users/Matt/hg/mercurial/encoding.py", line 240, in fromlocal: Function bytestr.__init__ was called with the wrong arguments [wrong-arg-types] Expected: (self, ints: Iterable[int]) Actually passed: (self, ints: UnicodeDecodeError) Attributes of protocol Iterable[int] are not implemented on UnicodeDecodeError: __iter__ Differential Revision: https://phab.mercurial-scm.org/D11466
Mon, 20 Sep 2021 15:51:23 -0400 merge: with stable
Augie Fackler <augie@google.com> [Mon, 20 Sep 2021 15:51:23 -0400] rev 48028
merge: with stable
Wed, 15 Sep 2021 18:41:38 +0200 dirstate: drop the `dirstatemap.dropfile` method
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 15 Sep 2021 18:41:38 +0200] rev 48027
dirstate: drop the `dirstatemap.dropfile` method All use have been migrated. Differential Revision: https://phab.mercurial-scm.org/D11443
Thu, 16 Sep 2021 15:21:22 +0200 dirstate: use `reset_state` instead of `dropfile` in test-rebuildstate.t
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 16 Sep 2021 15:21:22 +0200] rev 48026
dirstate: use `reset_state` instead of `dropfile` in test-rebuildstate.t As `dirstatemap.dropfile` is on its way out. Differential Revision: https://phab.mercurial-scm.org/D11442
Thu, 16 Sep 2021 15:20:28 +0200 dirstate: use `reset_state` instead of `dropfile` in largefile
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 16 Sep 2021 15:20:28 +0200] rev 48025
dirstate: use `reset_state` instead of `dropfile` in largefile As `dirstatemap.dropfile` is on its way out. Differential Revision: https://phab.mercurial-scm.org/D11441
Wed, 15 Sep 2021 18:40:25 +0200 dirstate: use `reset_state` in `rebuild` instead of `dropfile`
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 15 Sep 2021 18:40:25 +0200] rev 48024
dirstate: use `reset_state` in `rebuild` instead of `dropfile` As `dirstatemap.dropfile` is on its way out. Differential Revision: https://phab.mercurial-scm.org/D11440
Wed, 15 Sep 2021 18:38:24 +0200 dirstate: use `reset_state` to drop file in `update_file_p1`
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 15 Sep 2021 18:38:24 +0200] rev 48023
dirstate: use `reset_state` to drop file in `update_file_p1` The `dropfile` function is on its way out. Differential Revision: https://phab.mercurial-scm.org/D11439
Wed, 15 Sep 2021 18:36:59 +0200 dirstate: support file tracked nowhere in `reset_state`
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 15 Sep 2021 18:36:59 +0200] rev 48022
dirstate: support file tracked nowhere in `reset_state` This let the dirstatemap decide when to drop files. Differential Revision: https://phab.mercurial-scm.org/D11438
Wed, 15 Sep 2021 18:30:06 +0200 dirstate: drop dirstatemap.addfile
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 15 Sep 2021 18:30:06 +0200] rev 48021
dirstate: drop dirstatemap.addfile All users have been migrated. Differential Revision: https://phab.mercurial-scm.org/D11437
(0) -30000 -10000 -3000 -1000 -300 -100 -50 -24 +24 +50 +100 +300 +1000 +3000 tip