D4615: wireprotov2: declare command arguments richly

2018-09-24 Thread indygreg (Gregory Szorc)
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

D4615: wireprotov2: declare command arguments richly

2018-09-24 Thread durin42 (Augie Fackler)
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

D4615: wireprotov2: declare command arguments richly

2018-09-24 Thread indygreg (Gregory Szorc)
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

D4615: wireprotov2: declare command arguments richly

2018-09-24 Thread indygreg (Gregory Szorc)
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

D4615: wireprotov2: declare command arguments richly

2018-09-24 Thread durin42 (Augie Fackler)
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

D4615: wireprotov2: declare command arguments richly

2018-09-20 Thread indygreg (Gregory Szorc)
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

D4615: wireprotov2: declare command arguments richly

2018-09-18 Thread indygreg (Gregory Szorc)
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

D4615: wireprotov2: declare command arguments richly

2018-09-18 Thread durin42 (Augie Fackler)
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

D4615: wireprotov2: declare command arguments richly

2018-09-17 Thread indygreg (Gregory Szorc)
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