Prep work for allowing multiple DREVSPECs to various commands, and properly
validating the input.
Details
Diff Detail
- Repository
- rHG Mercurial
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Event Timeline
The next patch attempts to provide coverage. I'm not sure how else to test this, because it wants to communicate with the server to resolve these values, so then it needs to be run as a command to hook up with the VCR infrastructure.
I guess that's fine. I just wish we had more unit tests for things like utils that are self-contained (in theory) and not really subject to change.
+def _getdrevs(ui, stack, *specs):
+ """convert user supplied DREVSPECs into "Differential Revision" dicts
+
+ See `hg help phabread` for how to specify each DREVSPEC.
+ """
+ if len(*specs) > 0:
^^^^^^
Fixed bad argument expansion since I had to rebase this. Please let me
know if that's wrong.
+def _getdrevs(ui, stack, *specs):
+ """convert user supplied DREVSPECs into "Differential Revision" dicts
+
+ See `hg help phabread` for how to specify each DREVSPEC.
+ """
+ if len(*specs) > 0:^^^^^^Fixed bad argument expansion since I had to rebase this. Please let me
know if that's wrong.
Never mind. Maybe specs is a list containing a single list, in which case,
the code is valid.
It looks like a tuple of strings:
>>> print('specs type is %s' % type(specs)) specs type is <type 'tuple'> >>> print('specs is %r' % (specs,)) specs is ('D1', 'D2', 'D3')
I copied this pattern from somewhere in Mercurial (file patterns look like they're handled in a similar way), but don't remember exactly where at this point.