Different capabilities for upload and receive
authorJohn Carr <john.carr@unrouted.co.uk>
Sun, 21 Dec 2008 12:36:12 +0000 (12:36 +0000)
committerJohn Carr <john.carr@unrouted.co.uk>
Sun, 21 Dec 2008 12:36:12 +0000 (12:36 +0000)
dulwich/server.py

index 3509588e6ef1c44ae487269b1a2b47a65fb55e82..12019de7afcefa06747305f8addb42aa6956383e 100644 (file)
@@ -100,8 +100,7 @@ class Handler(object):
             blob = blob[65530:]
 
     def capabilities(self):
-        # FIXME: Capabilities are different for pushing...
-        return "multi_ack side-band-64k thin-pack ofs-delta"
+        return " ".join(self.default_capabilities())
 
     def handshake(self, blob):
         """
@@ -127,6 +126,9 @@ class Handler(object):
 
 class UploadPackHandler(Handler):
 
+    def default_capabilities(self):
+        return ("multi_ack", "side-band-64k", "thin-pack", "ofs-delta")
+
     def handle(self):
         refs = self.backend.get_refs()
 
@@ -187,6 +189,9 @@ class UploadPackHandler(Handler):
 
 class ReceivePackHandler(Handler):
 
+    def default_capabilities(self):
+        return ("report-status", "delete-refs")
+
     def handle(self):
         refs = self.backend.get_refs()