- Jan 25, 2019
-
-
Boris Feld authored
The command focus on timing of the nodemap object itself.
-
- Jan 30, 2019
-
-
Gregory Szorc authored
The "hex" codec doesn't exist in Python 3. We could use `codecs.decode(h, 'hex_codec')`. But `binascii.unhexlify()` exists and should work the same on Python 2 and 3. Differential Revision: https://phab.mercurial-scm.org/D5755
-
Gregory Szorc authored
It appears that Python 3 introduced output buffering in the HTTP response stack. And Python 3.6 switched from sock.makefile().write() to sock.sendall(). So, we need to conditionalize test-http-bad-server.t to account for the difference in behavior between Python 3.5 and 3.6. Differential Revision: https://phab.mercurial-scm.org/D5754
-
Gregory Szorc authored
Python 3's HTTP server layer buffers output and uses sendall() instead of write(). In order to make test-http-bad-server.t pass on Python 3, we needed to teach our socket proxy to log sendall() events and to abort future sends if we reached our send limit. The tests using `tail` were difficult to port with inline output conditionals since the number of lines varied. So we now use `#if py3` for these tests. test-http-bad-server.t now passes on Python 3.6 and 3.7 on at least Linux. However, it does not yet pass on Python 3.5 because of low-level differences to how the HTTP server is implemented. Differential Revision: https://phab.mercurial-scm.org/D5753
-
- Jan 29, 2019
-
-
Gregory Szorc authored
Most of these are readline(65537) on Python 3. I don't think it is worth the readability hit to use (re), as it would require escaping parenthesis. Differential Revision: https://phab.mercurial-scm.org/D5752
-
- Jan 30, 2019
-
-
Gregory Szorc authored
Python 3 uses a different type to represent a socket file object than Python 2. We need to conditionalize how the socket is closed accordingly. While we're here, we switch to use socket.shutdown() to close the socket. This is because socket.close() may not actually close the socket until it is GCd. socket.shutdown() forces an immediate shutdown. I suspect Python 3 changed semantic behavior here, as I can't get test-http-bad-server.t to work with socket.close(). socket.shutdown() does appear to work, however. Differential Revision: https://phab.mercurial-scm.org/D5751
-
Gregory Szorc authored
This avoids a handful of failures due to missing str and bytes. # skip-blame: just a bunch of b'' prefixes Differential Revision: https://phab.mercurial-scm.org/D5750
-
Gregory Szorc authored
Previously, an uncaught exception during HTTP request serving would attempt to send an error response then log the exception. If an exception occurred during I/O, this exception would be raised and the original exception wouldn't be logged. This commit changes behavior so the original exception is logged first, before we attempt to do anything else. This ensures the exception is logged. This change resulted in new tracebacks appearing in various tests. Because tracebacks can vary between Python versions, we added a simple script to filter the stack part of traceback lines. This makes testing much simpler, as we don't need to glob over lines and make lines conditional. Differential Revision: https://phab.mercurial-scm.org/D5749
-
- Jan 29, 2019
-
-
Gregory Szorc authored
Python 2.7 will print() \x94\x5c\x0a whereas Python 3 will print() \xc2\x94\x5c\x0a. Why, I'm not sure. It probably has to do with print() being Unicode aware on Python 3 and Python attempting some kind of encoding before emitting the output. This difference results in a different bytes making it to the commit message and the JSON output varying. We work around this by writing bytes to a commit message file. Differential Revision: https://phab.mercurial-scm.org/D5741
-
Kyle Lippincott authored
Previously, if there were no context lines, we would just keep updating the ranges and the hunk, but not actually storing the hunk (just overwriting it each time). Thus a diff like this: $ hg diff --config diff.unified=0 diff --git a/bar b/bar --- a/bar +++ b/bar @@ -1,0 +2,1 @@ 1 +change1 @@ -3,0 +5,1 @@ 3 +change2 would come out of the parser like this (change1 is lost): bar: @@ -3,0 +5,1 @@ 3 +change2 This had some really weird side effects for things like commit --interactive, split, etc. Differential Revision: https://phab.mercurial-scm.org/D5743
-
Pulkit Goyal authored
# skip-blame as just r'' prefixes Differential Revision: https://phab.mercurial-scm.org/D5740
-
Pulkit Goyal authored
Differential Revision: https://phab.mercurial-scm.org/D5738
-
Augie Fackler authored
Differential Revision: https://phab.mercurial-scm.org/D5736
-
Augie Fackler authored
Differential Revision: https://phab.mercurial-scm.org/D5735
-
Augie Fackler authored
Our type handling is a nightmare here, and we're loading passwords to do network IO, so we can afford to be potentially-slow but pedantic here. Differential Revision: https://phab.mercurial-scm.org/D5734
-
Pulkit Goyal authored
When we extend a narrow clone without ellipsis, we don't download changelog information because that's already present with the client. However we still try to build that chunk stream. Building that chunk stream involves calling a lookup function and store.emitrevisions() API. The lookup function is called len(cl) number of times. On large repositories, where len(cl) is in millions, calling that lookup function is not a good idea. Also it's not required to use the store.emitrevisons() API because we already have nodes present which we can use. This patch short-circuits state building logic if we are processing a non-ellipsis case and changelog is not required. This saves up ~20 seconds on our internal repo for a single extend call. Differential Revision: https://phab.mercurial-scm.org/D5733
-
Pulkit Goyal authored
This will make the next patch much easier. Differential Revision: https://phab.mercurial-scm.org/D5732
-
- Jan 26, 2019
-
-
Gregory Szorc authored
Python 3.7 changed behavior of urllib.parse.quote() from RFC 2396 to RFC 3986 and ~ is now in the set of reserved characters and isn't escaped. We conditioanlize test output accordingly. Differential Revision: https://phab.mercurial-scm.org/D5717
-
- Oct 13, 2018
-
-
Gregory Szorc authored
This will allow us to sniff for Python >= versions in tests. Differential Revision: https://phab.mercurial-scm.org/D5088
-
- Jan 29, 2019
-
-
Pulkit Goyal authored
Differential Revision: https://phab.mercurial-scm.org/D5731
-
- Jan 26, 2019
-
-
Gregory Szorc authored
Keepalives were not working on Python 3 because http.client.HTTPResponse was refactored to call _close_conn() instead of close(). Our custom close() is what returns inactive connections to the available state. We better support Python 3 by implementing a _close_conn(). Differential Revision: https://phab.mercurial-scm.org/D5720
-
- Jan 29, 2019
-
-
Matt Harbison authored
This was the reason for test-lfs-test-server.t#git-server complaining about an "invalid byte in chunk length". For some reason if this isn't explicitly added, py3.7.1 is adding `transfer-encoding: chunked` as well as `Content-length: x`. Wireshark flagged this as malformed. However, if this is set, it doesn't bother with `transfer-encoding`. Before this patch with py3: PUT /objects/31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b HTTP/1.1 Accept-Encoding: identity Content-length: 12 accept: application/vnd.git-lfs content-type: application/octet-stream host: localhost:20062 transfer-encoding: chunked user-agent: git-lfs/2.3.4 (Mercurial 4.9rc0+149-7eb7637e34bf) Before this patch with py27: PUT /objects/31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b HTTP/1.1 Accept-Encoding: identity accept: application/vnd.git-lfs content-type: application/octet-stream content-length: 12 host: localhost:20062 user-agent: git-lfs/2.3.4 (Mercurial 4.9rc0+149-7eb7637e34bf+20190128) With this patch and py3, the content is the same as the py27 example. RFC2616 says to ignore `Content-Length` if `Transfer-Encoding` is present, so maybe there's nothing to do in the hg-server side (though I'm not sure which it is using if presented both). Maybe chunked encoding is better to do? If someone knows how to suppress the `Content-Length`, we can try that instead.
-
- Jan 28, 2019
-
-
Boris Feld authored
The nodemap code has optimisations around the number of lookup we actually made. As a result, being able to specify multiple revisions to look up is important when measuring performances. One can now specify full revspecs with the --rev arguments.
-
- Jan 25, 2019
-
-
Boris Feld authored
It is useful to check how long it takes to create a index object without doing anything with it. We add a new flag dedicated to that.
-
- Jan 28, 2019
-
-
Boris Feld authored
It seems useful to document how the arguments can affect the benchmark.
-
- Jan 25, 2019
-
-
Boris Feld authored
The cache clearing is pretty fast, but this seems more "correct".
-
Boris Feld authored
This clarify why we just call clearcaches on a single object.
-
Boris Feld authored
-
- Jan 28, 2019
-
-
Matt Harbison authored
The print() statements were being output at the very end, so write to the same stdout sink as runcommand, and explicitly flush.
-
Matt Harbison authored
I'm not sure why the one stackframe is py2 only, but that seems harmless. The remaining failure is LfsCorruptionError printing the fully qualified name, as well as b'' around its message.
-
Matt Harbison authored
For reasons unknown, py3 is adding an extra '\n' before the headers print out. This makes the output the same as py2.
-
- Jan 27, 2019
-
-
Matt Harbison authored
Otherwise, there's a lot of py2/py3 divergence in the LFS tests because of the "HG error" lines picking up a b'' prefix. wsgicgi.py uses procutil.stderr, so I assume the input was meant to be bytes.
-
Matt Harbison authored
It got too confusing juggling r'' vs b'' across several functions.
-
Matt Harbison authored
In stabilizing test-lfs-serve-access.t for py3, the server started asserting on blob upload: Environment should not have the key: HTTP_CONTENT_LENGTH (use CONTENT_LENGTH instead) It could be avoided by explicitly setting the Content-Length header on the client side. I didn't go back to py2, but printing the original header here in py37 revealed 'Content-length' when sent to the error log.
-
Matt Harbison authored
This is (almost?) entirely from Augie's work. I'm a bit surprised that the JSON data is being encoded with ASCII via `pycompat.bytesurl()`- I would have thought UTF-8.
-
Matt Harbison authored
This is almost entirely b'' prefixing, with a couple of exceptions forced to bytes. Much of this is also borrowed from Augie's code. There's an HTTPError.read() that I flagged that I assume needs to be converted to bytes, but I can't find confirmation. Handling the deserialized JSON object over several functions made r'' vs b'' accesses confusing, so this assumes that the JSON object will be converted to bytes immediately. That will be done in the following commits, so it's not buried in these trivial changes.
-
Matt Harbison authored
Some of this is based on code written by Augie. I'm slightly unsure if these are the correct pycompat bytes <-> str conversion methods.
-
Matt Harbison authored
There are a ton of these changes in the blobstore, as well as r'' prefixing. So separating these out hopefully makes review easier. # skip-blame for b'' prefixing
-
Matt Harbison authored
-
- Jan 28, 2019
-
-
Augie Fackler authored
Differential Revision: https://phab.mercurial-scm.org/D5730
-