Pulkit Goyal <7895pulkit@gmail.com> [Mon, 26 Feb 2018 23:54:40 +0530] rev 36450
py3: convert bytes to str using encoding.strfromlocal
using encoding.strfromlocal because sender is provided from user config or
argument.
Differential Revision: https://phab.mercurial-scm.org/D2460
Pulkit Goyal <7895pulkit@gmail.com> [Mon, 26 Feb 2018 23:50:30 +0530] rev 36449
py3: use encoding.strtolocal() to convert str to bytes
Differential Revision: https://phab.mercurial-scm.org/D2459
Pulkit Goyal <7895pulkit@gmail.com> [Mon, 26 Feb 2018 16:19:53 +0530] rev 36448
py3: use email.utils module instead of email.Utils
On py2:
>>> import email
>>> import email.utils as eutil
>>> email.Utils.parseaddr is eutil.parseaddr
True
>>> email.Utils.formatdate is eutil.formatdate
True
email.Utils is not present on Python 3.
Differential Revision: https://phab.mercurial-scm.org/D2453
Pulkit Goyal <7895pulkit@gmail.com> [Mon, 26 Feb 2018 17:25:46 +0530] rev 36447
py3: slice over bytes or use .startswith() to prevent getting ascii values
Differential Revision: https://phab.mercurial-scm.org/D2457
Pulkit Goyal <7895pulkit@gmail.com> [Mon, 26 Feb 2018 16:23:12 +0530] rev 36446
py3: use '%d' for integers instead of '%s'
Differential Revision: https://phab.mercurial-scm.org/D2455
Yuya Nishihara <yuya@tcha.org> [Sun, 25 Feb 2018 13:24:35 +0900] rev 36445
templatekw: add 'requires' flag to switch to exception-safe interface
The current templatekw interface, f(repo, ctx, templ, **args), is horrible
because it's quite easy to encounter TypeError, ValueError, etc. It's also
bad for Python 3 porting due to the **kwargs issue.
This patch introduces a flag to switch to new f(context, mapping) API seen
in templater functions. The requirement spec isn't verified (yet) because
context.resource() can gracefully raise a ResourceUnavailable exception,
but it's planned to be used as a filter in the help, such as "Revision
Keywords" (if 'ctx' in requires), "File Keywords" (if 'fctx' in requires),
etc.
showauthor() is ported to the new API as an example. 20 more follows.
Yuya Nishihara <yuya@tcha.org> [Sun, 25 Feb 2018 12:50:30 +0900] rev 36444
templater: specialize ResourceUnavailable error so that it can be caught
See the next patch how it will be used.
Yuya Nishihara <yuya@tcha.org> [Sun, 25 Feb 2018 12:47:53 +0900] rev 36443
templater: move specialized exception types to top
I'm going to add one more exception type.
Yuya Nishihara <yuya@tcha.org> [Sun, 25 Feb 2018 14:14:33 +0900] rev 36442
templatekw: minimize resource dependency of {envvars} and {termwidth}
These keywords can be evaluated without a repo.
Yuya Nishihara <yuya@tcha.org> [Sun, 25 Feb 2018 14:12:34 +0900] rev 36441
templatekw: simply override {graphwidth} function by mapping variable
Yuya Nishihara <yuya@tcha.org> [Sun, 25 Feb 2018 16:40:41 +0900] rev 36440
remotenames: drop redundant templatekw names from help text
Also removed the second "List of" phrase, which is obvious from the type
"List of strings."
Yuya Nishihara <yuya@tcha.org> [Sun, 25 Feb 2018 13:42:51 +0900] rev 36439
narrow: drop redundant templatekw/revset names from help text
":<name>:" is automatically added by the registrar.
Matt Harbison <matt_harbison@yahoo.com> [Sun, 25 Feb 2018 21:04:12 -0500] rev 36438
run-tests: don't mask errors when a server fails to start
There are sporadic instances of this on Windows. They seem to happen more
frequently after the test machine is rebooted, although the only way to hit it
on my laptop is to loop certain tests with -j9 for hours. The problem with
masking out the specific failure is that there's no way to know if it's the same
line in the test that's failing, or if it is random.
The justification for adding this masking in
52e9e63f1495 was that the failures
occur regularly, but that's not the case anymore. The port number is still
printed, in case that turns out to be useful.
Pulkit Goyal <7895pulkit@gmail.com> [Mon, 26 Feb 2018 17:27:08 +0530] rev 36437
py3: use bytes instead of str in isinstance
Internally we use bytes everywhere, and str on Python 3 is unicodes, so we need
to make sure we are doing the right check.
Differential Revision: https://phab.mercurial-scm.org/D2458
Pulkit Goyal <7895pulkit@gmail.com> [Mon, 26 Feb 2018 18:00:29 +0530] rev 36436
py3: convert a map expression into list comprehension
map returns a map object on Python 3 and here we wanted a list instead.
Differential Revision: https://phab.mercurial-scm.org/D2456
Pulkit Goyal <7895pulkit@gmail.com> [Mon, 26 Feb 2018 16:22:15 +0530] rev 36435
py3: use email.generator module instead of email.Generator
On py2:
>>> import email
>>> import email.generator as emailgen
>>> email.Generator.Generator is emailgen.Generator
True
email.Generator is not present on Python 3.
Differential Revision: https://phab.mercurial-scm.org/D2454
Pulkit Goyal <7895pulkit@gmail.com> [Mon, 26 Feb 2018 16:16:37 +0530] rev 36434
py3: use pycompat.strkwargs to convert kwargs keys to str
Differential Revision: https://phab.mercurial-scm.org/D2452
Augie Fackler <augie@google.com> [Mon, 26 Feb 2018 01:01:35 -0500] rev 36433
py3: whitelist test-push-http.t as passing
Differential Revision: https://phab.mercurial-scm.org/D2451
Augie Fackler <augie@google.com> [Mon, 26 Feb 2018 00:51:41 -0500] rev 36432
util: handle fileno() on Python 3 throwing io.UnsupportedOperation
Fortunately, the exception exists on Python 2 so we don't have to do
something weirder than this.
Differential Revision: https://phab.mercurial-scm.org/D2450
Augie Fackler <augie@google.com> [Mon, 26 Feb 2018 00:50:57 -0500] rev 36431
wireproto: use %d to encode an int, not a %s
Differential Revision: https://phab.mercurial-scm.org/D2449
Augie Fackler <augie@google.com> [Mon, 26 Feb 2018 00:50:35 -0500] rev 36430
httppeer: explicitly catch urlerr.httperror and re-raise
On Python 3 it seems urllib.error.HTTPError doesn't set the .args
field of the exception to have any contents, which then breaks our
socket.error catch. This works around that issue.
Differential Revision: https://phab.mercurial-scm.org/D2448
Augie Fackler <augie@google.com> [Mon, 26 Feb 2018 00:49:33 -0500] rev 36429
hgweb: pass exception message to builtin Exception ctor as sysstr
If we don't do this, the bytes gets repr()ed on Python 3 and we get
bogus error strings sent to clients. Ick.
Differential Revision: https://phab.mercurial-scm.org/D2447
Augie Fackler <augie@google.com> [Mon, 26 Feb 2018 00:28:10 -0500] rev 36428
bundle2: part id is an int, use %d to make it bytes
Differential Revision: https://phab.mercurial-scm.org/D2446
Augie Fackler <augie@google.com> [Mon, 26 Feb 2018 00:27:47 -0500] rev 36427
bundle2: **strkwargs love on various kwargs constructions
Differential Revision: https://phab.mercurial-scm.org/D2445