##// 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:

r34405:159a6f7e default
r35994:48a3a928 default
Show More
test-releasenotes-formatting.t
459 lines | 8.2 KiB | text/troff | Tads3Lexer
/ tests / test-releasenotes-formatting.t
#require fuzzywuzzy
$ cat >> $HGRCPATH << EOF
> [extensions]
> releasenotes=
> EOF
$ hg init simple-repo
$ cd simple-repo
A fix with a single line results in a bullet point in the appropriate section
$ touch fix1
$ hg -q commit -A -l - << EOF
> single line fix
>
> .. fix::
>
> Simple fix with a single line content entry.
> EOF
$ hg releasenotes -r . $TESTTMP/relnotes-single-line
$ cat $TESTTMP/relnotes-single-line
Bug Fixes
=========
* Simple fix with a single line content entry.
A fix with multiple lines is handled correctly
$ touch fix2
$ hg -q commit -A -l - << EOF
> multi line fix
>
> .. fix::
>
> First line of fix entry.
> A line after it without a space.
>
> A new paragraph in the fix entry. And this is a really long line. It goes on for a while.
> And it wraps around to a new paragraph.
> EOF
$ hg releasenotes -r . $TESTTMP/relnotes-multi-line
$ cat $TESTTMP/relnotes-multi-line
Bug Fixes
=========
* First line of fix entry. A line after it without a space.
A new paragraph in the fix entry. And this is a really long line. It goes on
for a while. And it wraps around to a new paragraph.
A release note with a title results in a sub-section being written
$ touch fix3
$ hg -q commit -A -l - << EOF
> fix with title
>
> .. fix:: Fix Title
>
> First line of fix with title.
>
> Another paragraph of fix with title. But this is a paragraph
> with multiple lines.
> EOF
$ hg releasenotes -r . $TESTTMP/relnotes-fix-with-title
$ cat $TESTTMP/relnotes-fix-with-title
Bug Fixes
=========
Fix Title
---------
First line of fix with title.
Another paragraph of fix with title. But this is a paragraph with multiple
lines.
$ cd ..
Formatting of multiple bullet points works
$ hg init multiple-bullets
$ cd multiple-bullets
$ touch fix1
$ hg -q commit -A -l - << EOF
> commit 1
>
> .. fix::
>
> first fix
> EOF
$ touch fix2
$ hg -q commit -A -l - << EOF
> commit 2
>
> .. fix::
>
> second fix
>
> Second paragraph of second fix.
> EOF
$ touch fix3
$ hg -q commit -A -l - << EOF
> commit 3
>
> .. fix::
>
> third fix
> EOF
$ hg releasenotes -r 'all()' $TESTTMP/relnotes-multiple-bullets
$ cat $TESTTMP/relnotes-multiple-bullets
Bug Fixes
=========
* first fix
* second fix
Second paragraph of second fix.
* third fix
$ cd ..
Formatting of multiple sections works
$ hg init multiple-sections
$ cd multiple-sections
$ touch fix1
$ hg -q commit -A -l - << EOF
> commit 1
>
> .. fix::
>
> first fix
> EOF
$ touch feature1
$ hg -q commit -A -l - << EOF
> commit 2
>
> .. feature::
>
> description of the new feature
> EOF
$ touch fix2
$ hg -q commit -A -l - << EOF
> commit 3
>
> .. fix::
>
> second fix
> EOF
$ hg releasenotes -r 'all()' $TESTTMP/relnotes-multiple-sections
$ cat $TESTTMP/relnotes-multiple-sections
New Features
============
* description of the new feature
Bug Fixes
=========
* first fix
* second fix
$ cd ..
Section with subsections and bullets
$ hg init multiple-subsections
$ cd multiple-subsections
$ touch fix1
$ hg -q commit -A -l - << EOF
> commit 1
>
> .. fix:: Title of First Fix
>
> First paragraph of first fix.
>
> Second paragraph of first fix.
> EOF
$ touch fix2
$ hg -q commit -A -l - << EOF
> commit 2
>
> .. fix:: Title of Second Fix
>
> First paragraph of second fix.
>
> Second paragraph of second fix.
> EOF
$ hg releasenotes -r 'all()' $TESTTMP/relnotes-multiple-subsections
$ cat $TESTTMP/relnotes-multiple-subsections
Bug Fixes
=========
Title of First Fix
------------------
First paragraph of first fix.
Second paragraph of first fix.
Title of Second Fix
-------------------
First paragraph of second fix.
Second paragraph of second fix.
Now add bullet points to sections having sub-sections
$ touch fix3
$ hg -q commit -A -l - << EOF
> commit 3
>
> .. fix::
>
> Short summary of fix 3
> EOF
$ hg releasenotes -r 'all()' $TESTTMP/relnotes-multiple-subsections-with-bullets
$ cat $TESTTMP/relnotes-multiple-subsections-with-bullets
Bug Fixes
=========
Title of First Fix
------------------
First paragraph of first fix.
Second paragraph of first fix.
Title of Second Fix
-------------------
First paragraph of second fix.
Second paragraph of second fix.
Other Changes
-------------
* Short summary of fix 3
$ cd ..
Multiple 'Other Changes' sub-sections for every section
$ hg init multiple-otherchanges
$ cd multiple-otherchanges
$ touch fix1
$ hg -q commit -A -l - << EOF
> commit 1
>
> .. fix:: Title of First Fix
>
> First paragraph of fix 1.
> EOF
$ touch feature1
$ hg -q commit -A -l - << EOF
> commit 2
>
> .. feature:: Title of First Feature
>
> First paragraph of feature 1.
> EOF
$ touch feature2
$ hg -q commit -A -l - << EOF
> commit 3
>
> .. feature::
>
> Short summary of feature 2.
> EOF
$ touch fix2
$ hg -q commit -A -l - << EOF
> commit 4
>
> .. fix::
>
> Short summary of fix 2
> EOF
$ hg releasenotes -r 'all()' $TESTTMP/relnotes-multiple-otherchanges
$ cat $TESTTMP/relnotes-multiple-otherchanges
New Features
============
Title of First Feature
----------------------
First paragraph of feature 1.
Other Changes
-------------
* Short summary of feature 2.
Bug Fixes
=========
Title of First Fix
------------------
First paragraph of fix 1.
Other Changes
-------------
* Short summary of fix 2
$ cd ..
Using custom sections in notes
$ hg init custom-section
$ cd custom-section
$ cat >> .hgreleasenotes << EOF
> [sections]
> testsection=Name of Section
> EOF
$ touch a
$ hg -q commit -A -l - << EOF
> commit 1
>
> .. testsection::
>
> First paragraph under this admonition.
> EOF
$ hg releasenotes -r . $TESTTMP/relnotes-custom-section
$ cat $TESTTMP/relnotes-custom-section
Name of Section
===============
* First paragraph under this admonition.
Overriding default sections (For eg. by default feature = New Features)
$ cat >> .hgreleasenotes << EOF
> [sections]
> feature=Feature Additions
> EOF
$ touch b
$ hg -q commit -A -l - << EOF
> commit 2
>
> .. feature::
>
> Adds a new feature.
> EOF
$ hg releasenotes -r . $TESTTMP/relnotes-override-section
$ cat $TESTTMP/relnotes-override-section
Feature Additions
=================
* Adds a new feature.
$ cd ..
Testing output for the --check (-c) flag
$ hg init check-flag
$ cd check-flag
$ touch a
$ hg -q commit -A -l - << EOF
> .. asf::
>
> First paragraph under this admonition.
> EOF
Suggest similar admonition in place of the invalid one.
$ hg releasenotes -r . -c
Invalid admonition 'asf' present in changeset 4026fe9e1c20
$ touch b
$ hg -q commit -A -l - << EOF
> .. fixes::
>
> First paragraph under this admonition.
> EOF
$ hg releasenotes -r . -c
Invalid admonition 'fixes' present in changeset 0e7130d2705c
(did you mean fix?)
$ cd ..
Usage of --list flag
$ hg init relnotes-list
$ cd relnotes-list
$ hg releasenotes -l
feature: New Features
bc: Backwards Compatibility Changes
fix: Bug Fixes
perf: Performance Improvements
api: API Changes
$ cd ..
Raise error on simultaneous usage of flags
$ hg init relnotes-raise-error
$ cd relnotes-raise-error
$ hg releasenotes -r . -l
abort: cannot use both '--list' and '--rev'
[255]
$ hg releasenotes -l -c
abort: cannot use both '--list' and '--check'
[255]
Display release notes for specified revs if no file is mentioned
$ hg init relnotes-nofile
$ cd relnotes-nofile
$ touch fix1
$ hg -q commit -A -l - << EOF
> commit 1
>
> .. fix:: Title of First Fix
>
> First paragraph of fix 1.
> EOF
$ hg releasenote -r .
Bug Fixes
=========
Title of First Fix
------------------
First paragraph of fix 1.