wireproto: disallow commands handlers for multiple transport versions
I think it will be more trouble than it is worth to code version 1
and version 2 command handlers to the same interface. It will feel
awkward to shoehorn functionality into e.g. the version 1 protocol
handler interface. This would likely constrain the ability for version
2 to evolve.
Previous commits introduced a clean separation between command handlers
for version 1 and version 2 transports. This commit reinforces that
separation by dropping support for having a single command handler
service both version 1 and version 2 transports.
Differential Revision: https://phab.mercurial-scm.org/D3208
$ hg init
$ touch a
$ unset HGUSER
$ echo "[ui]" >> .hg/hgrc
$ echo "username= foo" >> .hg/hgrc
$ echo " bar1" >> .hg/hgrc
$ hg ci -Am m
adding a
abort: username 'foo\nbar1' contains a newline
[255]
$ rm .hg/hgrc
$ HGUSER=`(echo foo; echo bar2)` hg ci -Am m
adding a
abort: username 'foo\nbar2' contains a newline
[255]
$ hg ci -Am m -u "`(echo foo; echo bar3)`"
adding a
transaction abort!
rollback completed
abort: username 'foo\nbar3' contains a newline!
[255]