Thu, 23 Sep 2021 15:36:43 +0200 dirstate: Replace dropfile with drop_item_and_copy_source
Simon Sapin <simon.sapin@octobus.net> [Thu, 23 Sep 2021 15:36:43 +0200] rev 48065
dirstate: Replace dropfile with drop_item_and_copy_source Those removing a DirstateItem and a copy source are always done together Differential Revision: https://phab.mercurial-scm.org/D11493
Thu, 23 Sep 2021 15:29:38 +0200 rust: Remove some obsolete doc-comments
Simon Sapin <simon.sapin@octobus.net> [Thu, 23 Sep 2021 15:29:38 +0200] rev 48064
rust: Remove some obsolete doc-comments About parameters that have been removed or replaced Differential Revision: https://phab.mercurial-scm.org/D11492
Thu, 23 Sep 2021 15:26:33 +0200 dirstate: Remove return boolean from dirstatemap.dropfile
Simon Sapin <simon.sapin@octobus.net> [Thu, 23 Sep 2021 15:26:33 +0200] rev 48063
dirstate: Remove return boolean from dirstatemap.dropfile None of the remaining callers use it. Differential Revision: https://phab.mercurial-scm.org/D11491
Wed, 22 Sep 2021 18:56:58 +0200 dirstate: Propagate dirstate-v2 parse errors from set_dirstate_item
Simon Sapin <simon.sapin@octobus.net> [Wed, 22 Sep 2021 18:56:58 +0200] rev 48062
dirstate: Propagate dirstate-v2 parse errors from set_dirstate_item … so that Python sees a proper ValueError instead of only `SystemError: Rust panic` Differential Revision: https://phab.mercurial-scm.org/D11489
Wed, 22 Sep 2021 18:42:00 +0200 dirstate: Don’t drop unrelated data in DirstateMap::set_entry
Simon Sapin <simon.sapin@octobus.net> [Wed, 22 Sep 2021 18:42:00 +0200] rev 48061
dirstate: Don’t drop unrelated data in DirstateMap::set_entry For example, copy source are handled separately. Removing it goes through the `copy_map_remove` method (exposed to Python as `.copymap.pop()`) Differential Revision: https://phab.mercurial-scm.org/D11488
Wed, 22 Sep 2021 18:21:58 +0200 dirstate: Skip no-op conversion in Rust DirstateMap::set_v1
Simon Sapin <simon.sapin@octobus.net> [Wed, 22 Sep 2021 18:21:58 +0200] rev 48060
dirstate: Skip no-op conversion in Rust DirstateMap::set_v1 Now that the `DirstateItem` python class is implemented in Rust containing a `DirstateEntry` value, use that value directly instead of reconstructing it from v1 data. Also rename from `set_v1` since dirstate-v1 data is not used anymore. Differential Revision: https://phab.mercurial-scm.org/D11487
Wed, 22 Sep 2021 11:33:29 +0200 dirstate: Use the Rust implementation of DirstateItem when Rust is enabled
Simon Sapin <simon.sapin@octobus.net> [Wed, 22 Sep 2021 11:33:29 +0200] rev 48059
dirstate: Use the Rust implementation of DirstateItem when Rust is enabled … instead of the C implementation, with C/Rust conversions at the FFI boundary Differential Revision: https://phab.mercurial-scm.org/D11486
Wed, 22 Sep 2021 11:28:52 +0200 rust: Add Python bindings for DirstateEntry as rustext.dirstate.DirstateItem
Simon Sapin <simon.sapin@octobus.net> [Wed, 22 Sep 2021 11:28:52 +0200] rev 48058
rust: Add Python bindings for DirstateEntry as rustext.dirstate.DirstateItem Differential Revision: https://phab.mercurial-scm.org/D11485
Mon, 20 Sep 2021 19:18:21 +0200 rust: Align DirstateEntry internals with Python/C DirstateItem
Simon Sapin <simon.sapin@octobus.net> [Mon, 20 Sep 2021 19:18:21 +0200] rev 48057
rust: Align DirstateEntry internals with Python/C DirstateItem This propagate to this Rust struct the similar change that was made recently to the Python classe and C struct. Namely, instead of storing a four-valued `state` field we now store seven (bit-packed) booleans that give lower-level information. Additionally, the marker values -1 and -2 for mtime and size should not be used internally anymore. They are replaced by some combinations of booleans For now, all uses of of `DirstateEntry` still use the compatibility APIs with `state` and marker values. Later the Rust API for DirstateMap will be increasingly updated to the new style. Also change the expected result of the test_non_normal_other_parent_entries unit test. Only a `DirstateEntry` with `size == -2 && mtime != -1` is affected, but this case never occurs outside of unit tests. `size == -2` was the marker value for "from other parent" entries, where no meaningful mtime is stored. Differential Revision: https://phab.mercurial-scm.org/D11484
Tue, 28 Sep 2021 09:40:57 +0200 branching: merge stable into default
Raphaël Gomès <rgomes@octobus.net> [Tue, 28 Sep 2021 09:40:57 +0200] rev 48056
branching: merge stable into default
Wed, 22 Sep 2021 17:14:54 -0400 bookmarks: add an option to make pull mirror remote bookmarks
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com> [Wed, 22 Sep 2021 17:14:54 -0400] rev 48055
bookmarks: add an option to make pull mirror remote bookmarks For backups for instance. Merging bookmarks is not a useful behavior in that case. Differential Revision: https://phab.mercurial-scm.org/D11490
Thu, 23 Sep 2021 09:42:20 -0700 errors: use InputError for bad path arguments to `hg annotate`
Martin von Zweigbergk <martinvonz@google.com> [Thu, 23 Sep 2021 09:42:20 -0700] rev 48054
errors: use InputError for bad path arguments to `hg annotate` Differential Revision: https://phab.mercurial-scm.org/D11498
Thu, 23 Sep 2021 09:40:01 -0700 errors: use InputError for bad --similarity value
Martin von Zweigbergk <martinvonz@google.com> [Thu, 23 Sep 2021 09:40:01 -0700] rev 48053
errors: use InputError for bad --similarity value Differential Revision: https://phab.mercurial-scm.org/D11497
Thu, 23 Sep 2021 09:38:45 -0700 errors: use InputError for some invalid revsets and such
Martin von Zweigbergk <martinvonz@google.com> [Thu, 23 Sep 2021 09:38:45 -0700] rev 48052
errors: use InputError for some invalid revsets and such Differential Revision: https://phab.mercurial-scm.org/D11496
Thu, 23 Sep 2021 17:05:37 -0400 merge: with stable
Augie Fackler <augie@google.com> [Thu, 23 Sep 2021 17:05:37 -0400] rev 48051
merge: with stable
Thu, 23 Sep 2021 16:52:35 +0900 dirstate: fix leak of entry object in dirstate_item_from_v1_data()
Yuya Nishihara <yuya@tcha.org> [Thu, 23 Sep 2021 16:52:35 +0900] rev 48050
dirstate: fix leak of entry object in dirstate_item_from_v1_data()
Thu, 23 Sep 2021 16:44:17 +0900 dirstate: fix parse_dirstate() to error out if NULL entry created
Yuya Nishihara <yuya@tcha.org> [Thu, 23 Sep 2021 16:44:17 +0900] rev 48049
dirstate: fix parse_dirstate() to error out if NULL entry created Since 83f0e93ec34b "dirstate-item: move the C implementation to the same logic", dirstate_item_from_v1_data() gets more likely to return NULL, and the fuzzer crashes because of that.
Mon, 20 Sep 2021 20:55:38 +0200 rust: Remove EntryState::Unknown
Simon Sapin <simon.sapin@octobus.net> [Mon, 20 Sep 2021 20:55:38 +0200] rev 48048
rust: Remove EntryState::Unknown This enum variant represented the `state == '?'` case, which was used to represent the absence of a dirstate entry/item (and therefore of that entry’s state). Now that previous refactors have removed this use in the Python/Rust FFI APIs, the remaining uses can be removed by replacing `EntryState` by `Option<EntryState>` where appropriate, using `None` to represent the absence of an entry. Differential Revision: https://phab.mercurial-scm.org/D11465
Mon, 20 Sep 2021 20:21:35 +0200 dirstate: Remove the `state == ' '` special case
Simon Sapin <simon.sapin@octobus.net> [Mon, 20 Sep 2021 20:21:35 +0200] rev 48047
dirstate: Remove the `state == ' '` special case Previously this was used to create a `DirstateItem` representing dirstate tree nodes that semantically don’t have an associated `DirtateItem`. This isn’t used anymore now that `dirstatemap.debug_iter` yields plain tuples. Differential Revision: https://phab.mercurial-scm.org/D11464
Mon, 20 Sep 2021 20:20:55 +0200 debugsate: Change debug_iter() to yield tuples instead of DirstateItem
Simon Sapin <simon.sapin@octobus.net> [Mon, 20 Sep 2021 20:20:55 +0200] rev 48046
debugsate: Change debug_iter() to yield tuples instead of DirstateItem This removes the need for `DirstateItem` to support the `state == ' '` special case which represents dirstate tree nodes without an item. Differential Revision: https://phab.mercurial-scm.org/D11463
Mon, 20 Sep 2021 19:59:09 +0200 debugstate: Always call dirstatemap.debug_iter()
Simon Sapin <simon.sapin@octobus.net> [Mon, 20 Sep 2021 19:59:09 +0200] rev 48045
debugstate: Always call dirstatemap.debug_iter() … passing it a new `all` argument for the `--all` CLI option, instead of conditionally calling `.debug_iter()` or `.items()` This prepares for the next commit. Differential Revision: https://phab.mercurial-scm.org/D11462
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
Wed, 15 Sep 2021 18:27:57 +0200 dirstate: update the documentation of the dirstatemap API
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 15 Sep 2021 18:27:57 +0200] rev 48020
dirstate: update the documentation of the dirstatemap API The API changed so should the documentation. Differential Revision: https://phab.mercurial-scm.org/D11436
Wed, 15 Sep 2021 12:38:56 +0200 dirstate: drop the `_addpath` method
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 15 Sep 2021 12:38:56 +0200] rev 48019
dirstate: drop the `_addpath` method All user have been migrated. Differential Revision: https://phab.mercurial-scm.org/D11435
Wed, 15 Sep 2021 12:33:59 +0200 dirstate: remove the `normallookup` function
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 15 Sep 2021 12:33:59 +0200] rev 48018
dirstate: remove the `normallookup` function All use have been migrated. Differential Revision: https://phab.mercurial-scm.org/D11434
Thu, 16 Sep 2021 14:14:33 +0200 dirstate: stop using `_normallookup` in the adddrop extension
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 16 Sep 2021 14:14:33 +0200] rev 48017
dirstate: stop using `_normallookup` in the adddrop extension That extension is just trying to produce a "corrupted" dirstate. Differential Revision: https://phab.mercurial-scm.org/D11433
Wed, 15 Sep 2021 18:12:55 +0200 dirstate: replace the use of `_normallookup` in `rebuild`
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 15 Sep 2021 18:12:55 +0200] rev 48016
dirstate: replace the use of `_normallookup` in `rebuild` Normal lookup is a complicated function that we want to get rid of. Differential Revision: https://phab.mercurial-scm.org/D11432
Wed, 15 Sep 2021 18:16:16 +0200 dirstate: replace the use of _normallookup in `setparents`
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 15 Sep 2021 18:16:16 +0200] rev 48015
dirstate: replace the use of _normallookup in `setparents` normal lookup is a complicated function that we want to get rid of. Differential Revision: https://phab.mercurial-scm.org/D11431
Wed, 15 Sep 2021 18:05:39 +0200 dirstate: introduce a set_tracked method on "map" and "item"
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 15 Sep 2021 18:05:39 +0200] rev 48014
dirstate: introduce a set_tracked method on "map" and "item" This move more implementation details withing the DirstateItem itself, which is what we have been doing for a while. Differential Revision: https://phab.mercurial-scm.org/D11430
Wed, 15 Sep 2021 11:13:46 +0200 dirstate: fix restoration of "merged" state after a remove
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 15 Sep 2021 11:13:46 +0200] rev 48013
dirstate: fix restoration of "merged" state after a remove Before this change, "merged" file that get removed and re-added later were recorded as "from_p2" instead. This came from 8fe74328f700, a 2014 changeset that start explicitly doing so for reason I have not been able to fully grasp. The graft test mentioned in the description are still happy after this changeset. So this changeset restore what seems to be the intended behavior. Restoring information as it was before the removal. Differential Revision: https://phab.mercurial-scm.org/D11429
Wed, 15 Sep 2021 10:20:25 +0200 dirstate: inline the last two `_drop` usage
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 15 Sep 2021 10:20:25 +0200] rev 48012
dirstate: inline the last two `_drop` usage The function is small and having the associated code directly inline help use to cleanup the dirstate API. Differential Revision: https://phab.mercurial-scm.org/D11428
Wed, 15 Sep 2021 10:02:11 +0200 dirstate: make a conditionnal easier to read in `setparents`
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 15 Sep 2021 10:02:11 +0200] rev 48011
dirstate: make a conditionnal easier to read in `setparents` By grabing `nullid` in the local space, we get the conditionnal to fit in one line. Differential Revision: https://phab.mercurial-scm.org/D11427
Wed, 15 Sep 2021 09:50:44 +0200 dirstate: removed the now unused `_add` method
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 15 Sep 2021 09:50:44 +0200] rev 48010
dirstate: removed the now unused `_add` method Differential Revision: https://phab.mercurial-scm.org/D11426
Wed, 15 Sep 2021 18:18:16 +0200 dirstate: replace `_add` call in `setparent`
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 15 Sep 2021 18:18:16 +0200] rev 48009
dirstate: replace `_add` call in `setparent` Same logic as the previous changeset, it get us closer to removed older API on the dirstate. Differential Revision: https://phab.mercurial-scm.org/D11425
Wed, 15 Sep 2021 09:41:02 +0200 dirstate: directly call the right function in `set_tracked`
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 15 Sep 2021 09:41:02 +0200] rev 48008
dirstate: directly call the right function in `set_tracked` This get use closer to removing some older API on the dirstate. Differential Revision: https://phab.mercurial-scm.org/D11424
Wed, 15 Sep 2021 10:05:25 +0200 dirstate: same logic as what we did for `_drop`
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 15 Sep 2021 10:05:25 +0200] rev 48007
dirstate: same logic as what we did for `_drop` This is part of the dirstatemap so let the dirstatemap deal with it. Differential Revision: https://phab.mercurial-scm.org/D11423
Wed, 15 Sep 2021 09:28:17 +0200 dirstate: use `tracked` property in `_addpath`
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 15 Sep 2021 09:28:17 +0200] rev 48006
dirstate: use `tracked` property in `_addpath` It is semantically better. Differential Revision: https://phab.mercurial-scm.org/D11422
Fri, 17 Sep 2021 08:57:12 +0200 rust: Update the memmap2 crate to version 0.4.0
Simon Sapin <simon.sapin@octobus.net> [Fri, 17 Sep 2021 08:57:12 +0200] rev 48005
rust: Update the memmap2 crate to version 0.4.0 This version: * Optionally implements the `StableDeref` trait, removing the need for a wrapper type doing that * Adds support for mapping empty files, which can routinely happen for dirstate-v2 data files. This was a cause of some failing tests when running with `run-tests.py --rhg --extra-config-opt rhg.status=1` Differential Revision: https://phab.mercurial-scm.org/D11446
Thu, 16 Sep 2021 16:42:16 -0700 dirstate: fix compilation warnings in `dirstate_item_set_possibly_dirty()`
Martin von Zweigbergk <martinvonz@google.com> [Thu, 16 Sep 2021 16:42:16 -0700] rev 48004
dirstate: fix compilation warnings in `dirstate_item_set_possibly_dirty()` Since https://phab.mercurial-scm.org/D11387 (i.e. the same patch as mentioned in my previous patch), Clang has also started warning about `dirstate_item_set_possibly_dirty()` missing an explicit return, and about its use of the result of an assignment as a condition without using parentheses. This patch fixes that. Differential Revision: https://phab.mercurial-scm.org/D11445
Thu, 16 Sep 2021 16:29:55 -0700 dirstate: make dirstate flags char be unsigned
Martin von Zweigbergk <martinvonz@google.com> [Thu, 16 Sep 2021 16:29:55 -0700] rev 48003
dirstate: make dirstate flags char be unsigned Since https://phab.mercurial-scm.org/D11387, `CC='clang -Werror' make local` has started failing like this: ``` mercurial/cext/util.h:41:50: error: implicit conversion from 'int' to 'char' changes value from 128 to -128 [-Werror,-Wconstant-conversion] static const char dirstate_flag_rust_special = 1 << 7; ~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~^~~~ ``` This patch fixes that by making the flags be an unsigned char. That also matches the `bool` typedef we have in `util.h`, which seems good since many of the `dirstate_item_c_*()` functions return a `bool`. Differential Revision: https://phab.mercurial-scm.org/D11444
Thu, 02 Sep 2021 03:59:35 +0200 dirstate: introduce a `set_clean` method on dirstate's map and items
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 02 Sep 2021 03:59:35 +0200] rev 48002
dirstate: introduce a `set_clean` method on dirstate's map and items This method is the "reverse" of "set possibly dirty", and can be used to more accurately other call that the dirstate was making. It is currently heavily influenced by its origin. Differential Revision: https://phab.mercurial-scm.org/D11421
Thu, 02 Sep 2021 04:03:20 +0200 dirstate: extract the logic to check file/dirname collision when adding a file
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 02 Sep 2021 04:03:20 +0200] rev 48001
dirstate: extract the logic to check file/dirname collision when adding a file Differential Revision: https://phab.mercurial-scm.org/D11420
Thu, 02 Sep 2021 02:53:47 +0200 dirstate: make dirstatemap.set_untracked deal with added file
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 02 Sep 2021 02:53:47 +0200] rev 48000
dirstate: make dirstatemap.set_untracked deal with added file This merge dropfile in set_untracked. Differential Revision: https://phab.mercurial-scm.org/D11419
Thu, 02 Sep 2021 02:48:56 +0200 dirstate: remove some usage of `_drop`
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 02 Sep 2021 02:48:56 +0200] rev 47999
dirstate: remove some usage of `_drop` This is a step toward being able to remove the `_drop` method on `dirstate`. Differential Revision: https://phab.mercurial-scm.org/D11418
Thu, 02 Sep 2021 02:44:12 +0200 dirstate: move the copymap drop inside dropfile
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 02 Sep 2021 02:44:12 +0200] rev 47998
dirstate: move the copymap drop inside dropfile Since the copymap is part of the dirstatemap it make more sense for the dirstatemap to manage it directly. This is part of a generic effort to move unified logic at lower level and to clean up higher level API. Differential Revision: https://phab.mercurial-scm.org/D11417
Tue, 14 Sep 2021 18:25:51 +0200 rust: Rename get_node methods to data_for_node, get_rev to data_for_rev
Simon Sapin <simon.sapin@octobus.net> [Tue, 14 Sep 2021 18:25:51 +0200] rev 47997
rust: Rename get_node methods to data_for_node, get_rev to data_for_rev These are respective methods of Changelog, Manifestlog, and Filelog; three Rust structs that that wrap a Revlog struct. This rename clarifies that node IDs or revision numbers are parameters, not return values. Also reword doc-comments in Manifestlog and Filelog to separate node IDs and revision numbers that are local to a given (non-changelog) revlog from those of a changeset. Differential Revision: https://phab.mercurial-scm.org/D11416
Tue, 14 Sep 2021 18:10:35 +0200 rust: Rename the `Revlog::get_node_rev` method to `rev_from_node`
Simon Sapin <simon.sapin@octobus.net> [Tue, 14 Sep 2021 18:10:35 +0200] rev 47996
rust: Rename the `Revlog::get_node_rev` method to `rev_from_node` This better describes the input and outputs of this method. Also rewrite the doc-comment, which seemed to have been left from copy-paste of another method. Differential Revision: https://phab.mercurial-scm.org/D11415
Tue, 14 Sep 2021 18:07:11 +0200 rust: Make private the `index` field of the `Revlog` struct
Simon Sapin <simon.sapin@octobus.net> [Tue, 14 Sep 2021 18:07:11 +0200] rev 47995
rust: Make private the `index` field of the `Revlog` struct To replace the previous use of this field from another module, add a `node_from_rev` method. This is the same method that already existed on `Changelog`. Differential Revision: https://phab.mercurial-scm.org/D11414
Mon, 26 Jul 2021 10:26:45 +0200 dirstate-v2: Remove the `.d` suffix in data file names
Simon Sapin <simon.sapin@octobus.net> [Mon, 26 Jul 2021 10:26:45 +0200] rev 47994
dirstate-v2: Remove the `.d` suffix in data file names It could cause confusion since `.d` is already used for revlogs. This suffix is not necessary since there is already a `dirstate.` prefix. Differential Revision: https://phab.mercurial-scm.org/D11413
Mon, 13 Sep 2021 18:48:48 +0200 rhg: Don’t compare ambiguous files one byte at a time
Simon Sapin <simon.sapin@octobus.net> [Mon, 13 Sep 2021 18:48:48 +0200] rev 47993
rhg: Don’t compare ambiguous files one byte at a time Even though the use of `BufReader` reduces the number of syscalls to read the file from disk, `.bytes()` yields a separate `Result` for every byte. Creating those results and dispatching on them is most likely costly. Instead, this commit opts for simplicity by reading the entire file into memory and comparing a single pair of byte strings. Note that memory already needs to contain the entire previous contents of the file, as read from the filelog. So with an extremely large file this doubles memory use but does not make it grow by orders of magnitude. At first I wrote code that still avoids reading the entire file into memory and compares one buffer at a time with `BufReader`. Find this code below for posterity. However its correctness is subtle. I ended up preferring the simplicity of the obviously-correct single comparison. ```rust let mut reader = BufReader::new(fobj); let mut expected = &contents_in_p1[..]; loop { let buf = reader.fill_buf().when_reading_file(&fs_path)?; if buf.is_empty() { // Found EOF return Ok(expected.is_empty()); } else if let Some(rest) = expected.drop_prefix(buf) { // What we read so far matches the expected content, continue reading let buf_len = buf.len(); reader.consume(buf_len); expected = rest } else { // Found different content return Ok(false); } } ``` Differential Revision: https://phab.mercurial-scm.org/D11412
Mon, 13 Sep 2021 18:09:10 +0200 rhg: Reuse manifest when checking status of multiple ambiguous files
Simon Sapin <simon.sapin@octobus.net> [Mon, 13 Sep 2021 18:09:10 +0200] rev 47992
rhg: Reuse manifest when checking status of multiple ambiguous files When `rhg status` cannot determine whether a file is clean based on mtime and size alone, it needs to compare its contents with those found in the parent commit. Previously, rhg would find the (same) manifest of that commit again for every such file. This is lifted out of the loop and reused. Differential Revision: https://phab.mercurial-scm.org/D11411
Mon, 13 Sep 2021 18:02:45 +0200 rust: Return HgError instead of RevlogError in revlog constructors
Simon Sapin <simon.sapin@octobus.net> [Mon, 13 Sep 2021 18:02:45 +0200] rev 47991
rust: Return HgError instead of RevlogError in revlog constructors This leaves fewer cases for callers to handle, as RevlogError is more general Differential Revision: https://phab.mercurial-scm.org/D11410
Mon, 13 Sep 2021 17:23:42 +0200 rhg: Align with Python on some revset parsing corner cases
Simon Sapin <simon.sapin@octobus.net> [Mon, 13 Sep 2021 17:23:42 +0200] rev 47990
rhg: Align with Python on some revset parsing corner cases In particular: * A string of ASCII digits can be either an integer on a hex prefix * The NULL node ID should convert to the NULL revision number Differential Revision: https://phab.mercurial-scm.org/D11409
Mon, 13 Sep 2021 15:42:39 +0200 rust: Add a Filelog struct that wraps Revlog
Simon Sapin <simon.sapin@octobus.net> [Mon, 13 Sep 2021 15:42:39 +0200] rev 47989
rust: Add a Filelog struct that wraps Revlog Some filelog-specific logic is moved from code `rhg cat` into this struct where it can better be reused. Additionally, a missing end delimiter for metadata causes an error to be returned instead of being silently ignored. Differential Revision: https://phab.mercurial-scm.org/D11408
Mon, 13 Sep 2021 13:45:10 +0200 rust: Add Repo::manifest(revision)
Simon Sapin <simon.sapin@octobus.net> [Mon, 13 Sep 2021 13:45:10 +0200] rev 47988
rust: Add Repo::manifest(revision) This deduplicates some common code. Differential Revision: https://phab.mercurial-scm.org/D11407
Mon, 13 Sep 2021 13:29:55 +0200 rust: Keep lazily-initialized Changelog and Manifest log on the Repo object
Simon Sapin <simon.sapin@octobus.net> [Mon, 13 Sep 2021 13:29:55 +0200] rev 47987
rust: Keep lazily-initialized Changelog and Manifest log on the Repo object That way if one of them is accessed multiple times it won’t be reopened from the filesystem. Differential Revision: https://phab.mercurial-scm.org/D11406
Mon, 13 Sep 2021 13:16:10 +0200 rust: Move lazy initialization of `Repo::dirstate_map` into a generic struct
Simon Sapin <simon.sapin@octobus.net> [Mon, 13 Sep 2021 13:16:10 +0200] rev 47986
rust: Move lazy initialization of `Repo::dirstate_map` into a generic struct More components of `Repo` will be added following the same pattern. Differential Revision: https://phab.mercurial-scm.org/D11405
Mon, 13 Sep 2021 13:01:25 +0200 rust: Rename Manifest to Manifestlog, ManifestEntry to Manifest
Simon Sapin <simon.sapin@octobus.net> [Mon, 13 Sep 2021 13:01:25 +0200] rev 47985
rust: Rename Manifest to Manifestlog, ManifestEntry to Manifest This appears to match the terminology used in Python code and on https://www.mercurial-scm.org/wiki/Manifest Differential Revision: https://phab.mercurial-scm.org/D11404
Thu, 09 Sep 2021 21:04:55 +0200 rust: Add Repo::dirstate_map and use it in `rhg status`
Simon Sapin <simon.sapin@octobus.net> [Thu, 09 Sep 2021 21:04:55 +0200] rev 47984
rust: Add Repo::dirstate_map and use it in `rhg status` This moves low-level dirstate wrangling out of the status command and into a more reusable location. The open dirstate map is lazily initialized and kept on the Repo object, for reuse by sub-sequent calls. Differential Revision: https://phab.mercurial-scm.org/D11398
Fri, 10 Sep 2021 09:53:09 +0200 rust: Switch to the memmap2-rs crate
Simon Sapin <simon.sapin@octobus.net> [Fri, 10 Sep 2021 09:53:09 +0200] rev 47983
rust: Switch to the memmap2-rs crate https://github.com/RazrFalcon/memmap2-rs This is a fork of the original memmap crate which appears to be unmaintained: https://github.com/danburkert/memmap-rs/issues/90 This fork is the most popular according to https://crates.io/keywords/mmap Differential Revision: https://phab.mercurial-scm.org/D11397
Thu, 09 Sep 2021 18:07:40 +0200 rust: Make OwningDirstateMap generic and move it into hg-core
Simon Sapin <simon.sapin@octobus.net> [Thu, 09 Sep 2021 18:07:40 +0200] rev 47982
rust: Make OwningDirstateMap generic and move it into hg-core This will enable using it in rhg too. The `OwningDirstateMap::new_empty` constructor is generic and accepts a value of any type that gives acces to a bytes buffer. That buffer must stay valid as long as the value hasn’t been dropped, and must keep its memory address even if the value is moved. The `StableDeref` marker trait encodes those constraints. Previously no trait was needed because the value was always of type `PyBytes` which we know satisfies those constraints. The buffer type is ereased in the struct itself through boxing and dynamic dispatch, in order to simplify other signatures that mention `OwningDirstateMap`. Differential Revision: https://phab.mercurial-scm.org/D11396
Mon, 06 Sep 2021 13:39:54 +0200 rust: Move PyBytesWithData out of copy-tracing code
Simon Sapin <simon.sapin@octobus.net> [Mon, 06 Sep 2021 13:39:54 +0200] rev 47981
rust: Move PyBytesWithData out of copy-tracing code So we can use it in other places to. Replace its `.data()` method with the `Deref<Target = [u8]>` trait, allowing this type to be used in generic contexts. Rename the type accordingly. Differential Revision: https://phab.mercurial-scm.org/D11395
Mon, 06 Sep 2021 11:39:59 +0200 rust: Move VFS code to its own module
Simon Sapin <simon.sapin@octobus.net> [Mon, 06 Sep 2021 11:39:59 +0200] rev 47980
rust: Move VFS code to its own module It was previously in the hg::repo module, but both repo code and vfs will likely grow in the future. Differential Revision: https://phab.mercurial-scm.org/D11394
Fri, 03 Sep 2021 16:32:35 +0200 rhg: Switch rhg.ignored-extensions config to Python-compatible list syntax
Simon Sapin <simon.sapin@octobus.net> [Fri, 03 Sep 2021 16:32:35 +0200] rev 47979
rhg: Switch rhg.ignored-extensions config to Python-compatible list syntax This includes the ability to have an extension name/path that contains a comma, by double-quoting it. Differential Revision: https://phab.mercurial-scm.org/D11390
Wed, 17 Feb 2021 20:49:53 +0100 rhg: Port Python’s `ui.configlist` as `Config::get_list`
Simon Sapin <simon.sapin@octobus.net> [Wed, 17 Feb 2021 20:49:53 +0100] rev 47978
rhg: Port Python’s `ui.configlist` as `Config::get_list` This new method is not used yet outside of its own unit tests, so this changeset should make no observable change. The Rust parser implementation attempts to exactly replicate the behavior of the Python one, even in edge cases where that behavior is… surprising. New unit tests capture some of these edge cases. This started as a line-by-line port. The main changes are: * Pass around a parser mode enum instead of parser functions * Inline the whole parser into one function * Use `[u8]::get` which returns an `Option`, instead of indexing after explicitly checking the length. Differential Revision: https://phab.mercurial-scm.org/D11389
Fri, 03 Sep 2021 16:37:20 +0200 rust: Generalize the `trim_end_newlines` utility of byte strings
Simon Sapin <simon.sapin@octobus.net> [Fri, 03 Sep 2021 16:37:20 +0200] rev 47977
rust: Generalize the `trim_end_newlines` utility of byte strings … into `trim_end_matches` that takes a callack. Also add `trim_start_matches`. Differential Revision: https://phab.mercurial-scm.org/D11388
Mon, 30 Aug 2021 21:18:29 +0200 dirstate-item: move the C implementation to the same logic
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 30 Aug 2021 21:18:29 +0200] rev 47976
dirstate-item: move the C implementation to the same logic Now that we know were we are going, we can update the C implementation. Differential Revision: https://phab.mercurial-scm.org/D11387
Tue, 31 Aug 2021 09:23:50 +0200 dirstate-item: introduce low level C function
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 31 Aug 2021 09:23:50 +0200] rev 47975
dirstate-item: introduce low level C function Since a lot of logic is about to change, we need to isolate it into bits that are easy reusable in the rest of the C code. Especially we need to split the part that do the pure logic from the part that do the Python wrapping. Differential Revision: https://phab.mercurial-scm.org/D11386
Fri, 27 Aug 2021 20:06:07 +0200 dirstate-item: factor some code in the C implementation
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 27 Aug 2021 20:06:07 +0200] rev 47974
dirstate-item: factor some code in the C implementation We have both `dirstate_item_from_v1_meth`, a class method, and `dirstate_item_from_v1_data`, a function taking low level C argument. Lets implement the former with the later. Differential Revision: https://phab.mercurial-scm.org/D11385
Fri, 27 Aug 2021 19:19:21 +0200 dirstate-item: `dirstate_item_from_v1_data` replaces make_dirstate_item
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 27 Aug 2021 19:19:21 +0200] rev 47973
dirstate-item: `dirstate_item_from_v1_data` replaces make_dirstate_item For different format, we will need multiple capsule anyways. Differential Revision: https://phab.mercurial-scm.org/D11384
Mon, 30 Aug 2021 18:45:54 +0200 pathutil: replace the `skip` argument of `dirs` with a boolean
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 30 Aug 2021 18:45:54 +0200] rev 47972
pathutil: replace the `skip` argument of `dirs` with a boolean It is ever only used for `r` file. So we make it a boolean this will give use more versatility later as we will stop storing the state explicitly. Differential Revision: https://phab.mercurial-scm.org/D11383
Thu, 02 Sep 2021 00:16:37 +0200 dirstate: clarify the message in nonnormal checking
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 02 Sep 2021 00:16:37 +0200] rev 47971
dirstate: clarify the message in nonnormal checking The previous message was quite verbose and hard to understand. The new one should be friendlier. Differential Revision: https://phab.mercurial-scm.org/D11382
Wed, 08 Sep 2021 15:59:48 -0400 merge: with stable
Augie Fackler <augie@google.com> [Wed, 08 Sep 2021 15:59:48 -0400] rev 47970
merge: with stable
Fri, 27 Aug 2021 18:00:47 +0200 dirstate-item: implement `v1_mtime` with higher level block
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 27 Aug 2021 18:00:47 +0200] rev 47969
dirstate-item: implement `v1_mtime` with higher level block This is much easier to read and maintain. Differential Revision: https://phab.mercurial-scm.org/D11375
Fri, 27 Aug 2021 17:59:00 +0200 dirstate-item: implement `v1_size` with higher level block
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 27 Aug 2021 17:59:00 +0200] rev 47968
dirstate-item: implement `v1_size` with higher level block This is much easier to read and maintain. Differential Revision: https://phab.mercurial-scm.org/D11374
Fri, 27 Aug 2021 17:48:12 +0200 dirstate-item: implement v1_state with higher level block
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 27 Aug 2021 17:48:12 +0200] rev 47967
dirstate-item: implement v1_state with higher level block This is much easier to read and maintain. Differential Revision: https://phab.mercurial-scm.org/D11373
Fri, 27 Aug 2021 18:04:49 +0200 dirstate-item: add more logic to `from_p2`
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 27 Aug 2021 18:04:49 +0200] rev 47966
dirstate-item: add more logic to `from_p2` This seem semantically better even if this tracking case seems to always comes with clean_p2 for now. Differential Revision: https://phab.mercurial-scm.org/D11372
Fri, 27 Aug 2021 17:14:54 +0200 dirstate-item: implement `merged_removed` in a simpler way
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 27 Aug 2021 17:14:54 +0200] rev 47965
dirstate-item: implement `merged_removed` in a simpler way We can simply use the underlying attribute. Differential Revision: https://phab.mercurial-scm.org/D11371
Fri, 27 Aug 2021 17:12:39 +0200 dirstate-item: implement `removed` in a simpler way
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 27 Aug 2021 17:12:39 +0200] rev 47964
dirstate-item: implement `removed` in a simpler way We can simply use the underlying attribute. Differential Revision: https://phab.mercurial-scm.org/D11370
Fri, 27 Aug 2021 17:10:26 +0200 dirstate-item: implement `from_p2_removed` in a simpler way
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 27 Aug 2021 17:10:26 +0200] rev 47963
dirstate-item: implement `from_p2_removed` in a simpler way We can simply use the underlying attribute. Differential Revision: https://phab.mercurial-scm.org/D11369
Fri, 27 Aug 2021 17:09:49 +0200 dirstate-item: implement `from_p2` in a simpler way
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 27 Aug 2021 17:09:49 +0200] rev 47962
dirstate-item: implement `from_p2` in a simpler way We can simply use the underlying attribute. Differential Revision: https://phab.mercurial-scm.org/D11368
Fri, 27 Aug 2021 17:09:06 +0200 dirstate-item: implement `merged` in a simpler way
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 27 Aug 2021 17:09:06 +0200] rev 47961
dirstate-item: implement `merged` in a simpler way We can simply use the underlying attribute. Differential Revision: https://phab.mercurial-scm.org/D11367
Fri, 27 Aug 2021 17:07:56 +0200 dirstate-item: implement `added` in a simpler way
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 27 Aug 2021 17:07:56 +0200] rev 47960
dirstate-item: implement `added` in a simpler way We can simply use the underlying attribute. Differential Revision: https://phab.mercurial-scm.org/D11366
Fri, 27 Aug 2021 17:07:12 +0200 dirstate-item: implement `tracked` in a simpler way
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 27 Aug 2021 17:07:12 +0200] rev 47959
dirstate-item: implement `tracked` in a simpler way We can simply use the underlying attribute. Differential Revision: https://phab.mercurial-scm.org/D11365
Fri, 27 Aug 2021 15:10:21 +0200 dirstate-item: keep the full information in memory (for pure form)
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 27 Aug 2021 15:10:21 +0200] rev 47958
dirstate-item: keep the full information in memory (for pure form) This changeset is finally reaching the area where we have been headed this whole time. Since all implementation details are contained inside de DirstateItem logic, we can change the way it is implemented. So we store the information that are passed to the object and use them to dynamically compute the "legacy" value. For now we only do this for the Pure implementation, as this is a good demonstration for the logic is fully insulated. The next step will be the update the C code too, to implement the various method with the new attribute (instead of the legacy one) and then start seriously thinking about the parameters we feed into DirstateItem. Differential Revision: https://phab.mercurial-scm.org/D11364
Thu, 26 Aug 2021 16:50:14 +0200 dirstate-item: have all the logic go through the v1_ accessors
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 26 Aug 2021 16:50:14 +0200] rev 47957
dirstate-item: have all the logic go through the v1_ accessors We are about to change the internal attribute. Having all the logic using the old "legacy" accessors will help to have a smooth transition. Differential Revision: https://phab.mercurial-scm.org/D11363
Thu, 26 Aug 2021 16:39:00 +0200 dirstate-item: drop the deprecated __getitem__ variante
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 26 Aug 2021 16:39:00 +0200] rev 47956
dirstate-item: drop the deprecated __getitem__ variante This is deprecated since 5.9. Differential Revision: https://phab.mercurial-scm.org/D11362
Mon, 30 Aug 2021 12:25:57 +0200 branching: merge stable into default
Raphaël Gomès <rgomes@octobus.net> [Mon, 30 Aug 2021 12:25:57 +0200] rev 47955
branching: merge stable into default
Fri, 27 Aug 2021 09:09:10 -0400 tests: normalize the way some debug output it matched
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com> [Fri, 27 Aug 2021 09:09:10 -0400] rev 47954
tests: normalize the way some debug output it matched Differential Revision: https://phab.mercurial-scm.org/D11361
Mon, 02 Aug 2021 23:46:26 -0400 tests: drop hgrc bits that have become the default
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com> [Mon, 02 Aug 2021 23:46:26 -0400] rev 47953
tests: drop hgrc bits that have become the default Differential Revision: https://phab.mercurial-scm.org/D11247
Mon, 02 Aug 2021 23:43:40 -0400 tests: manual cleanup now that dummyssh usage is implied
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com> [Mon, 02 Aug 2021 23:43:40 -0400] rev 47952
tests: manual cleanup now that dummyssh usage is implied Differential Revision: https://phab.mercurial-scm.org/D11246
Mon, 02 Aug 2021 21:25:01 -0400 tests: rely on dummyssh being the default
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com> [Mon, 02 Aug 2021 21:25:01 -0400] rev 47951
tests: rely on dummyssh being the default This commit is exactly the result of running this command: sed -i -e 's! *\(-e \|--ssh \|--config ui.ssh=\)[ \"]*$PYTHON[ \"]*$\(RUN\|\)TESTDIR/dummyssh[\"]* *! !g' -e '/^[ >]*ssh *=[ "]*$PYTHON[ "]*$\(RUN\|\)TESTDIR\/dummyssh[ "]*$/d' -e 's/^\( [$] .*[^ ]\) *$/\1/' *.t *.sh Sometimes the tests can be simplified further, but I think it's preferable to do the simplification separately. Differential Revision: https://phab.mercurial-scm.org/D11245
Mon, 02 Aug 2021 21:10:42 -0400 tests: setup dummyssh as the default ssh
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com> [Mon, 02 Aug 2021 21:10:42 -0400] rev 47950
tests: setup dummyssh as the default ssh To significantly reduce boilerplate in tests. One test is updated to show that it works, I expect to do the rest in follow up commits. Differential Revision: https://phab.mercurial-scm.org/D11244
Tue, 24 Aug 2021 21:25:35 +0200 dirstate: drop the `_otherparent` method
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 24 Aug 2021 21:25:35 +0200] rev 47949
dirstate: drop the `_otherparent` method It only has one caller with a lot of the logic already implemented. So lets inline it and cleans things up further. Differential Revision: https://phab.mercurial-scm.org/D11353
Tue, 24 Aug 2021 21:18:28 +0200 dirstate: drop the `_normal` method
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 24 Aug 2021 21:18:28 +0200] rev 47948
dirstate: drop the `_normal` method It only has one caller so lets inline it and cleans things up further. Differential Revision: https://phab.mercurial-scm.org/D11352
Tue, 24 Aug 2021 21:16:48 +0200 dirstate: drop the `_merge` method
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 24 Aug 2021 21:16:48 +0200] rev 47947
dirstate: drop the `_merge` method It only has one caller that only use one of the branch, so lets inline that branch and clean things up further. Differential Revision: https://phab.mercurial-scm.org/D11351
Tue, 24 Aug 2021 21:12:39 +0200 dirstate: drop the deprecated `drop` method
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 24 Aug 2021 21:12:39 +0200] rev 47946
dirstate: drop the deprecated `drop` method eh ;-) Differential Revision: https://phab.mercurial-scm.org/D11350
Tue, 24 Aug 2021 21:11:57 +0200 dirstate: drop the deprecated `merge` method
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 24 Aug 2021 21:11:57 +0200] rev 47945
dirstate: drop the deprecated `merge` method The method was deprecated in 5.9. Differential Revision: https://phab.mercurial-scm.org/D11349
Tue, 24 Aug 2021 21:11:42 +0200 dirstate: drop the deprecated `remove` method
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 24 Aug 2021 21:11:42 +0200] rev 47944
dirstate: drop the deprecated `remove` method The method was deprecated in 5.9. Differential Revision: https://phab.mercurial-scm.org/D11348
Tue, 24 Aug 2021 21:09:20 +0200 dirstate: drop the deprecated `add` method
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 24 Aug 2021 21:09:20 +0200] rev 47943
dirstate: drop the deprecated `add` method The method was deprecated in 5.9. Differential Revision: https://phab.mercurial-scm.org/D11347
Tue, 24 Aug 2021 21:09:01 +0200 dirstate: drop the deprecated `otherparent` method
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 24 Aug 2021 21:09:01 +0200] rev 47942
dirstate: drop the deprecated `otherparent` method The method was deprecated in 5.9. Differential Revision: https://phab.mercurial-scm.org/D11346
Tue, 24 Aug 2021 21:08:37 +0200 dirstate: drop the deprecated `normallookup` method
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 24 Aug 2021 21:08:37 +0200] rev 47941
dirstate: drop the deprecated `normallookup` method The method was deprecated in 5.9. Differential Revision: https://phab.mercurial-scm.org/D11345
Tue, 24 Aug 2021 21:08:09 +0200 dirstate: drop the deprecated `normal` method
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 24 Aug 2021 21:08:09 +0200] rev 47940
dirstate: drop the deprecated `normal` method The method was deprecated in 5.9. Differential Revision: https://phab.mercurial-scm.org/D11344
Tue, 24 Aug 2021 22:07:50 +0200 dirstate: also wrap the new method in `dirstatenonnormalcheck`
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 24 Aug 2021 22:07:50 +0200] rev 47939
dirstate: also wrap the new method in `dirstatenonnormalcheck` The goal of this is to make sure we set the data right, so we need to make sure it run after the new method, that we actually call, in addition to the old one, that we no longer call. Differential Revision: https://phab.mercurial-scm.org/D11343
Fri, 20 Aug 2021 16:12:33 +0200 dirstatemap: also discard item from sets
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 20 Aug 2021 16:12:33 +0200] rev 47938
dirstatemap: also discard item from sets This seems more consistent to do that. I don't think any test was actually barking about it, but the code feels a bit more robust now. Differential Revision: https://phab.mercurial-scm.org/D11332
(0) -30000 -10000 -3000 -1000 -128 +128 +1000 +3000 tip