From patchwork Sun Dec 30 06:00:27 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 208710 X-Patchwork-Delegate: stephen.finucane@intel.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from ozlabs.org (localhost [IPv6:::1]) by ozlabs.org (Postfix) with ESMTP id 1EDEA2C00F3 for ; Sun, 30 Dec 2012 17:00:52 +1100 (EST) Received: from mail-yh0-f73.google.com (mail-yh0-f73.google.com [209.85.213.73]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority" (not verified)) by ozlabs.org (Postfix) with ESMTPS id D293B2C00C8 for ; Sun, 30 Dec 2012 17:00:47 +1100 (EST) Received: by mail-yh0-f73.google.com with SMTP id 47so1231343yhr.2 for ; Sat, 29 Dec 2012 22:00:44 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state; bh=kVd+AkHkWBSd/uE8IRr21fxTiR8u8R/wJm5nnu2aelI=; b=MGuzbuhXZW66H0iKgoeGN+edx6n3lZ/XfsjUmluF/i5ns3u3rKkKDTtnIQYSX9jeGt OqYWt7MXIkHR1JJVvEOPOyGfCIL/wpimeT186yHRlsWTBO16kkuH1pY/iAgFNdqSo/X/ K3vCnnfoUqbWTIU2gA+g7CIuh2nHOqyvr3ABkpTaV1EcJPCpO9VGPiOzfX6pwvv8GJG4 RXn2V8C3QyZEWa+J2yy8NsiHnLWMuu4OFJtnTdbcCQqeHdqQado1fBV61SZYzlahB2rI TFeAXoHXnoDxyQDaokWi/VuXcVQLjwLPc9OARUAJvHnd7UceCyTJjZNsQTmLpE49ZGWl cA0g== X-Received: by 10.236.151.39 with SMTP id a27mr18068627yhk.42.1356847244667; Sat, 29 Dec 2012 22:00:44 -0800 (PST) Received: from wpzn3.hot.corp.google.com (216-239-44-65.google.com [216.239.44.65]) by gmr-mx.google.com with ESMTPS id a24si496878yhi.0.2012.12.29.22.00.44 (version=TLSv1/SSLv3 cipher=AES128-SHA); Sat, 29 Dec 2012 22:00:44 -0800 (PST) Received: from tictac.mtv.corp.google.com (tictac.mtv.corp.google.com [172.22.73.80]) by wpzn3.hot.corp.google.com (Postfix) with ESMTP id 7721B100048; Sat, 29 Dec 2012 22:00:44 -0800 (PST) Received: by tictac.mtv.corp.google.com (Postfix, from userid 121310) id 2A6A280F2E; Sat, 29 Dec 2012 22:00:44 -0800 (PST) From: Doug Anderson To: patchwork@lists.ozlabs.org Subject: [PATCH 3/3] pwclient: Add command to find a whole series of patches Date: Sat, 29 Dec 2012 22:00:27 -0800 Message-Id: <1356847227-8917-4-git-send-email-dianders@chromium.org> X-Mailer: git-send-email 1.7.7.3 In-Reply-To: <1356847227-8917-1-git-send-email-dianders@chromium.org> References: <1356037567-10048-1-git-send-email-dianders@chromium.org> <1356847227-8917-1-git-send-email-dianders@chromium.org> X-Gm-Message-State: ALoCoQlVaL2dUNZAlTRyp3H2XKlIMHReE5sL1LFYELH7K7bnoGqAfKoHRnerf1mIJs7OQqe3vETIXvum9dwuiyZRAuodqkxpcPDVqurbazDiWawX8Of6c+O8MfG9WpF6q6tpCzWApPF154gUCz5iy1nGjSrMR9JQ7uTyY1n04WGVYwhqWBiZTbRkFNji440NDdu4h6tPgE3e1G35DpwpI8jeWRjX1sadrQ== Cc: Simon Glass , Jeremy Kerr , Mauro Carvalho Chehab X-BeenThere: patchwork@lists.ozlabs.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Patchwork development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Patchwork" Add a new filter option '-r' that uses the newly created XMLRPC method to list all patches in a series. Signed-off-by: Doug Anderson --- apps/patchwork/bin/pwclient | 23 +++++++++++++++++++---- 1 files changed, 19 insertions(+), 4 deletions(-) diff --git a/apps/patchwork/bin/pwclient b/apps/patchwork/bin/pwclient index 5fce359..f3f4134 100755 --- a/apps/patchwork/bin/pwclient +++ b/apps/patchwork/bin/pwclient @@ -129,7 +129,8 @@ def usage(): -w : Filter by submitter (name, e-mail substring search) -d : Filter by delegate (name, e-mail substring search) -n : Restrict number of results - -m : Filter by Message-Id\n""") + -m : Filter by Message-Id + -r : Filter by patches in the same series as \n""") sys.stderr.write("""\nActions that take an ID argument can also be \ invoked with: -h : Lookup by patch hash\n""") @@ -170,9 +171,20 @@ def list_patches(patches): for patch in patches: print("%-7d %-12s %s" % (patch['id'], patch['state'], patch['name'])) -def action_list(rpc, filter, submitter_str, delegate_str): +def action_list(rpc, filter, submitter_str, delegate_str, series_str): filter.resolve_ids(rpc) + if series_str != "": + try: + patch_id = int(series_str) + except: + sys.stderr.write("Invalid patch ID given\n") + sys.exit(1) + + patches = rpc.patch_to_series(patch_id) + list_patches(patches) + return + if submitter_str != "": ids = person_ids_by_name(rpc, submitter_str) if len(ids) == 0: @@ -329,7 +341,7 @@ auth_actions = ['update'] def main(): try: - opts, args = getopt.getopt(sys.argv[2:], 's:p:w:d:n:c:h:m:') + opts, args = getopt.getopt(sys.argv[2:], 's:p:w:d:n:c:h:m:r:') except getopt.GetoptError, err: print str(err) usage() @@ -346,6 +358,7 @@ def main(): project_str = "" commit_str = "" state_str = "" + series_str = "" hash_str = "" msgid_str = "" url = DEFAULT_URL @@ -363,6 +376,8 @@ def main(): for name, value in opts: if name == '-s': state_str = value + elif name == '-r': + series_str = value elif name == '-p': project_str = value elif name == '-w': @@ -433,7 +448,7 @@ def main(): if action == 'list' or action == 'search': if len(args) > 0: filt.add("name__icontains", args[0]) - action_list(rpc, filt, submitter_str, delegate_str) + action_list(rpc, filt, submitter_str, delegate_str, series_str) elif action.startswith('project'): action_projects(rpc)