summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Myers <bpm@sgi.com>2012-11-05 21:15:01 +0800
committerJeremy Kerr <jk@ozlabs.org>2012-11-05 21:15:01 +0800
commitbc695f5a7e0a2dd184dc0eae7a923be24b1b1723 (patch)
treecf6dd558f816e7cf8384cf8b319cf25bec6f4b2c
parent02550731a4b37a7f42c1158afa0c2f7dd3cdb484 (diff)
downloadpatchwork-bc695f5a7e0a2dd184dc0eae7a923be24b1b1723.tar.bz2
patchwork-bc695f5a7e0a2dd184dc0eae7a923be24b1b1723.tar.xz
pwclient: lookup patch_id given Message-Id
Add a pwclient search option '-m' to look up a patch id given a Message-id. This is useful for automation and mailer hooks. Signed-off-by: Ben Myers <bpm@sgi.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
-rwxr-xr-xapps/patchwork/bin/pwclient11
1 files changed, 9 insertions, 2 deletions
diff --git a/apps/patchwork/bin/pwclient b/apps/patchwork/bin/pwclient
index 16ca337..9588615 100755
--- a/apps/patchwork/bin/pwclient
+++ b/apps/patchwork/bin/pwclient
@@ -127,7 +127,8 @@ def usage():
-p <project> : Filter by project name (see 'projects' for list)
-w <who> : Filter by submitter (name, e-mail substring search)
-d <who> : Filter by delegate (name, e-mail substring search)
- -n <max #> : Restrict number of results\n""")
+ -n <max #> : Restrict number of results
+ -m <messageid>: Filter by Message-Id\n""")
sys.stderr.write("""\nActions that take an ID argument can also be \
invoked with:
-h <hash> : Lookup by patch hash\n""")
@@ -319,7 +320,7 @@ auth_actions = ['update']
def main():
try:
- opts, args = getopt.getopt(sys.argv[2:], 's:p:w:d:n:c:h:')
+ opts, args = getopt.getopt(sys.argv[2:], 's:p:w:d:n:c:h:m:')
except getopt.GetoptError, err:
print str(err)
usage()
@@ -337,6 +338,7 @@ def main():
commit_str = ""
state_str = ""
hash_str = ""
+ msgid_str = ""
url = DEFAULT_URL
config = ConfigParser.ConfigParser()
@@ -362,6 +364,8 @@ def main():
commit_str = value
elif name == '-h':
hash_str = value
+ elif name == '-m':
+ msgid_str = value
elif name == '-n':
try:
filt.add("max_count", int(value))
@@ -400,6 +404,9 @@ def main():
if state_str:
filt.add("state", state_str)
+ if msgid_str:
+ filt.add("msgid", msgid_str)
+
try:
rpc = xmlrpclib.Server(url, transport = transport)
except: