Show More
@@ -17,6 +17,10 b' from . import (' | |||||
17 | util, |
|
17 | util, | |
18 | ) |
|
18 | ) | |
19 |
|
19 | |||
|
20 | def allowservergeneration(ui): | |||
|
21 | """Whether streaming clones are allowed from the server.""" | |||
|
22 | return ui.configbool('server', 'uncompressed', True, untrusted=True) | |||
|
23 | ||||
20 | # This is it's own function so extensions can override it. |
|
24 | # This is it's own function so extensions can override it. | |
21 | def _walkstreamfiles(repo): |
|
25 | def _walkstreamfiles(repo): | |
22 | return repo.store.walk() |
|
26 | return repo.store.walk() |
@@ -564,7 +564,7 b' def _capabilities(repo, proto):' | |||||
564 | """ |
|
564 | """ | |
565 | # copy to prevent modification of the global list |
|
565 | # copy to prevent modification of the global list | |
566 | caps = list(wireprotocaps) |
|
566 | caps = list(wireprotocaps) | |
567 |
if |
|
567 | if streamclone.allowservergeneration(repo.ui): | |
568 | if repo.ui.configbool('server', 'preferuncompressed', False): |
|
568 | if repo.ui.configbool('server', 'preferuncompressed', False): | |
569 | caps.append('stream-preferred') |
|
569 | caps.append('stream-preferred') | |
570 | requiredformats = repo.requirements & repo.supportedformats |
|
570 | requiredformats = repo.requirements & repo.supportedformats | |
@@ -701,16 +701,13 b' def pushkey(repo, proto, namespace, key,' | |||||
701 | encoding.tolocal(old), new) |
|
701 | encoding.tolocal(old), new) | |
702 | return '%s\n' % int(r) |
|
702 | return '%s\n' % int(r) | |
703 |
|
703 | |||
704 | def _allowstream(ui): |
|
|||
705 | return ui.configbool('server', 'uncompressed', True, untrusted=True) |
|
|||
706 |
|
||||
707 | @wireprotocommand('stream_out') |
|
704 | @wireprotocommand('stream_out') | |
708 | def stream(repo, proto): |
|
705 | def stream(repo, proto): | |
709 | '''If the server supports streaming clone, it advertises the "stream" |
|
706 | '''If the server supports streaming clone, it advertises the "stream" | |
710 | capability with a value representing the version and flags of the repo |
|
707 | capability with a value representing the version and flags of the repo | |
711 | it is serving. Client checks to see if it understands the format. |
|
708 | it is serving. Client checks to see if it understands the format. | |
712 | ''' |
|
709 | ''' | |
713 |
if not |
|
710 | if not streamclone.allowservergeneration(repo.ui): | |
714 | return '1\n' |
|
711 | return '1\n' | |
715 |
|
712 | |||
716 | def getstream(it): |
|
713 | def getstream(it): |
General Comments 0
You need to be logged in to leave comments.
Login now