Skip to content

Commit 9629d86

Browse files
committed
patch: Fix filtering by state
The '--state' parameter wasn't doing anything. Correct this, and set a sensible default corresponding to the default list of 'action_required' states found in Patchwork. Signed-off-by: Stephen Finucane <[email protected]> Closes-bug: #8
1 parent 8eeed51 commit 9629d86

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

git_pw/patch.py

+11
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,16 @@ def update_cmd(patch_id, commit_ref, state, delegate, archived):
156156
_show_patch(patch)
157157

158158

159+
# NOTE(stephenfin): The list of default states is populated from Patchwork's
160+
# 'fixtures/default_states.xml' file [1]. Due to bug #156, we can only
161+
# currently filter by one state but we've configured this for future support of
162+
# multiple states.
163+
#
164+
# [1] https://git.io/vN3vi
165+
# [2] https://git.io/vN3vX
159166
@click.command(name='list')
160167
@click.option('--state', metavar='STATE', multiple=True,
168+
default=['under-review', 'new'],
161169
help='Show only patches matching these states. Should be '
162170
'slugified representations of states. The available states '
163171
'are instance dependant.')
@@ -189,6 +197,9 @@ def list_cmd(state, submitter, delegate, archived, limit, page, sort, name):
189197

190198
params = []
191199

200+
for state in state:
201+
params.append(('state', state))
202+
192203
# TODO(stephenfin): It should be possible to filter patches submitter email
193204
for subm in submitter:
194205
people = api.index('people', {'q': subm})

0 commit comments

Comments
 (0)