##// END OF EJS Templates
bundle2: don't advertise stream bundle2 capability when feature disabled...
Gregory Szorc -
r35808:c1b9eb15 default
parent child Browse files
Show More
@@ -1519,8 +1519,20 b' def getrepocaps(repo, allowpushback=Fals'
1519 caps['checkheads'] = ('related',)
1519 caps['checkheads'] = ('related',)
1520 if 'phases' in repo.ui.configlist('devel', 'legacy.exchange'):
1520 if 'phases' in repo.ui.configlist('devel', 'legacy.exchange'):
1521 caps.pop('phases')
1521 caps.pop('phases')
1522 if not repo.ui.configbool('experimental', 'bundle2.stream'):
1522
1523 caps.pop('stream')
1523 # Don't advertise stream clone support in server mode if not configured.
1524 if role == 'server':
1525 streamsupported = repo.ui.configbool('server', 'uncompressed',
1526 untrusted=True)
1527 featuresupported = repo.ui.configbool('experimental', 'bundle2.stream')
1528
1529 if not streamsupported or not featuresupported:
1530 caps.pop('stream')
1531 # role == 'client'
1532 else:
1533 if not repo.ui.configbool('experimental', 'bundle2.stream'):
1534 caps.pop('stream')
1535
1524 return caps
1536 return caps
1525
1537
1526 def bundle2caps(remote):
1538 def bundle2caps(remote):
@@ -102,7 +102,7 b' Cannot stream clone when server.uncompre'
102 Main capabilities:
102 Main capabilities:
103 batch
103 batch
104 branchmap
104 branchmap
105 $USUAL_BUNDLE2_CAPS$%0Astream%3Dv2
105 $USUAL_BUNDLE2_CAPS$
106 changegroupsubset
106 changegroupsubset
107 compression=zstd,zlib
107 compression=zstd,zlib
108 getbundle
108 getbundle
@@ -136,8 +136,6 b' Cannot stream clone when server.uncompre'
136 remote-changegroup
136 remote-changegroup
137 http
137 http
138 https
138 https
139 stream
140 v2
141
139
142 $ hg clone --stream -U http://localhost:$HGPORT server-disabled
140 $ hg clone --stream -U http://localhost:$HGPORT server-disabled
143 warning: stream clone requested but server has them disabled
141 warning: stream clone requested but server has them disabled
General Comments 0
You need to be logged in to leave comments. Login now