##// END OF EJS Templates
wireproto: don't expose legacy commands to version 2 of wire protocol...
Gregory Szorc -
r36629:6906547c default
parent child Browse files
Show More
@@ -740,6 +740,8 b' def batch(repo, proto, cmds, others):'
740
740
741 return bytesresponse(';'.join(res))
741 return bytesresponse(';'.join(res))
742
742
743 # TODO mark as version 1 transport only once interaction with
744 # SSH handshake mechanism is figured out.
743 @wireprotocommand('between', 'pairs')
745 @wireprotocommand('between', 'pairs')
744 def between(repo, proto, pairs):
746 def between(repo, proto, pairs):
745 pairs = [decodelist(p, '-') for p in pairs.split(" ")]
747 pairs = [decodelist(p, '-') for p in pairs.split(" ")]
@@ -760,7 +762,7 b' def branchmap(repo, proto):'
760
762
761 return bytesresponse('\n'.join(heads))
763 return bytesresponse('\n'.join(heads))
762
764
763 @wireprotocommand('branches', 'nodes')
765 @wireprotocommand('branches', 'nodes', transportpolicy=POLICY_V1_ONLY)
764 def branches(repo, proto, nodes):
766 def branches(repo, proto, nodes):
765 nodes = decodelist(nodes)
767 nodes = decodelist(nodes)
766 r = []
768 r = []
@@ -835,7 +837,7 b' def _capabilities(repo, proto):'
835 def capabilities(repo, proto):
837 def capabilities(repo, proto):
836 return bytesresponse(' '.join(_capabilities(repo, proto)))
838 return bytesresponse(' '.join(_capabilities(repo, proto)))
837
839
838 @wireprotocommand('changegroup', 'roots')
840 @wireprotocommand('changegroup', 'roots', transportpolicy=POLICY_V1_ONLY)
839 def changegroup(repo, proto, roots):
841 def changegroup(repo, proto, roots):
840 nodes = decodelist(roots)
842 nodes = decodelist(roots)
841 outgoing = discovery.outgoing(repo, missingroots=nodes,
843 outgoing = discovery.outgoing(repo, missingroots=nodes,
@@ -844,7 +846,8 b' def changegroup(repo, proto, roots):'
844 gen = iter(lambda: cg.read(32768), '')
846 gen = iter(lambda: cg.read(32768), '')
845 return streamres(gen=gen)
847 return streamres(gen=gen)
846
848
847 @wireprotocommand('changegroupsubset', 'bases heads')
849 @wireprotocommand('changegroupsubset', 'bases heads',
850 transportpolicy=POLICY_V1_ONLY)
848 def changegroupsubset(repo, proto, bases, heads):
851 def changegroupsubset(repo, proto, bases, heads):
849 bases = decodelist(bases)
852 bases = decodelist(bases)
850 heads = decodelist(heads)
853 heads = decodelist(heads)
@@ -1273,6 +1273,33 b' Upgrade request must be followed by hell'
1273 e> malformed handshake protocol: missing pairs 81\n
1273 e> malformed handshake protocol: missing pairs 81\n
1274 e> -\n
1274 e> -\n
1275
1275
1276 Legacy commands are not exposed to version 2 of protocol
1277
1278 $ hg --config experimental.sshpeer.advertise-v2=true debugwireproto --localssh << EOF
1279 > command branches
1280 > nodes 0000000000000000000000000000000000000000
1281 > EOF
1282 creating ssh peer from handshake results
1283 sending branches command
1284 response:
1285
1286 $ hg --config experimental.sshpeer.advertise-v2=true debugwireproto --localssh << EOF
1287 > command changegroup
1288 > roots 0000000000000000000000000000000000000000
1289 > EOF
1290 creating ssh peer from handshake results
1291 sending changegroup command
1292 response:
1293
1294 $ hg --config experimental.sshpeer.advertise-v2=true debugwireproto --localssh << EOF
1295 > command changegroupsubset
1296 > bases 0000000000000000000000000000000000000000
1297 > heads 0000000000000000000000000000000000000000
1298 > EOF
1299 creating ssh peer from handshake results
1300 sending changegroupsubset command
1301 response:
1302
1276 $ cd ..
1303 $ cd ..
1277
1304
1278 Test listkeys for listing namespaces
1305 Test listkeys for listing namespaces
General Comments 0
You need to be logged in to leave comments. Login now