Matt Harbison <matt_harbison@yahoo.com> [Thu, 26 Sep 2024 18:15:36 -0400] rev 51923
interfaces: convert the zope `Attribute` attrs to regular fields
At this point, we should have a useful protocol class.
The file syntax requires the type to be supplied for any fields that are
declared, but we'll leave the complex ones partially unspecified for now, for
simplicity. (Also, the things documented as `Callable` are really as future
type annotating worked showed- roll with it for now, but they're marked as TODO
for fixing later.) All of the fields and all of the attrs will need type
annotations, or the type rules say they are considered to be `Any`. That can be
done in a separate pass, possibly applying the `dirstate.pyi` file generated
from the concrete class.
The first cut of this turned the `interfaceutil.Attribute` fields into plain
fields, and thus the types on them. PyCharm flagged a few things as having
incompatible signatures when the concrete dirstate class subclassed this, when
the concrete class has them declared as `@property`. So they've been changed to
`@property` here in those cases. The remaining fields that are decorated in the
concrete class have comments noting the differences. We'll see if they need to
be changed going forward, but leave them for now. We'll be in trouble if the
`@util.propertycache` is needed, because we can't import that module here at
runtime, due to circular imports.
Matt Harbison <matt_harbison@yahoo.com> [Thu, 26 Sep 2024 18:09:33 -0400] rev 51922
interfaces: add the missing `self` arg to the dirstate Protocol class
This clears all of the errors that PyCharm has been flagging in this file, since
the zope interface was declared here.
Matt Harbison <matt_harbison@yahoo.com> [Thu, 26 Sep 2024 18:04:31 -0400] rev 51921
interfaces: convert the dirstate zope interface to a Protocol class
This is a small trial run for converting the repository interfaces enmasse, in
the same series of steps. I'm not sure that this current code is valid (it has
zope attribute fields, and it's missing all of the `self` args on its functions,
but that was the previous state of things, and made PyCharm really unhappy).
But it will be easier to review the repository interface changes if this change
is separate from adding `self` and dropping the zope attributes all over.
Having an empty constructor in a protocol is weird. I'm not sure if these args
should be converted to fields that all subclasses would have, and comments
around existing attributes say some should be going away. Comment it out for
now so that it's not in the way, but also not forgotten.
Matt Harbison <matt_harbison@yahoo.com> [Thu, 26 Sep 2024 17:47:39 -0400] rev 51920
tests: disable `test-check-interfaces.py` while converting to protocols
The goal is to convert everything, so get it all out of the way. The interfaces
don't get that much maintenance that this needs to be tested right now.
Arseniy Alekseyev <aalekseyev@janestreet.com> [Wed, 02 Oct 2024 14:51:56 +0100] rev 51919
tests: always access the mercurial repo through `helpers-testrepo.sh`
In some contexts the mercurial repo needs to be accessed through system hg.
That's what `helpers-testrepo.sh` enforces, but some tests incorrectly
use the mercurial repo without going through that script.
This patch fixes those tests.
Arseniy Alekseyev <aalekseyev@janestreet.com> [Wed, 02 Oct 2024 14:49:07 +0100] rev 51918
tests: in helpers-testrepo.sh switch from shell aliases to functions
The reason is that I want this script to work in non-interactive shells too.
(will be used in the next commit)
Arseniy Alekseyev <aalekseyev@janestreet.com> [Fri, 27 Sep 2024 17:25:15 +0100] rev 51917
rust: fix the deprecation warning in NaiveDateTime::from_timestamp
This warning appears between chrono 0.4.34 and 0.4.38, so
isn't affecting the current lock file, but it would come
when we upgraded the version.
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 27 Sep 2024 15:53:56 +0200] rev 51916
run-tests: ensure that --no-rust do not use rust
Since having a valid value in HGWITHRUSTEXT is enough to trigger the use of
rust, we need to unset it before install to be sure.