Mercurial > public > mercurial-scm > hg
comparison mercurial/wireproto.py @ 36615:ed7705017749
wireproto: only expose "between" to version 1 of wire protocols
We recently marked other legacy commands as only available to version 1
of the wire protocols. We held off marking "between" because it is
used as part of the SSH handshake.
Since SSH servers assume they are version 1 by default and the
"between" request that is issued as part of the version 2 handshake
is swallowed and not operated on, everything should "just work" if
"between" is not available to version 2.
Differential Revision: https://phab.mercurial-scm.org/D2513
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Tue, 27 Feb 2018 16:31:44 -0800 |
parents | 6e585bca962e |
children | 390d16ea7c76 |
comparison
equal
deleted
inserted
replaced
36614:1fa02265fae2 | 36615:ed7705017749 |
---|---|
738 result = result.data | 738 result = result.data |
739 res.append(escapearg(result)) | 739 res.append(escapearg(result)) |
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 | 743 @wireprotocommand('between', 'pairs', transportpolicy=POLICY_V1_ONLY) |
744 # SSH handshake mechanism is figured out. | |
745 @wireprotocommand('between', 'pairs') | |
746 def between(repo, proto, pairs): | 744 def between(repo, proto, pairs): |
747 pairs = [decodelist(p, '-') for p in pairs.split(" ")] | 745 pairs = [decodelist(p, '-') for p in pairs.split(" ")] |
748 r = [] | 746 r = [] |
749 for b in repo.between(pairs): | 747 for b in repo.between(pairs): |
750 r.append(encodelist(b) + "\n") | 748 r.append(encodelist(b) + "\n") |