Fri, 23 Aug 2019 08:54:32 -0700 run-tests: handle --local before --with-hg
Martin von Zweigbergk <martinvonz@google.com> [Fri, 23 Aug 2019 08:54:32 -0700] rev 42827
run-tests: handle --local before --with-hg We no longer support them both together, so this is now safe to do. By checking --local first, we avoid error out about an invalid --with-hg script if --local was also given (we instead tell the user that the options are mutually exclusive). I also had to wrap the 'binpath' we pass to setattr() in _strpath() to keep `python3 run-tests.py -l` working. That change also made `python3 run-tests.py -l --chg` work, which was the reason for this series. Differential Revision: https://phab.mercurial-scm.org/D6760
Fri, 23 Aug 2019 08:46:49 -0700 run-tests: error out on `--local --with-[c]hg`
Martin von Zweigbergk <martinvonz@google.com> [Fri, 23 Aug 2019 08:46:49 -0700] rev 42826
run-tests: error out on `--local --with-[c]hg` I don't see much reason to allow these combinations. You could use --local and override only one of --with-hg or --with-chg, but I don't see much practical use for that. It would be easy to work around anyway by passing both --with-hg and --with-chg. By erroring out, it makes the code a bit easier to reason about to allow the next few patches. Differential Revision: https://phab.mercurial-scm.org/D6759
Tue, 20 Aug 2019 18:05:07 -0400 contrib: simplify the genosxversion.py command to find the hg libraries
Matt Harbison <matt_harbison@yahoo.com> [Tue, 20 Aug 2019 18:05:07 -0400] rev 42825
contrib: simplify the genosxversion.py command to find the hg libraries I forget what problem I ran into while trying to teach the makefile to use a non-system python. (It might have ben missing hg-evolve and/or keyring, but `check_output()` was raising an error.) This still isn't great because it will return non zero for something like the username not being set, even though we aren't asking for it. But I suppose it's still useful to simplify. Differential Revision: https://phab.mercurial-scm.org/D6753
Sun, 18 Aug 2019 02:28:42 +0300 interfaceutil: move to interfaces/
Pulkit Goyal <pulkit@yandex-team.ru> [Sun, 18 Aug 2019 02:28:42 +0300] rev 42824
interfaceutil: move to interfaces/ Now that we have a dedicated folder for interfaces, let's move interfaceutil there. Differential Revision: https://phab.mercurial-scm.org/D6742
Sun, 18 Aug 2019 00:45:33 +0300 interfaces: create a new folder for interfaces and move repository.py in it
Pulkit Goyal <pulkit@yandex-team.ru> [Sun, 18 Aug 2019 00:45:33 +0300] rev 42823
interfaces: create a new folder for interfaces and move repository.py in it I was trying to understand current interfaces and write new ones and I realized we need to improve how current interfaces are organised. This creates a dedicated folder for defining interfaces and move `repository.py` which defines all the current interfaces inside it. Differential Revision: https://phab.mercurial-scm.org/D6741
Thu, 22 Aug 2019 16:47:31 -0700 narrow: fix typo "respositories"
Martin von Zweigbergk <martinvonz@google.com> [Thu, 22 Aug 2019 16:47:31 -0700] rev 42822
narrow: fix typo "respositories" Differential Revision: https://phab.mercurial-scm.org/D6758
Fri, 23 Aug 2019 17:03:42 -0400 merge with stable
Augie Fackler <augie@google.com> [Fri, 23 Aug 2019 17:03:42 -0400] rev 42821
merge with stable
Wed, 21 Aug 2019 13:14:39 -0700 merge: hint about using `hg resolve` for resolving conflicts
Martin von Zweigbergk <martinvonz@google.com> [Wed, 21 Aug 2019 13:14:39 -0700] rev 42820
merge: hint about using `hg resolve` for resolving conflicts This was suggested by one of our users at Google. Makes sense to me. Differential Revision: https://phab.mercurial-scm.org/D6755
Sat, 17 Aug 2019 18:28:55 +0900 rust-dirstate: remove test case for DirsMultiset::new(Manifest, Some)
Yuya Nishihara <yuya@tcha.org> [Sat, 17 Aug 2019 18:28:55 +0900] rev 42819
rust-dirstate: remove test case for DirsMultiset::new(Manifest, Some) It's no longer possible.
Sat, 17 Aug 2019 18:25:29 +0900 rust-dirstate: split DirsMultiset constructor per input type
Yuya Nishihara <yuya@tcha.org> [Sat, 17 Aug 2019 18:25:29 +0900] rev 42818
rust-dirstate: split DirsMultiset constructor per input type Since skip_state only applies to dirstate, it doesn't make sense to unify these constructors and dispatch by enum.
Sat, 17 Aug 2019 16:33:05 +0900 rust-dirstate: remove excessive clone() of parameter and return value
Yuya Nishihara <yuya@tcha.org> [Sat, 17 Aug 2019 16:33:05 +0900] rev 42817
rust-dirstate: remove excessive clone() of parameter and return value I think pass-by-ref is preferred in general.
Sat, 17 Aug 2019 18:06:08 +0900 rust-dirstate: handle invalid length of p1/p2 parameters
Yuya Nishihara <yuya@tcha.org> [Sat, 17 Aug 2019 18:06:08 +0900] rev 42816
rust-dirstate: handle invalid length of p1/p2 parameters It uses match syntax since map_err() failed to deduce the argument type.
Sat, 17 Aug 2019 11:37:42 +0900 rust: simply use TryInto to convert slice to array
Yuya Nishihara <yuya@tcha.org> [Sat, 17 Aug 2019 11:37:42 +0900] rev 42815
rust: simply use TryInto to convert slice to array Since our rust module depends on TryInto, there's no point to avoid using it. While rewriting copy_into_array(), I noticed CPython interface doesn't check the length of the p1/p2 values, which is marked as TODO.
Sat, 17 Aug 2019 13:55:05 +0900 rust-dirstate: use PARENT_SIZE constant where appropriate
Yuya Nishihara <yuya@tcha.org> [Sat, 17 Aug 2019 13:55:05 +0900] rev 42814
rust-dirstate: use PARENT_SIZE constant where appropriate
Sat, 17 Aug 2019 13:27:11 +0900 rust-dirstate: rename NULL_REVISION to NULL_ID which isn't a revision number
Yuya Nishihara <yuya@tcha.org> [Sat, 17 Aug 2019 13:27:11 +0900] rev 42813
rust-dirstate: rename NULL_REVISION to NULL_ID which isn't a revision number
Sat, 17 Aug 2019 13:26:04 +0900 rust-dirstate: remove repetition in array literal
Yuya Nishihara <yuya@tcha.org> [Sat, 17 Aug 2019 13:26:04 +0900] rev 42812
rust-dirstate: remove repetition in array literal
Sat, 17 Aug 2019 13:42:30 +0900 rust-dirstate: remove too abstracted way of getting &[u8]
Yuya Nishihara <yuya@tcha.org> [Sat, 17 Aug 2019 13:42:30 +0900] rev 42811
rust-dirstate: remove too abstracted way of getting &[u8]
Sat, 17 Aug 2019 11:43:05 +0900 rust-dirstate: remove unneeded "ref"
Yuya Nishihara <yuya@tcha.org> [Sat, 17 Aug 2019 11:43:05 +0900] rev 42810
rust-dirstate: remove unneeded "ref" At 7cae6bc29ff9, .to_owned() was rewritten as .to_owned().to_vec(), which is no longer needed since the filename is a single reference.
Sat, 17 Aug 2019 12:17:46 +0900 rust-parsers: fix unboxing of PyInt on Python 3
Yuya Nishihara <yuya@tcha.org> [Sat, 17 Aug 2019 12:17:46 +0900] rev 42809
rust-parsers: fix unboxing of PyInt on Python 3 Broken at 7cae6bc29ff9.
Tue, 20 Aug 2019 17:12:36 +0200 revlog: split `rawtext` retrieval out of _revisiondata
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 20 Aug 2019 17:12:36 +0200] rev 42808
revlog: split `rawtext` retrieval out of _revisiondata This part is reasonably independent. Having it on its own clarify the code flow and will help code that inherit from revlog to overwrite specific area only.
Mon, 19 Aug 2019 16:29:43 +0200 revlog: avoid caching raw text too early in _revisiondata
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 19 Aug 2019 16:29:43 +0200] rev 42807
revlog: avoid caching raw text too early in _revisiondata Without this change, we could cache the rawtext without considering for it validating the cache or not. If the exception raised by the invalid hash were to be caught and the same revision accessed again, the invalid rawtext would be returned.
Wed, 07 Aug 2019 23:55:01 +0200 revlog: add some documentation to `_revisiondata` code
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 07 Aug 2019 23:55:01 +0200] rev 42806
revlog: add some documentation to `_revisiondata` code
Wed, 07 Aug 2019 23:52:55 +0200 revlog: move `nullid` early return sooner in `_revisiondata`
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 07 Aug 2019 23:52:55 +0200] rev 42805
revlog: move `nullid` early return sooner in `_revisiondata` Let us deal with the special case before we start dealing with more generic case.
Wed, 07 Aug 2019 23:48:54 +0200 revlog: stop calling `basetext` `rawtext` in _revisiondata
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 07 Aug 2019 23:48:54 +0200] rev 42804
revlog: stop calling `basetext` `rawtext` in _revisiondata If the cache entry is used as a base test for delta, it is not the rawtext we need. We update the variable name to clarify this.
Wed, 07 Aug 2019 23:46:14 +0200 revlog: assign rawtext earlier in `_revisiondata`
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 07 Aug 2019 23:46:14 +0200] rev 42803
revlog: assign rawtext earlier in `_revisiondata` Assigning the revision earlier make the code easier to read.
Mon, 19 Aug 2019 16:14:27 +0200 revlog: drop silly `raw` parameter to `rawdata` function
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 19 Aug 2019 16:14:27 +0200] rev 42802
revlog: drop silly `raw` parameter to `rawdata` function This is a leftover from `revision` and does not make sense for `rawdata`
Mon, 19 Aug 2019 10:34:10 -0700 perf: don't depend on pycompat for older Mercurial versions
Martin von Zweigbergk <martinvonz@google.com> [Mon, 19 Aug 2019 10:34:10 -0700] rev 42801
perf: don't depend on pycompat for older Mercurial versions We already define local _sysstr() and _xrange() for compatibility, so we should use those. Also create a similar local _bytestr() corresponding to pycompat.bytestr(). Differential Revision: https://phab.mercurial-scm.org/D6745
Mon, 19 Aug 2019 10:39:13 -0700 perf: don't try to call `util.queue` on Mercurial version before it existed
Martin von Zweigbergk <martinvonz@google.com> [Mon, 19 Aug 2019 10:39:13 -0700] rev 42800
perf: don't try to call `util.queue` on Mercurial version before it existed Differential Revision: https://phab.mercurial-scm.org/D6744
Mon, 19 Aug 2019 10:38:38 -0700 perf: handle NameError for `pycompat.foo` when pycompat wasn't imported
Martin von Zweigbergk <martinvonz@google.com> [Mon, 19 Aug 2019 10:38:38 -0700] rev 42799
perf: handle NameError for `pycompat.foo` when pycompat wasn't imported On old Mercurial versions, we won't have a pycompat variable defined, and then `pycompat.foo` will raise a NameError. Differential Revision: https://phab.mercurial-scm.org/D6743
Wed, 07 Aug 2019 20:12:07 +0200 rawdata: update callers in shallowbundle
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 07 Aug 2019 20:12:07 +0200] rev 42798
rawdata: update callers in shallowbundle We update callers incrementally because this help bisecting failures. This was useful during development, so we expect it might be useful again in the future.
Wed, 07 Aug 2019 20:11:50 +0200 rawdata: update callers in storageutils
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 07 Aug 2019 20:11:50 +0200] rev 42797
rawdata: update callers in storageutils We update callers incrementally because this help bisecting failures. This was useful during development, so we expect it might be useful again in the future.
Wed, 07 Aug 2019 20:11:35 +0200 rawdata: update callers in delta utils
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 07 Aug 2019 20:11:35 +0200] rev 42796
rawdata: update callers in delta utils We update callers incrementally because this help bisecting failures. This was useful during development, so we expect it might be useful again in the future.
Wed, 07 Aug 2019 20:11:22 +0200 rawdata: update callers in repository
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 07 Aug 2019 20:11:22 +0200] rev 42795
rawdata: update callers in repository We update callers incrementally because this help bisecting failures. This was useful during development, so we expect it might be useful again in the future.
Wed, 07 Aug 2019 20:11:12 +0200 rawdata: update callers in testing/storage.py
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 07 Aug 2019 20:11:12 +0200] rev 42794
rawdata: update callers in testing/storage.py We update callers incrementally because this help bisecting failures. This was useful during development, so we expect it might be useful again in the future.
Wed, 07 Aug 2019 22:41:49 +0200 rawdata: update callers in test-revlog-raw
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 07 Aug 2019 22:41:49 +0200] rev 42793
rawdata: update callers in test-revlog-raw We update callers incrementally because this help bisecting failures. This was useful during development, so we expect it might be useful again in the future.
Wed, 07 Aug 2019 20:10:43 +0200 rawdata: update callers in lfs' tests
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 07 Aug 2019 20:10:43 +0200] rev 42792
rawdata: update callers in lfs' tests We update callers incrementally because this help bisecting failures. This was useful during development, so we expect it might be useful again in the future.
Wed, 07 Aug 2019 20:10:32 +0200 rawdata: update callers in lfs' wrapper
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 07 Aug 2019 20:10:32 +0200] rev 42791
rawdata: update callers in lfs' wrapper We update callers incrementally because this help bisecting failures. This was useful during development, so we expect it might be useful again in the future.
Wed, 07 Aug 2019 20:10:24 +0200 rawdata: update caller in wireprotov2server
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 07 Aug 2019 20:10:24 +0200] rev 42790
rawdata: update caller in wireprotov2server We update callers incrementally because this help bisecting failures. This was useful during development, so we expect it might be useful again in the future.
Wed, 07 Aug 2019 20:10:08 +0200 rawdata: update callers in debugcommands
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 07 Aug 2019 20:10:08 +0200] rev 42789
rawdata: update callers in debugcommands We update callers incrementally because this help bisecting failures. This was useful during development, so we expect it might be useful again in the future.
Wed, 07 Aug 2019 20:09:53 +0200 rawdata: update callers in sqlitestore
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 07 Aug 2019 20:09:53 +0200] rev 42788
rawdata: update callers in sqlitestore We update callers incrementally because this help bisecting failures. This was useful during development, so we expect it might be useful again in the future.
Wed, 07 Aug 2019 22:35:12 +0200 rawdata: update caller in remotefilelog
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 07 Aug 2019 22:35:12 +0200] rev 42787
rawdata: update caller in remotefilelog We update callers incrementally because this help bisecting failures. This was useful during development, so we expect it might be useful again in the future.
Wed, 07 Aug 2019 20:09:10 +0200 rawdata: update callers in bundlerepo
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 07 Aug 2019 20:09:10 +0200] rev 42786
rawdata: update callers in bundlerepo We update callers incrementally because this help bisecting failures. This was useful during development, so we expect it might be useful again in the future.
Wed, 07 Aug 2019 20:08:35 +0200 rawdata: update callers in context
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 07 Aug 2019 20:08:35 +0200] rev 42785
rawdata: update callers in context We update callers incrementally because this help bisecting failures. This was useful during development, so we expect it might be useful again in the future.
Wed, 07 Aug 2019 20:08:26 +0200 rawdata: update caller in revlog
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 07 Aug 2019 20:08:26 +0200] rev 42784
rawdata: update caller in revlog We update callers incrementally because this help bisecting failures. This was useful during development, so we expect it might be useful again in the future.
Thu, 15 Aug 2019 14:54:39 -0400 setup: fix a sorting issue I noticed in package names
Augie Fackler <augie@google.com> [Thu, 15 Aug 2019 14:54:39 -0400] rev 42783
setup: fix a sorting issue I noticed in package names Differential Revision: https://phab.mercurial-scm.org/D6733
Sat, 17 Aug 2019 10:25:04 +0900 py3: do not convert rust module/attribute names to bytes
Yuya Nishihara <yuya@tcha.org> [Sat, 17 Aug 2019 10:25:04 +0900] rev 42782
py3: do not convert rust module/attribute names to bytes policy.import*() functions expect system strings.
Sat, 17 Aug 2019 15:43:41 +0900 transplant: unnest --stop case
Yuya Nishihara <yuya@tcha.org> [Sat, 17 Aug 2019 15:43:41 +0900] rev 42781
transplant: unnest --stop case It should be aligned with --continue.
Fri, 16 Aug 2019 18:34:05 +0900 rust-discovery: use while loop instead of match + break
Yuya Nishihara <yuya@tcha.org> [Fri, 16 Aug 2019 18:34:05 +0900] rev 42780
rust-discovery: use while loop instead of match + break This looks slightly nicer.
Fri, 16 Aug 2019 18:31:17 +0900 rust-discovery: remove useless extern crate
Yuya Nishihara <yuya@tcha.org> [Fri, 16 Aug 2019 18:31:17 +0900] rev 42779
rust-discovery: remove useless extern crate
Fri, 26 Jul 2019 01:19:43 +0530 transplant: added support for --stop flag
Taapas Agrawal <taapas2897@gmail.com> [Fri, 26 Jul 2019 01:19:43 +0530] rev 42778
transplant: added support for --stop flag This adds fuctionality for `--stop` flag to `transplant`. A new method `stop` is added to `transplanter` class containing logic to abort transplant. Tests are updated as shown. Differential Revision: https://phab.mercurial-scm.org/D6695
Thu, 15 Aug 2019 20:43:25 +0530 unshelve: abort on using --keep and --interactive together
Navaneeth Suresh <navaneeths1998@gmail.com> [Thu, 15 Aug 2019 20:43:25 +0530] rev 42777
unshelve: abort on using --keep and --interactive together I am working on making interactive mode support `--keep` flag. Until we support the usage of `--interactive` and `--keep` together, let us abort on it. Differential Revision: https://phab.mercurial-scm.org/D6699
Tue, 20 Aug 2019 18:35:16 +0300 config: add experimental argument to the config registrar
Navaneeth Suresh <navaneeths1998@gmail.com> [Tue, 20 Aug 2019 18:35:16 +0300] rev 42776
config: add experimental argument to the config registrar Until now, there are almost 28 config items which are considered as `experimental` but, not present in the `experimental` section of the registrar. This patch adds an `experimental` argument to the config registrar to mark such config items. Differential Revision: https://phab.mercurial-scm.org/D6728 Differential Revision: https://phab.mercurial-scm.org/D6746
Wed, 14 Aug 2019 16:11:45 -0400 tests: split joint repo/changelog fake into one for each type
Augie Fackler <augie@google.com> [Wed, 14 Aug 2019 16:11:45 -0400] rev 42775
tests: split joint repo/changelog fake into one for each type I'm just not comfortable with fakes that get overloaded for multiple types: too often it gets out of hand and becomes difficult to trace. Differential Revision: https://phab.mercurial-scm.org/D6725
Tue, 13 Aug 2019 14:28:10 -0700 fix: pass line ranges as value instead of callback
Danny Hooper <hooper@google.com> [Tue, 13 Aug 2019 14:28:10 -0700] rev 42774
fix: pass line ranges as value instead of callback The callback no longer takes any arguments from the inner function, so we might as well call it sooner and pass the value instead. Note the value still needs to be recomputed every iteration to account for the previous iteration's changes to the file content. Differential Revision: https://phab.mercurial-scm.org/D6727
Tue, 13 Aug 2019 14:20:48 -0700 fix: correctly parse the :metadata subconfig
Danny Hooper <hooper@google.com> [Tue, 13 Aug 2019 14:20:48 -0700] rev 42773
fix: correctly parse the :metadata subconfig It's being handled as a string instead of a bool, though the thruthiness of the string makes the feature still essentially work. Added a regression test. Differential Revision: https://phab.mercurial-scm.org/D6726
Mon, 12 Aug 2019 16:39:39 -0700 fix: allow tools to use :linerange, but also run if a file is unchanged
Danny Hooper <hooper@google.com> [Mon, 12 Aug 2019 16:39:39 -0700] rev 42772
fix: allow tools to use :linerange, but also run if a file is unchanged The definition of "unchanged" here is subtle, because pure deletion diff hunks are ignored. That means this is different from using the --whole flag. This change allows you to configure, for example, a code formatter that: 1. Formats specific line ranges if specified via flags 2. Does not format the entire file when there are no line ranges provided 3. Performs some other kind of formatting regardless of provided line ranges This sounds a little far fetched, but it is meant to address a specific corner case encountered in Google's use of the fix extension. The default behavior is kept because it exists to prevent mistakes that could erase uncommitted changes. Differential Revision: https://phab.mercurial-scm.org/D6723
Wed, 10 Jul 2019 09:57:28 +0200 rust-dirstate: call rust dirstatemap from Python
Raphaël Gomès <rgomes@octobus.net> [Wed, 10 Jul 2019 09:57:28 +0200] rev 42771
rust-dirstate: call rust dirstatemap from Python Since Rust-backed Python classes cannot be used as baseclasses (for rust-cpython anyway), we use composition rather than inheritance. This also allows us to keep the IO operations in the Python side, removing (for now) the need to rewrite VFS in Rust, which would be a heavy undertaking. Differential Revision: https://phab.mercurial-scm.org/D6634
Wed, 10 Jul 2019 09:56:53 +0200 rust-dirstate: rust-cpython bridge for dirstatemap
Raphaël Gomès <rgomes@octobus.net> [Wed, 10 Jul 2019 09:56:53 +0200] rev 42770
rust-dirstate: rust-cpython bridge for dirstatemap This change also showcases the limitations of the `py_shared_ref!` macro. See the previous commit 'rust-dirstate: rust implementation of dirstatemap` for an explanation for the TODOs in the code. Differential Revision: https://phab.mercurial-scm.org/D6633
Wed, 10 Jul 2019 09:56:23 +0200 rust-dirstate: rust implementation of dirstatemap
Raphaël Gomès <rgomes@octobus.net> [Wed, 10 Jul 2019 09:56:23 +0200] rev 42769
rust-dirstate: rust implementation of dirstatemap The `dirstatemap` is one of the last building blocks needed to get to a `dirstate.walk` Rust implementation. Disclaimer: This change is part of a big (10) series of patches, all of which started as one big changeset that took a long time to write. This `dirstatemap` implementation is a compromise in terms of complexity both for me and for the reviewers. I chose to submit this patch right now because while it is not perfect, it works and is simple enough (IMHO) to be reviewed. The Python implementation uses a lot of lazy propertycaches, breaks encapsulation and is used as an iterator in a lot of places, all of which dictated the somewhat unidiomatic patterns in this change. Like written in the comments, rewriting this struct to use the typestate pattern might be a good idea, but this is a good first step. Differential Revision: https://phab.mercurial-scm.org/D6632
Tue, 09 Jul 2019 15:15:54 +0200 rust-cpython: add macro for sharing references
Raphaël Gomès <rgomes@octobus.net> [Tue, 09 Jul 2019 15:15:54 +0200] rev 42768
rust-cpython: add macro for sharing references Following an experiment done by Georges Racinet, we now have a working way of sharing references between Python and Rust. This is needed in many points of the codebase, for example every time we need to expose an iterator to a Rust-backed Python class. In a few words, references are (unsafely) marked as `'static` and coupled with manual reference counting; we are doing manual borrow-checking. This changes introduces two declarative macro to help reduce boilerplate. While it is better than not using macros, they are not perfect. They need to: - Integrate with the garbage collector for container types (not needed as of yet), as stated in the docstring - Allow for leaking multiple attributes at the same time - Inject the `py_shared_state` data attribute in `py_class`-generated structs - Automatically namespace the functions and attributes they generate For at least the last two points, we will need to write a procedural macro instead of a declarative one. While this reference-sharing mechanism is being ironed out I thought it best not to implement it yet. Lastly, and implementation detail renders our Rust-backed Python iterators too strict to be proper drop-in replacements, as will be illustrated in a future patch: if the data structure referenced by a non-depleted iterator is mutated, an `AlreadyBorrowed` exception is raised, whereas Python would allow it, only to raise a `RuntimeError` if `next` is called on said iterator. This will have to be addressed at some point. Differential Revision: https://phab.mercurial-scm.org/D6631
Tue, 09 Jul 2019 14:53:34 +0200 rust-docstrings: add missing module docstrings
Raphaël Gomès <rgomes@octobus.net> [Tue, 09 Jul 2019 14:53:34 +0200] rev 42767
rust-docstrings: add missing module docstrings Differential Revision: https://phab.mercurial-scm.org/D6630
Wed, 17 Jul 2019 11:37:43 +0200 rust-dirstate: improve API of `DirsMultiset`
Raphaël Gomès <rgomes@octobus.net> [Wed, 17 Jul 2019 11:37:43 +0200] rev 42766
rust-dirstate: improve API of `DirsMultiset` - Use opaque `Iterator` type instead of implementation-specific one from `HashMap` - Make `DirsMultiset` behave like a set both in Rust and from Python Differential Revision: https://phab.mercurial-scm.org/D6690
Tue, 09 Jul 2019 12:15:09 +0200 rust-dirstate: use EntryState enum instead of literals
Raphaël Gomès <rgomes@octobus.net> [Tue, 09 Jul 2019 12:15:09 +0200] rev 42765
rust-dirstate: use EntryState enum instead of literals This improves code readability quite a bit, while also adding a layer of safety because we're checking the state byte against the enum. Differential Revision: https://phab.mercurial-scm.org/D6629
Tue, 09 Jul 2019 11:49:49 +0200 rust-parsers: switch to parse/pack_dirstate to mutate-on-loop
Raphaël Gomès <rgomes@octobus.net> [Tue, 09 Jul 2019 11:49:49 +0200] rev 42764
rust-parsers: switch to parse/pack_dirstate to mutate-on-loop Both `parse_dirstate` and `pack_dirstate` can operate directly on the data they're passed, which prevents the creation of intermediate data structures, simplifies the function signatures and reduces boilerplate. They are exposed directly to the Python for now, but a later patch will make use of them inside `hg-core`. Differential Revision: https://phab.mercurial-scm.org/D6628
(0) -30000 -10000 -3000 -1000 -300 -100 -64 +64 +100 +300 +1000 +3000 tip