Augie Fackler <augie@google.com> [Wed, 14 Feb 2018 21:12:48 -0500] rev 36224
formatting: enforce system headers before local headers
Differential Revision: https://phab.mercurial-scm.org/D2275
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 12 Feb 2018 17:20:20 -0800] rev 36223
wireprotoserver: add version to HTTP protocol name (API)
This matches what we did for the SSH protocol handler in
ac33dc94e1d5.
.. api::
HTTP protocol handlers now advertises its internal name as
``http-v1`` instead of ``http``.
Differential Revision: https://phab.mercurial-scm.org/D2219
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 12 Feb 2018 17:19:51 -0800] rev 36222
wireprotoserver: rename webproto to httpv1protocolhandler
This matches our naming convention for the SSH server's protocol
handler.
Differential Revision: https://phab.mercurial-scm.org/D2218
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 12 Feb 2018 17:16:52 -0800] rev 36221
wireproto: improve docstring for "hello"
Differential Revision: https://phab.mercurial-scm.org/D2217
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 12 Feb 2018 17:14:29 -0800] rev 36220
httppeer: remove httpspeer
All it did was verify at construction time that Mercurial supports
TLS. instance() is what's used to construct peer instances. So
we can just inline this check into that function and do away with
the type variant.
Differential Revision: https://phab.mercurial-scm.org/D2216
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 12 Feb 2018 17:10:58 -0800] rev 36219
httppeer: remove redundant code to fetch capabilities
_fetchcaps() is called by httppeer.instance(), which is the only
instantiator of httppeer. Since _fetchcaps() always sets self._caps
and since
197d10e157ce removed the fallback for cases where the
remote doesn't support capabilities, we can remove some dead
code from httppeer.capabilities().
Differential Revision: https://phab.mercurial-scm.org/D2215
Gregory Szorc <gregory.szorc@gmail.com> [Thu, 01 Feb 2018 19:32:42 -0800] rev 36218
httppeer: change logic around argument handling
The code to process arguments only makes sense if there are
arguments. So change an "else" to "elif args", remove an
"if" that isn't necessary, and add some docs for good measure.
Differential Revision: https://phab.mercurial-scm.org/D2214
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 12 Feb 2018 16:35:06 -0800] rev 36217
tests: test using both versions of SSH protocol
Now that the version 2 of the SSH protocol is usable in core, we
can start actively testing it more widely outside of low-level
protocol tests.
We add #testcases variants to a handful of tests so we exercise both
version 1 and version 2 of the SSH protocol when testing. This will
allow us to more easily find regressions and variances as protocol 2
is developed. It will also make it easier to continue testing with
protocol version 1 once version 2 is enabled by default.
There are a handful of tests using ssh:// that should also gain test
variances. One - test-push-race.t - already has a #testcases. This
would require combinatorial cases. I didn't want to go down that
rabbit hole, so that test is unchanged. Thinking aloud, there is
probably an opportunity to automatically run tests with multiple
server/protocol implementations. Ideally any test that performed
server interaction would run with all supported server implementations
and protocols so we could find variances between servers and protocols.
But this has been a long-standing issue with our test harness. I
don't think it is an easily solved problem. But it would be nice...
Differential Revision: https://phab.mercurial-scm.org/D2206
Gregory Szorc <gregory.szorc@gmail.com> [Thu, 08 Feb 2018 11:39:23 -0800] rev 36216
sshpeer: log remote capabilities after protocol upgrade
This helps reduce variance with version 1 and will help prevent
test output divergence as we start testing protocol version 2 more
widely.
Differential Revision: https://phab.mercurial-scm.org/D2205
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 12 Feb 2018 16:33:54 -0800] rev 36215
wireprotoserver: handle SSH protocol version 2 upgrade requests
This commit teaches the SSH server to recognize the "upgrade"
request line that clients send when they wish to switch the
channel to version 2 of the SSH protocol.
Servers don't honor upgrade requests unless an experimental config
option is set.
Since the built-in server now supports upgrade requests, our test
server to test the handshake has been deleted. Existing tests
use the built-in server and their output doesn't change.
The upgrade is handled in our state machine. The end result is a bit
wonky, as the server transitions back to version 1 state immediately
after upgrading. But this will change as soon as version 2 has an
actual protocol that differs from version 1.
Tests demonstrating that the new server is a bit more strict about
the upgrade handshake have been added.
Differential Revision: https://phab.mercurial-scm.org/D2204
Gregory Szorc <gregory.szorc@gmail.com> [Thu, 08 Feb 2018 15:09:59 -0800] rev 36214
wireprotoserver: move SSH server operation to a standalone function
The server-side processing logic will soon get a bit more complicated
in order to handle protocol switches. We will use a state machine
to help make the transitions clearer.
To prepare for this, we move SSH server operation into a standalone
function. We structure it as a very simple state machine. It only
has two states for now, with one state containing the bulk of the
logic. But things will evolve shortly.
Differential Revision: https://phab.mercurial-scm.org/D2203
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 14 Feb 2018 17:35:13 -0700] rev 36213
py3: stringify integer with %d instead of bytes()
The unbundle wire protocol command now returns a properly formatted
reply in Python 3.
Differential Revision: https://phab.mercurial-scm.org/D2274
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 14 Feb 2018 17:23:26 -0700] rev 36212
py3: add b'' to test-sshserver.py
# skip-blame because adding b'' prefixes
Differential Revision: https://phab.mercurial-scm.org/D2273
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 14 Feb 2018 17:21:42 -0700] rev 36211
py3: add b'' to config options in test extension
# skip-blame because just b'' prefixes
Differential Revision: https://phab.mercurial-scm.org/D2272
Martin von Zweigbergk <martinvonz@google.com> [Tue, 13 Feb 2018 14:15:29 -0800] rev 36210
manifest: add support for including directories outside narrowspec
When using tree manifests and the client doesn't have a directory, we
have two choices for what to do with "hg manifest" output: 1) ignore
the directory, and 2) include the directory (not files within it). For
"hg files", we decided to ignore the directories (and files) outside
the narrowspec.
If we choose to not include directories outside the narrowspec, then I
think we should also make sure we don't include files outside the
narrowspec. I also think we should add --outside-narrow flag (or other
name). Thus, whichever way we go, I think we should have a way of
displaying paths (files or directories) outside the narrowspec. For
that we'll need to handle the 't' flag that narrowhg uses, and that's
what this patch adds support for.
Differential Revision: https://phab.mercurial-scm.org/D2235
Martin von Zweigbergk <martinvonz@google.com> [Tue, 13 Feb 2018 13:50:24 -0800] rev 36209
narrow: restrict manifest iteration by using manifest.walk(matcher)
This is only for root nodes, so it shouldn't really matter (they're
rarely huge), but seems cleaner.
Differential Revision: https://phab.mercurial-scm.org/D2234
Martin von Zweigbergk <martinvonz@google.com> [Tue, 13 Feb 2018 13:16:06 -0800] rev 36208
narrow: only diff manifest part within narrowspec when generating changegroup
Since
959ebff3505a (manifest: add match argument to diff and
filesnotin, 2017-03-07), we have a more efficient way of diffing
manifests while applying a matcher. Let's use that while generating
narrowed changegroups, so we avoid diffing parts of the manifest that
don't match the narrowspec.
Differential Revision: https://phab.mercurial-scm.org/D2233
Yuya Nishihara <yuya@tcha.org> [Sat, 06 Jan 2018 17:44:57 +0900] rev 36207
cmdutil: build "%m" (desc|firstline) in makefilename()
Yuya Nishihara <yuya@tcha.org> [Thu, 02 Apr 2015 23:37:07 +0900] rev 36206
cmdutil: rewrite makefilename() to use ctx methods
Yuya Nishihara <yuya@tcha.org> [Thu, 02 Apr 2015 23:28:16 +0900] rev 36205
cmdutil: pass ctx to makefileobj() in place of repo/node pair (API)
Yuya Nishihara <yuya@tcha.org> [Thu, 02 Apr 2015 23:32:28 +0900] rev 36204
cmdutil: pass ctx to makefilename() in place of repo/node pair (API)
Yuya Nishihara <yuya@tcha.org> [Thu, 02 Apr 2015 23:22:02 +0900] rev 36203
cmdutil: make node parameter of makefileobj() mandatory (API)
(repo, node) pair will be replaced with ctx, so makefilename() can be easily
ported to templater.
Yuya Nishihara <yuya@tcha.org> [Wed, 14 Feb 2018 21:36:15 +0900] rev 36202
progress: use '%*d' to pad progress value
Follows up
7f5108e58083. The problem of '% Nd' is that ' ' means we want
{' ' or '-'} as a sign character. We should instead write '%Nd' to pad up
to N characters with space, and N can be '*'.
Yuya Nishihara <yuya@tcha.org> [Wed, 14 Feb 2018 21:29:27 +0900] rev 36201
py3: stringify IOError/OSError without loosing local character
Follows up
fa4d333cac58. An environment error may contain non-ascii characters
on Windows, which should be encoded to a platform-native string.
Yuya Nishihara <yuya@tcha.org> [Fri, 26 Jan 2018 19:48:39 +0900] rev 36200
dirstate: drop explicit files that shouldn't match (BC) (
issue4679)
Before, wctx.walk() could include files excluded by -X pattern, which
disagrees with wctx.matches() and ctx.walk()/matches() behavior. This patch
fixes the problem by testing stat results against the matcher if the matcher
may contain false paths.
I have no idea if the fix should be made before the workaround for case-
insensitive filesystems, but that shouldn't matter since match.anypats()
means 'not match.isexact()'.
This patch also makes narrow and sparse extensions to not exclude explicit
paths on walk() because they appear to depend on the buggy behavior.
More detailed analysis about this issue by Martin von Zweigbergk:
"I think it's just an unintended consequence of how the dirstate walk works,
but I'm not sure. The exception for explicit files also bothered me when I
was working on the matcher code a year or so ago. I actually added the
exception to the matcher code because I thought it was always working like
that (not just for dirstate) in
a83a7d27911e (match: handle excludes using
new differencematcher, 2017-05-16). It was only recently that Yuya realized
that it used to be inconsistent and that I probably made it consistently bad
because I didn't realize it was inconsistent to start with, see
821d8a5ab4ff
(match: do not weirdly include explicit files excluded by -X option,
2018-01-16)."
.. bc::
Working-directory commands now respect ``-X PATTERN`` no matter if PATTERN
matches explicitly-specified FILEs. For example, ``hg add foo -X foo`` no
longer add the file ``foo``.
Yuya Nishihara <yuya@tcha.org> [Sun, 21 Jan 2018 17:04:42 +0900] rev 36199
log: add TODO comments about --line-range processing
Yuya Nishihara <yuya@tcha.org> [Sun, 21 Jan 2018 16:15:20 +0900] rev 36198
log: factor out function to feed revisions to displayer
Yuya Nishihara <yuya@tcha.org> [Sun, 21 Jan 2018 16:04:59 +0900] rev 36197
graphlog: unblock --line-range option
It should work now.
Yuya Nishihara <yuya@tcha.org> [Sun, 21 Jan 2018 16:03:14 +0900] rev 36196
graphlog: deduplicate preprocessing of log command
Anton Shestakov <av6@dwimlabs.net> [Wed, 14 Feb 2018 20:32:32 +0800] rev 36195
hgweb: show users recorded in obsolescence markers
It's useful to see who obsoleted a commit, because it's not always done by its
author (hg-committed is a good example, because people rebase stacks of commits
made by various people).
Usernames are obfuscated, but look correct (e.g. "test" is
"test").
Denis Laxalde <denis.laxalde@logilab.fr> [Wed, 14 Feb 2018 14:12:05 +0100] rev 36194
revert: use an exact matcher in interactive diff selection (
issue5789)
When going through _performrevert() in the interactive case, we build a
matcher with files to revert and pass it patch.diff() for later
selection of diff hunks to revert. The files set used to build the
matcher comes from dirstate and accounts for patterns explicitly passed
to revert ('hg revert -i <file>') and, in case of nonexistent pattern,
this set is empty (which is expected). Unfortunately, the matcher built
from scmutil.match(ctx, []) is wrong as it leads patch.diff() to rebuild
a 'changes' tuple with dirstate information, ignoring user-specified
pattern. This leads to the situation described in
issue5789, where
one gets prompted about reverting files unrelated to specified patterns
because they made a typo or so.
We fix this by building an exact matcher with the correct set of file
paths (built earlier). Thanks to Yuya Nishihara for suggesting the
correct fix.
Denis Laxalde <denis@laxalde.org> [Sun, 11 Feb 2018 20:37:44 +0100] rev 36193
tests: add a test demonstrate that 'revert -i' ignores nonexistent patterns
As described in
issue5789, when revert is called through:
hg revert -i <some file that does not exist>
we'd expect the command to abort early. Currently, it just warns about
missing file but prompt about files unrelated to user arguments.