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