diff mercurial/hgweb/protocol.py @ 6780:4c1d67e0fa8c

hgweb: move capabilities calculation back into hgweb.protocol
author Dirkjan Ochtman <dirkjan@ochtman.nl>
date Sun, 29 Jun 2008 11:35:08 +0200
parents d3147b4e3e8a
children b4b7261164d5
line wrap: on
line diff
--- a/mercurial/hgweb/protocol.py	Sun Jun 29 11:35:06 2008 +0200
+++ b/mercurial/hgweb/protocol.py	Sun Jun 29 11:35:08 2008 +0200
@@ -97,9 +97,14 @@
     req.write(z.flush())
 
 def capabilities(web, req):
-    resp = ' '.join(web.capabilities())
-    req.respond(HTTP_OK, HGTYPE, length=len(resp))
-    req.write(resp)
+    caps = ['lookup', 'changegroupsubset']
+    if web.repo.ui.configbool('server', 'uncompressed', untrusted=True):
+        caps.append('stream=%d' % web.repo.changelog.version)
+    if changegroupmod.bundlepriority:
+        caps.append('unbundle=%s' % ','.join(changegroupmod.bundlepriority))
+    rsp = ' '.join(caps)
+    req.respond(HTTP_OK, HGTYPE, length=len(rsp))
+    req.write(rsp)
 
 def unbundle(web, req):