Mercurial > public > mercurial-scm > hg-stable
comparison 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 |
comparison
equal
deleted
inserted
replaced
6779:d3147b4e3e8a | 6780:4c1d67e0fa8c |
---|---|
95 req.write(z.compress(chunk)) | 95 req.write(z.compress(chunk)) |
96 | 96 |
97 req.write(z.flush()) | 97 req.write(z.flush()) |
98 | 98 |
99 def capabilities(web, req): | 99 def capabilities(web, req): |
100 resp = ' '.join(web.capabilities()) | 100 caps = ['lookup', 'changegroupsubset'] |
101 req.respond(HTTP_OK, HGTYPE, length=len(resp)) | 101 if web.repo.ui.configbool('server', 'uncompressed', untrusted=True): |
102 req.write(resp) | 102 caps.append('stream=%d' % web.repo.changelog.version) |
103 if changegroupmod.bundlepriority: | |
104 caps.append('unbundle=%s' % ','.join(changegroupmod.bundlepriority)) | |
105 rsp = ' '.join(caps) | |
106 req.respond(HTTP_OK, HGTYPE, length=len(rsp)) | |
107 req.write(rsp) | |
103 | 108 |
104 def unbundle(web, req): | 109 def unbundle(web, req): |
105 | 110 |
106 def bail(response, headers={}): | 111 def bail(response, headers={}): |
107 length = int(req.env.get('CONTENT_LENGTH', 0)) | 112 length = int(req.env.get('CONTENT_LENGTH', 0)) |