Gregory Szorc <gregory.szorc@gmail.com> [Sun, 15 May 2016 11:50:49 -0700] rev 29228
sslutil: remove redundant check of sslsocket.cipher()
We are doing this check in both wrapsocket() and validatesocket().
The check was added to the validator in 4bb59919c905 and the commit
message justifies the redundancy with a "might." The check in
wrapsocket() was added in 0cc4ad757c77, which appears to be part of
the same series. I'm going to argue the redundancy isn't needed.
I choose to keep the check in wrapsocket() because it is working
around a bug in Python's wrap_socket() and I feel the check for
the bug should live next to the function call exhibiting the bug.
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 15 May 2016 11:38:38 -0700] rev 29227
sslutil: convert socket validation from a class to a function (API)
Now that the socket validator doesn't have any instance state,
we can make it a generic function.
The "validator" class has been converted into the "validatesocket"
function and all consumers have been updated.
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 15 May 2016 11:32:11 -0700] rev 29226
sslutil: store and use hostname and ui in socket instance
Currently, we pass a hostname and ui to sslutil.wrap_socket()
then create a separate sslutil.validator instance also from
a hostname and ui. There is a 1:1 mapping between a wrapped
socket and a validator instance. This commit lays the groundwork
for making the validation function generic by storing the
hostname and ui instance in the state dict attached to the
socket instance and then using these variables in the
validator function.
Since the arguments to sslutil.validator.__init__ are no longer
used, we make them optional and make __init__ a no-op.
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 15 May 2016 11:25:07 -0700] rev 29225
sslutil: use a dict for hanging hg state off the wrapped socket
I plan on introducing more state on the socket instance. Instead
of using multiple variables, let's just use one to minimize risk
of name collision.
Gregory Szorc <gregory.szorc@gmail.com> [Thu, 05 May 2016 19:10:18 -0700] rev 29224
sslutil: require serverhostname argument (API)
All callers now specify it. So we can require it.
Requiring the argument means SNI will always work if supported
by Python.
The main reason for this change is to store state on the socket
instance to make the validation function generic. This will be
evident in subsequent commits.
Matt Mackall <mpm@selenic.com> [Wed, 18 May 2016 16:37:32 -0500] rev 29223
annotate: optimize line counting
We used len(text.splitlines()) to count lines. This allocates, copies, and
deallocates an object for every line in a file. Instead, we use
count("\n") to count newlines and adjust based on whether there's a
trailing newline.
This improves the speed of annotating localrepo.py from 4.2 to 4.0
seconds.
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 16 May 2016 14:21:39 -0700] rev 29222
purge: use opts.get()
Most commands use opts.get() to retrieve values for options
that may not be explicitly passed. purge wasn't.
This makes it easier to call purge() from 3rd party extensions.
timeless <timeless@mozdev.org> [Wed, 11 May 2016 15:20:25 +0000] rev 29221
test-run-tests: clean up inuse server eagerly
timeless <timeless@mozdev.org> [Wed, 11 May 2016 16:40:16 +0000] rev 29220
tests: refactor run-tests helpers
test-run-tests-rev.t will need them
timeless <timeless@mozdev.org> [Wed, 11 May 2016 04:49:27 +0000] rev 29219
tests: silence test-repo obsolete warning
refactoring test-check-commit.t HGRCPATH bits as helpers-testrepo.sh