Message ID | 1426170807-25147-1-git-send-email-jani.nikula@intel.com |
---|---|
State | Accepted |
Headers | show |
On Thu, Mar 12, 2015 at 04:33:27PM +0200, Jani Nikula wrote: > Add -a, --archive and -u, --unarchive options to update subcommand to > allow archiving and unarchiving the patches. > > Signed-off-by: Jani Nikula <jani.nikula@intel.com> I already submitted a patch for this: http://patchwork.ozlabs.org/patch/413357/ Unfortunately, the maintainer hasn't been very responsive. Brian
On Thu, 12 Mar 2015, Brian Norris <computersforpeace@gmail.com> wrote: > On Thu, Mar 12, 2015 at 04:33:27PM +0200, Jani Nikula wrote: >> Add -a, --archive and -u, --unarchive options to update subcommand to >> allow archiving and unarchiving the patches. >> >> Signed-off-by: Jani Nikula <jani.nikula@intel.com> > > I already submitted a patch for this: > > http://patchwork.ozlabs.org/patch/413357/ Hmm, does the filtering really work for you without an update to the server side? BR, Jani. > > Unfortunately, the maintainer hasn't been very responsive. > > Brian
On Thu, Mar 12, 2015 at 05:32:22PM +0200, Jani Nikula wrote: > On Thu, 12 Mar 2015, Brian Norris <computersforpeace@gmail.com> wrote: > > On Thu, Mar 12, 2015 at 04:33:27PM +0200, Jani Nikula wrote: > >> Add -a, --archive and -u, --unarchive options to update subcommand to > >> allow archiving and unarchiving the patches. > >> > >> Signed-off-by: Jani Nikula <jani.nikula@intel.com> > > > > I already submitted a patch for this: > > > > http://patchwork.ozlabs.org/patch/413357/ > > Hmm, does the filtering really work for you without an update to the > server side? No. That's why I mention this in the patch description: "And of course, the server must have an updated xmlrpc that supports the 'archived' field for list filtering (recently patched), otherwise you'll just get an empty list." This is patch 3/3, where patch 1/3 adds server support: http://patchwork.ozlabs.org/patch/413355/ Brian
On Thu, 12 Mar 2015, Brian Norris <computersforpeace@gmail.com> wrote: > On Thu, Mar 12, 2015 at 05:32:22PM +0200, Jani Nikula wrote: >> On Thu, 12 Mar 2015, Brian Norris <computersforpeace@gmail.com> wrote: >> > On Thu, Mar 12, 2015 at 04:33:27PM +0200, Jani Nikula wrote: >> >> Add -a, --archive and -u, --unarchive options to update subcommand to >> >> allow archiving and unarchiving the patches. >> >> >> >> Signed-off-by: Jani Nikula <jani.nikula@intel.com> >> > >> > I already submitted a patch for this: >> > >> > http://patchwork.ozlabs.org/patch/413357/ >> >> Hmm, does the filtering really work for you without an update to the >> server side? > > No. That's why I mention this in the patch description: > > "And of course, the server must have an updated xmlrpc that supports > the 'archived' field for list filtering (recently patched), otherwise > you'll just get an empty list." > > This is patch 3/3, where patch 1/3 adds server support: > > http://patchwork.ozlabs.org/patch/413355/ Right, I haven't been following the list lately. I'd like to have the feature though; I don't care whose patch makes it. Thanks, Jani.
diff --git a/apps/patchwork/bin/pwclient b/apps/patchwork/bin/pwclient index 7c28f0810f4d..56fc39b8c3db 100755 --- a/apps/patchwork/bin/pwclient +++ b/apps/patchwork/bin/pwclient @@ -276,7 +276,7 @@ def action_apply(rpc, patch_id, apply_cmd=None): sys.stderr.write("Error: No patch content found\n") sys.exit(1) -def action_update_patch(rpc, patch_id, state = None, commit = None): +def action_update_patch(rpc, patch_id, state = None, commit = None, archived=None): patch = rpc.patch_get(patch_id) if patch == {}: sys.stderr.write("Error getting information on patch ID %d\n" % \ @@ -295,6 +295,9 @@ def action_update_patch(rpc, patch_id, state = None, commit = None): if commit: params['commit_ref'] = commit + if archived != None: + params['archived'] = archived + success = False try: success = rpc.patch_set(patch_id, params) @@ -484,6 +487,20 @@ def main(): required=True, help='''Set patch state (e.g., 'Accepted', 'Superseded' etc.)''' ) + update_parser.add_argument( + '-a', '--archive', + action='store_true', + dest='archived', + default=None, + help='''Archive patch''' + ) + update_parser.add_argument( + '-u', '--unarchive', + action='store_false', + dest='archived', + default=None, + help='''Unarchive patch''' + ) update_parser.set_defaults(subcmd='update') list_parser = subparsers.add_parser("list", add_help=False, @@ -693,9 +710,10 @@ def main(): action_apply(rpc, patch_id, cmd) elif action == 'update': + archived = args.get('archived') for patch_id in non_empty(h, patch_ids): action_update_patch(rpc, patch_id, state = state_str, - commit = commit_str + commit = commit_str, archived = archived ) else:
Add -a, --archive and -u, --unarchive options to update subcommand to allow archiving and unarchiving the patches. Signed-off-by: Jani Nikula <jani.nikula@intel.com> --- apps/patchwork/bin/pwclient | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-)