--- a/mercurial/hgweb/protocol.py Sun Feb 07 15:08:26 2010 +0100
+++ b/mercurial/hgweb/protocol.py Sun Feb 07 15:31:53 2010 +0100
@@ -111,7 +111,7 @@
def capabilities(repo, req):
caps = copy.copy(basecaps)
- if repo.ui.configbool('server', 'uncompressed', untrusted=True):
+ if streamclone.allowed(repo.ui):
caps.append('stream=%d' % repo.changelog.version)
if changegroupmod.bundlepriority:
caps.append('unbundle=%s' % ','.join(changegroupmod.bundlepriority))
@@ -202,7 +202,7 @@
def stream_out(repo, req):
req.respond(HTTP_OK, HGTYPE)
try:
- for chunk in streamclone.stream_out(repo, untrusted=True):
+ for chunk in streamclone.stream_out(repo):
yield chunk
except streamclone.StreamException, inst:
yield str(inst)
--- a/mercurial/sshserver.py Sun Feb 07 15:08:26 2010 +0100
+++ b/mercurial/sshserver.py Sun Feb 07 15:31:53 2010 +0100
@@ -91,7 +91,7 @@
capabilities: space separated list of tokens
'''
caps = copy.copy(self.caps)
- if self.ui.configbool('server', 'uncompressed'):
+ if streamclone.allowed(self.repo.ui):
caps.append('stream=%d' % self.repo.changelog.version)
self.respond("capabilities: %s\n" % (' '.join(caps),))
--- a/mercurial/streamclone.py Sun Feb 07 15:08:26 2010 +0100
+++ b/mercurial/streamclone.py Sun Feb 07 15:31:53 2010 +0100
@@ -33,11 +33,14 @@
#
# server writes out raw file data.
-def stream_out(repo, untrusted=False):
+def allowed(ui):
+ return ui.configbool('server', 'uncompressed', untrusted=True)
+
+def stream_out(repo):
'''stream out all metadata files in repository.
writes to file-like object, must support write() and optional flush().'''
- if not repo.ui.configbool('server', 'uncompressed', untrusted=untrusted):
+ if not allowed(repo.ui):
raise StreamException(1)
entries = []