@@ -199,23 +199,25 @@ def update_cmd(patch_ids, commit_ref, state, delegate, archived, fmt):
199
199
help = 'Show only patches by these submitters. Should be an '
200
200
'email, name or ID.' )
201
201
@click .option ('--delegate' , metavar = 'DELEGATE' , multiple = True ,
202
- help = 'Show only patches by these delegates. Should be an '
202
+ help = 'Show only patches with these delegates. Should be an '
203
203
'email or username.' )
204
+ @click .option ('--hash' , 'hashes' , metavar = 'HASH' , multiple = True ,
205
+ help = 'Show only patches with these hashes.' )
204
206
@click .option ('--archived' , default = False , is_flag = True ,
205
207
help = 'Include patches that are archived.' )
206
208
@utils .pagination_options (sort_fields = _sort_fields , default_sort = '-date' )
207
209
@utils .format_options (headers = _list_headers )
208
210
@click .argument ('name' , required = False )
209
211
@api .validate_multiple_filter_support
210
- def list_cmd (state , submitter , delegate , archived , limit , page , sort , fmt ,
211
- headers , name ):
212
+ def list_cmd (state , submitter , delegate , hashes , archived , limit , page , sort ,
213
+ fmt , headers , name ):
212
214
"""List patches.
213
215
214
216
List patches on the Patchwork instance.
215
217
"""
216
218
LOG .debug ('List patches: states=%s, submitters=%s, delegates=%s, '
217
- 'archived=%r' , ',' .join (state ), ',' .join (submitter ),
218
- ',' .join (delegate ), archived )
219
+ 'hashes=%s, archived=%r' , ',' .join (state ), ',' .join (submitter ),
220
+ ',' .join (delegate ), ',' . join ( hashes ), archived )
219
221
220
222
params = []
221
223
@@ -236,6 +238,9 @@ def list_cmd(state, submitter, delegate, archived, limit, page, sort, fmt,
236
238
else :
237
239
params .extend (api .retrieve_filter_ids ('users' , 'delegate' , delg ))
238
240
241
+ for hash_ in hashes :
242
+ params .append (('hash' , hash_ ))
243
+
239
244
params .extend ([
240
245
('q' , name ),
241
246
('archived' , 'true' if archived else 'false' ),
0 commit comments