summaryrefslogtreecommitdiffstats
path: root/apps/patchwork/bin/pwclient
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2009-10-22 17:46:46 -0400
committerJeremy Kerr <jk@ozlabs.org>2009-10-22 17:46:46 -0400
commit7bcba313da27b7230b14a7ea41d50e76cd03e9a5 (patch)
tree8c3e243f5f0311cef37ed8d7ee790f9a15efcc01 /apps/patchwork/bin/pwclient
parent799c2a2ac4e1d5b1fa5c02917551e18e1dc7aaaa (diff)
downloadpatchwork-7bcba313da27b7230b14a7ea41d50e76cd03e9a5.tar.bz2
patchwork-7bcba313da27b7230b14a7ea41d50e76cd03e9a5.tar.xz
pwclient,xmlrpc: Specify project for patch hash lookups
We may see the same hash for two patches if one is sent to two lists tracked by patchwork. This change adds a new xmlrpc method, patch_get_by_project_hash, which adds the linkname parameter to the lookup. We need to add a new method instead of replacing patch_get_by_hash, to avoid breaking existing pwclient apps. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'apps/patchwork/bin/pwclient')
-rwxr-xr-xapps/patchwork/bin/pwclient6
1 files changed, 3 insertions, 3 deletions
diff --git a/apps/patchwork/bin/pwclient b/apps/patchwork/bin/pwclient
index 863c1ae..75fc6ff 100755
--- a/apps/patchwork/bin/pwclient
+++ b/apps/patchwork/bin/pwclient
@@ -285,8 +285,8 @@ def action_update_patch(rpc, patch_id, state = None, commit = None):
if not success:
sys.stderr.write("Patch not updated\n")
-def patch_id_from_hash(rpc, hash):
- patch = rpc.patch_get_by_hash(hash)
+def patch_id_from_hash(rpc, project, hash):
+ patch = rpc.patch_get_by_project_hash(project, hash)
if patch == {}:
return None
@@ -382,7 +382,7 @@ def main():
patch_id = None
if hash_str:
- patch_id = patch_id_from_hash(rpc, hash_str)
+ patch_id = patch_id_from_hash(rpc, project_str, hash_str)
if patch_id is None:
sys.stderr.write("No patch has the hash provided\n")
sys.exit(1)