Augie Fackler <augie@google.com> [Sun, 18 Feb 2018 14:53:31 -0500] rev 36348
largefiles: give some **opts some strkwargs love
Differential Revision: https://phab.mercurial-scm.org/D2343
Augie Fackler <augie@google.com> [Sun, 18 Feb 2018 14:43:55 -0500] rev 36347
wireproto: fix lingering str(exception) with util.forcebytestr(exception)
Differential Revision: https://phab.mercurial-scm.org/D2342
Augie Fackler <augie@google.com> [Sun, 18 Feb 2018 14:37:36 -0500] rev 36346
scmutil: fix requires-file isalnum() check on first byte
Slice instead of subscript to get a bytes from a bytes.
# skip-blame just a py3 slice-instead-of-subscript change
Differential Revision: https://phab.mercurial-scm.org/D2341
Augie Fackler <augie@google.com> [Sun, 18 Feb 2018 14:29:04 -0500] rev 36345
largefiles: mark headre as bytes regex
Differential Revision: https://phab.mercurial-scm.org/D2340
Augie Fackler <augie@google.com> [Sun, 18 Feb 2018 14:28:31 -0500] rev 36344
largfiles: replace filter() with listcomp when result needs to be a list
filter() is a generator on Python 3, but these cases are used as lists.
Differential Revision: https://phab.mercurial-scm.org/D2339
Augie Fackler <augie@google.com> [Sun, 18 Feb 2018 14:25:03 -0500] rev 36343
largefiles: make scheme regex a bytes regex
# skip-blame just a b prefix
Differential Revision: https://phab.mercurial-scm.org/D2338
Yuya Nishihara <yuya@tcha.org> [Sat, 17 Feb 2018 13:13:04 +0900] rev 36342
debuginstall: do not parse editor command in posix way on Windows
An editor command is executed by a system shell, which is cmd.exe on Windows.
Yuya Nishihara <yuya@tcha.org> [Sun, 18 Feb 2018 22:13:25 +0900] rev 36341
py3: use bytes() to byte-stringify url object in url.py
Perhaps we'll have to convert it back and forth from/to bytes and unicode
at urllib boundary, but at least util.hidepassword() wants a byte string.
Yuya Nishihara <yuya@tcha.org> [Sun, 18 Feb 2018 22:12:11 +0900] rev 36340
url: show full url of proxy server in debug message
This only fixes the debug message spotted by issue5796.
Pulkit Goyal <7895pulkit@gmail.com> [Mon, 19 Feb 2018 00:31:01 +0530] rev 36339
py3: make sure we are doing integer division by using '//'
Differential Revision: https://phab.mercurial-scm.org/D2337
Pulkit Goyal <7895pulkit@gmail.com> [Mon, 19 Feb 2018 00:15:50 +0530] rev 36338
py3: make sure regex is bytes in crecord.py
# skip-blame because we are just adding b''
Differential Revision: https://phab.mercurial-scm.org/D2336
Pulkit Goyal <7895pulkit@gmail.com> [Mon, 19 Feb 2018 00:14:33 +0530] rev 36337
py3: use "%d" for integers instead of "%s"
Differential Revision: https://phab.mercurial-scm.org/D2335
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 18 Feb 2018 18:22:40 +0530] rev 36336
py3: make sure we open the files in bytes mode
Differential Revision: https://phab.mercurial-scm.org/D2333
Augie Fackler <augie@google.com> [Sun, 18 Feb 2018 00:59:03 -0500] rev 36335
py3: whitelist another three passing tests
Differential Revision: https://phab.mercurial-scm.org/D2318
Augie Fackler <augie@google.com> [Sun, 18 Feb 2018 00:49:29 -0500] rev 36334
manifest: use list(dict) instead of dict.keys() to get a list of keys
Differential Revision: https://phab.mercurial-scm.org/D2317
Augie Fackler <augie@google.com> [Sun, 18 Feb 2018 00:49:11 -0500] rev 36333
manifest: correct the one use of iterkeys() on a dict
As far as I can tell, this is the only iterkeys() in this file that
was actually on a dict. The rest are on custom manifest types.
Differential Revision: https://phab.mercurial-scm.org/D2316
Augie Fackler <augie@google.com> [Sun, 18 Feb 2018 00:43:50 -0500] rev 36332
py3: use default dict iterator instead of iterkeys
These are the easy cases. Some cases in manifest.py will require more
careful inspection.
Differential Revision: https://phab.mercurial-scm.org/D2315
Augie Fackler <augie@google.com> [Sun, 18 Feb 2018 00:35:37 -0500] rev 36331
py3: whitelist five more passing tests
Differential Revision: https://phab.mercurial-scm.org/D2314
Augie Fackler <augie@google.com> [Sun, 18 Feb 2018 00:03:39 -0500] rev 36330
httppeer: headers are native strings
# skip-blame just marking some native strings
Differential Revision: https://phab.mercurial-scm.org/D2313
Augie Fackler <augie@google.com> [Sun, 18 Feb 2018 00:03:27 -0500] rev 36329
hgweb: header dict entries are native strings
# skip-blame just marking some native strings
Differential Revision: https://phab.mercurial-scm.org/D2312
Augie Fackler <augie@google.com> [Sun, 18 Feb 2018 00:03:05 -0500] rev 36328
keepalive: headers are native strings, mark them as such
# skip-blame just marking some native strings
Differential Revision: https://phab.mercurial-scm.org/D2311
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 18 Feb 2018 18:22:15 +0530] rev 36327
py3: use range instead of xrange on py3 in tests/test-ui-verbosity.py
xrange is not present on Python 3.
Differential Revision: https://phab.mercurial-scm.org/D2332
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 18 Feb 2018 18:20:57 +0530] rev 36326
py3: use range instead of xrange in tests/test-revset2.t
xrange is not present on Python 3.
Differential Revision: https://phab.mercurial-scm.org/D2331
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 18 Feb 2018 18:20:21 +0530] rev 36325
py3: use range instead of xrange in tests/test-mq-qimport.t
xrange is not present on Python 3.
Differential Revision: https://phab.mercurial-scm.org/D2330
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 18 Feb 2018 18:19:10 +0530] rev 36324
py3: use range instead of xrange in tests/test-issue4074.t
xrange in not present on Python 3.
Differential Revision: https://phab.mercurial-scm.org/D2329
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 18 Feb 2018 18:18:24 +0530] rev 36323
py3: use range instead of xrange in tests/test-convert-mtn.t
xrange in not present on Python 3.
This change will make the test a bit slower on Python 2.
Differential Revision: https://phab.mercurial-scm.org/D2328
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 18 Feb 2018 18:28:45 +0530] rev 36322
py3: use range instead of xrange in tests/test-commandserver.t
xrange is not present on Python 3.
Differential Revision: https://phab.mercurial-scm.org/D2327
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 18 Feb 2018 18:07:12 +0530] rev 36321
py3: use range instead of xrange in tests/test-walk.t
xrange in not present in python 3.
Differential Revision: https://phab.mercurial-scm.org/D2326
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 18 Feb 2018 17:43:12 +0530] rev 36320
py3: use range instead of xrange in tests/test-mq-missingfiles.t
xrange is not present in python 3.
Differential Revision: https://phab.mercurial-scm.org/D2325
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 18 Feb 2018 17:42:33 +0530] rev 36319
py3: use range instead of xrange on py3 in tests/test-filecache.py
xrange is not present on py3.
Differential Revision: https://phab.mercurial-scm.org/D2324
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 18 Feb 2018 17:41:56 +0530] rev 36318
py3: use range instead on xrange on py3 in tests/test-atomictempfile.py
xrange is not available on Python 3.
Differential Revision: https://phab.mercurial-scm.org/D2323
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 18 Feb 2018 17:37:47 +0530] rev 36317
py3: add b'' prefix in test-mq-qrefresh-replace-log-message.t
# ski-blame as we just added b''
Differential Revision: https://phab.mercurial-scm.org/D2322
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 18 Feb 2018 17:36:52 +0530] rev 36316
py3: add b'' prefixes in test-mq-eol.t
# skip-blame because we are just adding b''
Differential Revision: https://phab.mercurial-scm.org/D2321
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 18 Feb 2018 17:35:44 +0530] rev 36315
py3: explicitly convert result of dict.items() into list
Differential Revision: https://phab.mercurial-scm.org/D2320
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 18 Feb 2018 17:35:13 +0530] rev 36314
py3: use pycompat.byteskwargs() to convert opts keys to bytes
Differential Revision: https://phab.mercurial-scm.org/D2319
Augie Fackler <augie@google.com> [Sun, 18 Feb 2018 00:02:33 -0500] rev 36313
wireprotoserver: py3 helpfully calls adds HTTP_ to CONTENT_LENGTH
Just handle both with a membership check, preferring the HTTP_
namespaced version. Sigh.
Differential Revision: https://phab.mercurial-scm.org/D2310
Augie Fackler <augie@google.com> [Sun, 18 Feb 2018 00:01:43 -0500] rev 36312
tests: port inline Python in test-http-branchmap.t to Python 3
Differential Revision: https://phab.mercurial-scm.org/D2309
Augie Fackler <augie@google.com> [Sat, 17 Feb 2018 22:52:24 -0500] rev 36311
hgweb_mod: partially undo 8afc25e7effc to fix py3
We now bytes-ify the entire request, so this is wrong.
Differential Revision: https://phab.mercurial-scm.org/D2308
Augie Fackler <augie@google.com> [Sat, 17 Feb 2018 22:39:38 -0500] rev 36310
tags: don't feed both int and None to min()
They're not comparable on Python 3, and we can just map None to 0.
Differential Revision: https://phab.mercurial-scm.org/D2307
Augie Fackler <augie@google.com> [Sat, 17 Feb 2018 22:39:12 -0500] rev 36309
tests: fix get-with-headers.py on python3 when writing to stdout
Differential Revision: https://phab.mercurial-scm.org/D2306
Augie Fackler <augie@google.com> [Sat, 17 Feb 2018 22:38:53 -0500] rev 36308
webcommands: use pycompat.strkwargs as needed
Differential Revision: https://phab.mercurial-scm.org/D2305
Augie Fackler <augie@google.com> [Sat, 17 Feb 2018 22:38:25 -0500] rev 36307
webcommands: unpack contents of length-1 dict portably
((k,v),) = dict.items() was suggested by some friends, but I feel like
that's maybe too clever?
Differential Revision: https://phab.mercurial-scm.org/D2304
Augie Fackler <augie@google.com> [Sat, 17 Feb 2018 22:37:35 -0500] rev 36306
bundle2: use pycompat.strkwargs as needed
Differential Revision: https://phab.mercurial-scm.org/D2303
Augie Fackler <augie@google.com> [Sat, 17 Feb 2018 21:47:49 -0500] rev 36305
tests: add b prefixes to test-rebase-dest.t
# skip-blame just b prefixes
Differential Revision: https://phab.mercurial-scm.org/D2302
Augie Fackler <augie@google.com> [Sat, 17 Feb 2018 21:47:26 -0500] rev 36304
rebase: sort roots by revision
Previously we were sorting them by whatever implicit sort order we got
between changectx instances. Sorting by rev at least makes some sense,
so I chose that.
Differential Revision: https://phab.mercurial-scm.org/D2301
Augie Fackler <augie@google.com> [Sat, 17 Feb 2018 21:25:14 -0500] rev 36303
httppeer: use %d to format int
Differential Revision: https://phab.mercurial-scm.org/D2300
Yuya Nishihara <yuya@tcha.org> [Sat, 17 Feb 2018 17:24:29 +0900] rev 36302
extensions: reject any unicode strings in tables before loading
This allows us to test hg on Python 3 without disabling third-party
extensions which could pollute cmdtable for example.
Yuya Nishihara <yuya@tcha.org> [Sat, 17 Feb 2018 18:20:15 +0900] rev 36301
py3: make test-extdiff.t pass on Python 3
Yuya Nishihara <yuya@tcha.org> [Sat, 17 Feb 2018 18:15:37 +0900] rev 36300
py3: make regexp patterns bytes in extdiff
Yuya Nishihara <yuya@tcha.org> [Sat, 17 Feb 2018 18:14:51 +0900] rev 36299
py3: fix bytes-unicode dance while building docstring of extdiff
Yuya Nishihara <yuya@tcha.org> [Sat, 17 Feb 2018 18:09:56 +0900] rev 36298
py3: factor out byterepr() which returns an asciified value on py3
Pulkit Goyal <7895pulkit@gmail.com> [Thu, 15 Feb 2018 17:14:45 +0530] rev 36297
remotenames: don't use the default value of logfmt for namespaces
logfmt is the format which is used to format the log output for that namespace.
This patch passes "remote {bookmark|branch}: %s" as the logfmt. Space is not
added after bookmark and branch to make output consistent with other details.
Still this is not the best output. We may need to wrap getlogcolumns() to change
spacing in the in built columns to match the remotenames one.
lognames are also deleted as they are superseded by logfmt.
Differential Revision: https://phab.mercurial-scm.org/D2277
Augie Fackler <augie@google.com> [Sat, 17 Feb 2018 01:41:08 -0500] rev 36296
py3: whitelist test-pull-http.t
There's a lot of work left to do on network-related stuff, but I at
least got one more test passing.
Differential Revision: https://phab.mercurial-scm.org/D2296
Augie Fackler <augie@google.com> [Sat, 17 Feb 2018 00:29:23 -0500] rev 36295
scmutil: bytes-ify IOErrors before wrapping them in abort message
Differential Revision: https://phab.mercurial-scm.org/D2292
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 17 Feb 2018 13:55:12 -0700] rev 36294
py3: port f to Python 3
This involved a lot of b'' literals, conversion from %s to %d, and
using a hashing mechanism that returns bytes instead of str.
Differential Revision: https://phab.mercurial-scm.org/D2299
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 11 Feb 2018 17:17:56 +0530] rev 36293
py3: replace file() with open() in test-convert-git.t
file() is not present in Python 3.
It also makes sure we write bytes on Python 3.
Differential Revision: https://phab.mercurial-scm.org/D2133
Sushil khanchi <sushilkhanchi97@gmail.com> [Thu, 15 Feb 2018 12:45:46 +0530] rev 36292
bundle: updates the help text for hg bundle (issue5744)
Differential Revision: https://phab.mercurial-scm.org/D2278
Augie Fackler <augie@google.com> [Sat, 17 Feb 2018 01:11:48 -0500] rev 36291
py3: get bytes-repr of network errors portably
This resolves a lot of weird issues in Python 3 around error strings.
Differential Revision: https://phab.mercurial-scm.org/D2295
Augie Fackler <augie@google.com> [Sat, 17 Feb 2018 01:09:56 -0500] rev 36290
hgweb: open server logs in binary mode
This is consistent with when we're logging to stdout, so we don't have
to do something annoyingly complicated in the logging infrastructure.
Differential Revision: https://phab.mercurial-scm.org/D2294
Augie Fackler <augie@google.com> [Sat, 17 Feb 2018 00:29:46 -0500] rev 36289
tests: add some b prefixes in test-http-bundle1.t
# skip-blame just some b prefixes
Differential Revision: https://phab.mercurial-scm.org/D2293
Augie Fackler <augie@google.com> [Sat, 17 Feb 2018 00:28:55 -0500] rev 36288
hgweb: correctly bytes-ify status, not string-ify
Differential Revision: https://phab.mercurial-scm.org/D2291
Augie Fackler <augie@google.com> [Sat, 17 Feb 2018 00:28:24 -0500] rev 36287
printenv: port to python3
Differential Revision: https://phab.mercurial-scm.org/D2290
Augie Fackler <augie@google.com> [Thu, 15 Feb 2018 09:18:20 -0500] rev 36286
py3: whitelist another eight passing tests
Differential Revision: https://phab.mercurial-scm.org/D2281
Augie Fackler <augie@google.com> [Wed, 14 Feb 2018 23:23:57 -0500] rev 36285
remotenames: port partway to python3 by using collections.MutableMapping
test-logexchange.t doesn't pass after this, but at least the
remotenames extension can be imported.
Differential Revision: https://phab.mercurial-scm.org/D2280
Martin von Zweigbergk <martinvonz@google.com> [Fri, 16 Feb 2018 11:33:56 -0800] rev 36284
tests: avoid referring to pvec in demandimport test
Nothing else currently uses pvec, so we may want to delete it (but
Augie Fackler says he may want to use it). To enable deletion, this
patch replaces it by the error module in the demandimport test (any
module works). However, since the error module had already been loaded
at this point in the test (via the util module), I moved it earlier in
the test so it's still not loaded (although I'm not sure if that's
even relevant to the test).
Differential Revision: https://phab.mercurial-scm.org/D2287
Yuya Nishihara <yuya@tcha.org> [Mon, 08 Jan 2018 12:09:43 +0900] rev 36283
help: use cmdutil.parsealiases() to resolve command name
This seems slightly better than parsing '^command|name' string by using an
ad-hoc pattern.
Yuya Nishihara <yuya@tcha.org> [Sun, 27 Dec 2015 14:13:27 +0900] rev 36282
help: list deprecated and experimental extensions if --verbose
This is common in the other help topics.
Yuya Nishihara <yuya@tcha.org> [Sun, 27 Dec 2015 13:08:51 +0900] rev 36281
hgweb: translate Abort in help command to 404 error
c3784e3c3e8d changed the exception type to be raised if unknowncmd=False.
Yuya Nishihara <yuya@tcha.org> [Mon, 08 Jan 2018 11:11:06 +0900] rev 36280
templatekw: add {reporoot} keyword
The "%b" in filename format string will be replaced with "{reporoot|basename}".
Yuya Nishihara <yuya@tcha.org> [Sun, 07 Jan 2018 12:09:33 +0900] rev 36279
templatefilters: add dirname() filter
This is different from stripdir() in that the last component is always
removed.
Yuya Nishihara <yuya@tcha.org> [Sun, 07 Jan 2018 11:21:25 +0900] rev 36278
templater: add function to help substituting patterns in template string
This will be used to rewrite a filename pattern to a template string.
Yuya Nishihara <yuya@tcha.org> [Sun, 07 Jan 2018 11:04:53 +0900] rev 36277
templater: extract function scanning template string
This provides a tokenizer-level view of template fragments, and will be
used to substitute patterns in outermost 'string' tokens.
Yuya Nishihara <yuya@tcha.org> [Sun, 07 Jan 2018 11:26:16 +0900] rev 36276
cmdutil: narrow scope of KeyError in makefilename()
It seemed too broad to catch a standard Python exception.
Augie Fackler <augie@google.com> [Wed, 14 Feb 2018 21:34:12 -0500] rev 36275
node: make bin() be a wrapper instead of just an alias
This includes a full backout of 59affe7e and 30d0cb27. Per the review
of the former, we'd rather adapt the API to behave like it used to (at
least for now), and take a second run at it if it shows up in our
performance numbers. I ran perfrevlogindex with and without this
change and it didn't make a measurable difference, so maybe it's fine
(despite my intuition to the contrary).
Differential Revision: https://phab.mercurial-scm.org/D2279
Martin von Zweigbergk <martinvonz@google.com> [Fri, 16 Feb 2018 11:30:18 -0800] rev 36274
tests: actually check that HGDEMANDIMPORT=disable disables demandimport
At the point in the test where we were checking that the 'node' got
eagerly loaded, it had already been loaded (via the pvec module), so
our check wasn't doing anything (i.e. the test would pass even if you
removed the line that set HGDEMANDIMPORT=disable). Let's move this
test earlier so it tests what it was meant to test.
Differential Revision: https://phab.mercurial-scm.org/D2286
Kyle Lippincott <spectral@google.com> [Thu, 04 Jan 2018 16:29:07 -0800] rev 36273
debugcommands: print out the editor that was searched for (post shlexsplit)
A user was in #mercurial and had the following settings in their hgrc:
[ui]
editor = C:\home\npp\notepad++.exe -multiInst -nosession
After shlexsplit, the first argument was mangled into C:homenppnotepad++.exe,
which was quite unlikely to exist. It took many back-and-forths to identify
that adding " characters around the exe would fix the issue; we were thinking
that it's because something was incorrectly *not* splitting and adding/moving
the " characters fixed the split boundaries, but when testing afterward it
appears that it's just mangled.
I considered adding an informational if pycompat.iswindows and \ in the string
about this issue, but was worried that might have too many false positives and
did not do so at this time.
Differential Revision: https://phab.mercurial-scm.org/D1808
Augie Fackler <augie@google.com> [Fri, 16 Feb 2018 17:24:31 -0500] rev 36272
merge with stable
Anton Shestakov <av6@dwimlabs.net> [Thu, 15 Feb 2018 21:14:57 +0800] rev 36271
hgweb: show dates recorded in obsolescence markers
Dates of operations that obsolete commits are also important enough to be
shown, but maybe not as important as original commit dates, that and also for
brevity is why they are wrapped in a <span> with only "age" class. Provided
that JS is enabled, such elements only show age (e.g. "3 months ago"), and the
exact date is visible in a tooltip. Commits dates, on the other hand, show both
date and age (the latter in parenthesis).
Example result for f1a0933ce59e from hg-committed:
obsolete: pruned by Yuya Nishihara <yuya@tcha.org> 13 days ago
Anton Shestakov <av6@dwimlabs.net> [Thu, 15 Feb 2018 21:05:31 +0800] rev 36270
gitweb: make span.age CSS selector more specific
This set of CSS properties is only used on /changelog page to make age elements
float to the left and be fixed in size, but span.a is too broad of a selector,
because we don't want to apply these properties to all <span> elements that
have age class.
Augie Fackler <augie@google.com> [Thu, 15 Feb 2018 17:30:43 -0500] rev 36269
wireprotoserver: return to using iscmd() method
This was teased out in part so remotefilelog could disable an old
protocol method over http. It got dropped accidentally in the recent
refactor, but the code was all still present so it's easy to support
for now.
I think once we land remotefilelog, we should probably inline this
function.
Differential Revision: https://phab.mercurial-scm.org/D2285
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 11 Feb 2018 17:23:58 -0800] rev 36268
githelp: cast commands to bytes
This is more compatible with Python 3.
Differential Revision: https://phab.mercurial-scm.org/D2165
Pulkit Goyal <7895pulkit@gmail.com> [Wed, 14 Feb 2018 17:43:33 +0530] rev 36267
py3: use util.forcebytestr instead of str for converting errors to bytes
Differential Revision: https://phab.mercurial-scm.org/D2269
Pulkit Goyal <7895pulkit@gmail.com> [Wed, 14 Feb 2018 16:37:46 +0530] rev 36266
py3: use pycompat.bytestr to convert str to bytes
Differential Revision: https://phab.mercurial-scm.org/D2261
Augie Fackler <augie@google.com> [Mon, 12 Feb 2018 10:41:00 -0500] rev 36265
mpatch: allow clang-format oversight
Differential Revision: https://phab.mercurial-scm.org/D2183
Augie Fackler <augie@google.com> [Mon, 12 Feb 2018 10:39:46 -0500] rev 36264
base85: allow clang-format oversight
Differential Revision: https://phab.mercurial-scm.org/D2182
Augie Fackler <augie@google.com> [Mon, 12 Feb 2018 10:38:11 -0500] rev 36263
charencode: allow clang-format oversight
Nice and easy.
Differential Revision: https://phab.mercurial-scm.org/D2181
Augie Fackler <augie@google.com> [Wed, 14 Feb 2018 21:12:48 -0500] rev 36262
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 36261
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 36260
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 36259
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 36258
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 36257
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 36256
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 36255
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 36254
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 36253
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