]> git.ozlabs.org Git - patchwork/blobdiff - apps/patchwork/views/xmlrpc.py
pwclient,xmlrpc: Specify project for patch hash lookups
[patchwork] / apps / patchwork / views / xmlrpc.py
index 89c6bd6bb446dec5357a198944410c182fbf65e1..23e58bf279bd141f076a49f6cedc17a4bc3ac8f2 100644 (file)
@@ -296,7 +296,6 @@ def patch_list(filter={}):
             "commit_ref",
             "hash",
             "msgid",
-            "name",
             "max_count",
             ]
 
@@ -355,6 +354,16 @@ def patch_get_by_hash(hash):
     except:
         return {}
 
+@xmlrpc_method(False)
+def patch_get_by_project_hash(project, hash):
+    """Return structure for the given patch hash."""
+    try:
+        patch = Patch.objects.filter(project__linkname = project,
+                                     hash = hash)[0]
+        return patch_to_dict(patch)
+    except:
+        return {}
+
 @xmlrpc_method(False)
 def patch_get_mbox(patch_id):
     """Return mbox string for the given patch ID."""