comparison tests/test-ssh-proto.t @ 36611:6906547c8476

wireproto: don't expose legacy commands to version 2 of wire protocol Now that we have the ability to control which transports a wire protocol command is exposed on, let's put it to use. We flag the "branches," "changegroup," and "changegroupsubset" commands as only available on version 1. "branches" was used by the legacy discovery mechanism and was replaced by the "known" and "heads" commands. "changegroup" and "changegroupsubset" were replaced by "getbundle." "between" is also legacy. However, since it is used by the SSH handshake protocol, marking it as legacy is a bit more complicated and will be done in a later commit. Another nuanced issue with this change is that the server-advertised capabilities still list "changegroupsubset" despite the command not being available. This will be addressed in a subsequent commit. Differential Revision: https://phab.mercurial-scm.org/D2485
author Gregory Szorc <gregory.szorc@gmail.com>
date Tue, 27 Feb 2018 15:06:10 -0800
parents 1138e5c0fbc9
children e89959970a08
comparison
equal deleted inserted replaced
36610:af0d38f015bb 36611:6906547c8476
1271 o> \n 1271 o> \n
1272 e> read(-1) -> 49: 1272 e> read(-1) -> 49:
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
1279 1306
1280 $ hg init empty 1307 $ hg init empty