indygreg added a comment.
In https://phab.mercurial-scm.org/D4615#71677, @durin42 wrote:
> No, actually - I was proposing *removing* `required` entirely, and *only*
keying off the existence of a default. What you reduces us to only two valid
states: required-with-no-default and
durin42 added a subscriber: indygreg.
durin42 added a comment.
> indygreg added inline comments.
>
> INLINE COMMENTS
>
>> wireprotov2server.py:602-605
>> +if 'default' in meta and meta.get('required'):
>> +raise error.ProgrammingError('%s argument for
indygreg added inline comments.
INLINE COMMENTS
> wireprotov2server.py:602-605
> +if 'default' in meta and meta.get('required'):
> +raise error.ProgrammingError('%s argument for command %s is
> marked '
> + 'as required but has a
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG0b61d21f05cc: wireprotov2: declare command arguments richly
(authored by indygreg, committed by ).
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST UPDATE
durin42 added inline comments.
INLINE COMMENTS
> wireprotov2server.py:547
> +
> + ``required``
> + Bool indicating whether the argument is required.
https://phab.mercurial-scm.org/D4617 no longer exists, so I'm taking this
change as-is, but expect a follow-up (at least
indygreg updated this revision to Diff 11243.
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST UPDATE
https://phab.mercurial-scm.org/D4615?vs=4=11243
REVISION DETAIL
https://phab.mercurial-scm.org/D4615
AFFECTED FILES
mercurial/wireprotov2server.py
tests/test-http-protocol.t
indygreg added inline comments.
INLINE COMMENTS
> durin42 wrote in wireprotov2server.py:543-546
> Shouldn't there be a default XOR required == true? That is, could we get away
> with `default=None` and then deriving requiredness from default-availability?
We could do that, sure. Would it be OK
durin42 added inline comments.
INLINE COMMENTS
> wireprotov2server.py:543-546
> + ``default``
> + A callable returning the default value for this argument.
> +
> + ``required``
Shouldn't there be a default XOR required == true? That is, could we get away
with
indygreg created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.
REVISION SUMMARY
Previously, we declared command arguments with an example of
their value. After this commit, we declare command arguments
as a dict of metadata. This allows us