##// END OF EJS Templates
sshpeer: initial definition and implementation of new SSH protocol...
sshpeer: initial definition and implementation of new SSH protocol The existing SSH protocol has several design flaws. Future commits will elaborate on these flaws as new features are introduced to combat these flaws. For now, hopefully you can take me for my word that a ground up rewrite of the SSH protocol is needed. This commit lays the foundation for a new SSH protocol by defining a mechanism to upgrade the SSH transport channel away from the default (version 1) protocol to something modern (which we'll call "version 2" for now). This upgrade process is detailed in the internals documentation for the wire protocol. The gist of it is the client sends a request line preceding the "hello" command/line which basically says "I'm requesting an upgrade: here's what I support." If the server recognizes that line, it processes the upgrade request and the transport channel is switched to use the new version of the protocol. If not, it sends an empty response, which is how all Mercurial SSH servers from the beginning of time reacted to unknown commands. The upgrade request is effectively ignored and the client continues to use the existing version of the protocol as if nothing happened. The new version of the SSH protocol is completely identical to version 1 aside from the upgrade dance and the bytes that follow. The immediate bytes that follow the protocol switch are defined to be a length framed "capabilities: " line containing the remote's advertised capabilities. In reality, this looks very similar to what the "hello" response would look like. But it will evolve quickly. The methodology by which the protocol will evolve is important. I'm not going to introduce the new protocol all at once. That would likely lead to endless bike shedding and forward progress would stall. Instead, I intend to tricle out new features and diversions from the existing protocol in small, incremental changes. To support the gradual evolution of the protocol, the on-the-wire advertised protocol name contains an "exp" to denote "experimental" and a 4 digit field to capture the sub-version of the protocol. Whenever we make a BC change to the wire protocol, we can increment this version and lock out all older clients because it will appear as a completely different protocol version. This means we can incur as many breaking changes as we want. We don't have to commit to supporting any one feature or idea for a long period of time. We can even evolve the handshake mechanism, because that is defined as being an implementation detail of the negotiated protocol version! Hopefully this lowers the barrier to accepting changes to the protocol and for experimenting with "radical" ideas during its development. In core, sshpeer received most of the attention. We haven't even implemented the server bits for the new protocol in core yet. Instead, we add very primitive support to our test server, mainly just to exercise the added code paths in sshpeer. Differential Revision: https://phab.mercurial-scm.org/D2061 # no-check-commit because of required foo_bar naming

File last commit:

r33571:e470f12d default
r35994:48a3a928 default
Show More
test-check-config.t
47 lines | 1.5 KiB | text/troff | Tads3Lexer
/ tests / test-check-config.t
Pierre-Yves David
tests: move the '-hg' postfix for all style tests...
r27368 #require test-repo
timeless
tests: silence test-repo obsolete warning...
r29219 $ . "$TESTDIR/helpers-testrepo.sh"
Gregory Szorc
tests: add test coverage for check-config...
r32846
Sanity check check-config.py
$ cat > testfile.py << EOF
> # Good
> foo = ui.config('ui', 'username')
> # Missing
> foo = ui.config('ui', 'doesnotexist')
> # Missing different type
> foo = ui.configint('ui', 'missingint')
> # Missing with default value
> foo = ui.configbool('ui', 'missingbool1', default=True)
> foo = ui.configbool('ui', 'missingbool2', False)
Gregory Szorc
check-config: syntax to allow inconsistent config values...
r33192 > # Inconsistent values for defaults.
> foo = ui.configint('ui', 'intdefault', default=1)
> foo = ui.configint('ui', 'intdefault', default=42)
> # Can suppress inconsistent value error
> foo = ui.configint('ui', 'intdefault2', default=1)
> # inconsistent config: ui.intdefault2
> foo = ui.configint('ui', 'intdefault2', default=42)
Gregory Szorc
tests: add test coverage for check-config...
r32846 > EOF
$ cat > files << EOF
> mercurial/help/config.txt
> $TESTTMP/testfile.py
> EOF
Pierre-Yves David
tests: move the '-hg' postfix for all style tests...
r27368 $ cd "$TESTDIR"/..
Augie Fackler
cleanup: use $PYTHON to run python in many more tests...
r32940 $ $PYTHON contrib/check-config.py < $TESTTMP/files
Gregory Szorc
check-config: syntax to allow inconsistent config values...
r33192 foo = ui.configint('ui', 'intdefault', default=42)
conflict on ui.intdefault: ('int', '42') != ('int', '1')
Matt Harbison
tests: remove (glob) annotations that were only for '\' matches...
r35394 at $TESTTMP/testfile.py:12:
Gregory Szorc
tests: add test coverage for check-config...
r32846 undocumented: ui.doesnotexist (str)
Gregory Szorc
check-config: syntax to allow inconsistent config values...
r33192 undocumented: ui.intdefault (int) [42]
undocumented: ui.intdefault2 (int) [42]
Gregory Szorc
tests: add test coverage for check-config...
r32846 undocumented: ui.missingbool1 (bool) [True]
undocumented: ui.missingbool2 (bool)
undocumented: ui.missingint (int)
Pierre-Yves David
tests: move the '-hg' postfix for all style tests...
r27368 New errors are not allowed. Warnings are strongly discouraged.
Yuya Nishihara
tests: alias syshg and syshgenv so they can be switched conditionally
r33199 $ testrepohg files "set:(**.py or **.txt) - tests/**" | sed 's|\\|/|g' |
Augie Fackler
cleanup: use $PYTHON to run python in many more tests...
r32940 > $PYTHON contrib/check-config.py