X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=apps%2Fpatchwork%2Fbin%2Fpwclient;h=b0bd1d175b8105464b42951ad40c9a8db1abedfa;hb=73ec099a07e095016c56e49e050e20ed7056cb35;hp=75fc6ff9d54cf9af62841a2dcb6dbf9b23f4a151;hpb=f34e08f25546c6283da7d44f1485f8139efd9614;p=patchwork diff --git a/apps/patchwork/bin/pwclient b/apps/patchwork/bin/pwclient index 75fc6ff..b0bd1d1 100755 --- a/apps/patchwork/bin/pwclient +++ b/apps/patchwork/bin/pwclient @@ -286,7 +286,13 @@ def action_update_patch(rpc, patch_id, state = None, commit = None): sys.stderr.write("Patch not updated\n") def patch_id_from_hash(rpc, project, hash): - patch = rpc.patch_get_by_project_hash(project, hash) + try: + patch = rpc.patch_get_by_project_hash(project, hash) + except xmlrpclib.Fault: + # the server may not have the newer patch_get_by_project_hash function, + # so fall back to hash-only. + patch = rpc.patch_get_by_hash(hash) + if patch == {}: return None