D6557: relnotes: added description about statemod._statecheck
martinvonz (Martin von Zweigbergk)
phabricator at mercurial-scm.org
Thu Jun 27 17:08:52 UTC 2019
martinvonz added inline comments.
INLINE COMMENTS
> next:63-69
> + has been added to `state.py` and is form of class called `_statecheck`.
> + To register a new state for an operation you need to add a `_statecheck`
> + object with necessary information to `_unfinishedstates` list.
> + The method of registration of a `_statecheck` object into `_unfinishedstates`
> + is not direct but through `addunfinished()`. The data needed for various
> + operations to be registered under `_unfinishedstates` list is stated in
> + `_statecheck` class.
The "private" (underscore-prefixed) members should not be mentioned here. Extension developers should not be accessing them, so they don't need to know about them. What they need to know is that if they had been adding operations to `cmdutil.unfinishedstates`, `cmdutil.afterresolvestates`, or `cmdutil.STATES` before, they now need to use `state.addunfinished()`.
I now see that `state.addunfinished()` has `**kwargs`, which means they will have to look at the `_statecheck` class after all. Perhaps we should copy the arguments over from the class to the function (and remove the defaults from the class) so it's easier to find them?
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST ACTION
https://phab.mercurial-scm.org/D6557/new/
REVISION DETAIL
https://phab.mercurial-scm.org/D6557
To: taapas1128, #hg-reviewers
Cc: martinvonz, mercurial-devel
More information about the Mercurial-devel
mailing list