comparison mercurial/hgweb/protocol.py @ 10377:04e1e6743809

streamclone: allow uncompressed clones by default
author Matt Mackall <mpm@selenic.com>
date Sun, 07 Feb 2010 15:31:53 +0100
parents 25e572394f5c
children ed87b6c60e0b
comparison
equal deleted inserted replaced
10376:a2950e053614 10377:04e1e6743809
109 109
110 yield z.flush() 110 yield z.flush()
111 111
112 def capabilities(repo, req): 112 def capabilities(repo, req):
113 caps = copy.copy(basecaps) 113 caps = copy.copy(basecaps)
114 if repo.ui.configbool('server', 'uncompressed', untrusted=True): 114 if streamclone.allowed(repo.ui):
115 caps.append('stream=%d' % repo.changelog.version) 115 caps.append('stream=%d' % repo.changelog.version)
116 if changegroupmod.bundlepriority: 116 if changegroupmod.bundlepriority:
117 caps.append('unbundle=%s' % ','.join(changegroupmod.bundlepriority)) 117 caps.append('unbundle=%s' % ','.join(changegroupmod.bundlepriority))
118 rsp = ' '.join(caps) 118 rsp = ' '.join(caps)
119 req.respond(HTTP_OK, HGTYPE, length=len(rsp)) 119 req.respond(HTTP_OK, HGTYPE, length=len(rsp))
200 os.unlink(tempname) 200 os.unlink(tempname)
201 201
202 def stream_out(repo, req): 202 def stream_out(repo, req):
203 req.respond(HTTP_OK, HGTYPE) 203 req.respond(HTTP_OK, HGTYPE)
204 try: 204 try:
205 for chunk in streamclone.stream_out(repo, untrusted=True): 205 for chunk in streamclone.stream_out(repo):
206 yield chunk 206 yield chunk
207 except streamclone.StreamException, inst: 207 except streamclone.StreamException, inst:
208 yield str(inst) 208 yield str(inst)