Wed, 11 Apr 2018 16:09:23 -0400 hgweb: put response headers back into str for Python 3
Augie Fackler <augie@google.com> [Wed, 11 Apr 2018 16:09:23 -0400] rev 37589
hgweb: put response headers back into str for Python 3 This fixes a lot of hanging tests on Python 3, because "Content-Length" was getting sent as "b'Content-Length'" (yes, really) and then clients would expect a close-is-end body instead of counting off a certain number of bytes. Differential Revision: https://phab.mercurial-scm.org/D3248
Wed, 11 Apr 2018 14:57:11 -0400 tests: load showstack in test-pull-http.t so network hangs are easier to find
Augie Fackler <augie@google.com> [Wed, 11 Apr 2018 14:57:11 -0400] rev 37588
tests: load showstack in test-pull-http.t so network hangs are easier to find This also gives us some minimal "it loads" coverage on showstack, which I rather like. showstack doesn't work on Windows per mbarbison, so it's disabled there. I added this in service of debugging a hang introduced on Python 3 by revision a88d68dc3ee8. I'm still not sure what the problem there is, but this at least gives us a little bit of a chance to figure out what's going on. Differential Revision: https://phab.mercurial-scm.org/D3247
Wed, 11 Apr 2018 14:39:49 -0400 keepalive: rewrite readinto() to not use read()
Augie Fackler <augie@google.com> [Wed, 11 Apr 2018 14:39:49 -0400] rev 37587
keepalive: rewrite readinto() to not use read() It turns out http.client on Python 3 sometimes uses readinto() in the implementation of read(). Unfortunately, Python 2 doesn't have a readinto() in httplib's client, so we have to support both codepaths. Subclassing is bad, folks. Differential Revision: https://phab.mercurial-scm.org/D3246
Thu, 12 Apr 2018 17:22:59 +0530 py3: use bytes() instead of str() on util.url()
Pulkit Goyal <7895pulkit@gmail.com> [Thu, 12 Apr 2018 17:22:59 +0530] rev 37586
py3: use bytes() instead of str() on util.url() We internally deal with bytes and anything as string breaks things. Differential Revision: https://phab.mercurial-scm.org/D3285
Thu, 12 Apr 2018 17:21:56 +0530 py3: use stringutil.forcebytestr() to convert error messages to bytes
Pulkit Goyal <7895pulkit@gmail.com> [Thu, 12 Apr 2018 17:21:56 +0530] rev 37585
py3: use stringutil.forcebytestr() to convert error messages to bytes Differential Revision: https://phab.mercurial-scm.org/D3284
Thu, 12 Apr 2018 08:06:39 -0700 py3: suppress the return value of write() in tests/test-subrepo-missing.t
Pulkit Goyal <7895pulkit@gmail.com> [Thu, 12 Apr 2018 08:06:39 -0700] rev 37584
py3: suppress the return value of write() in tests/test-subrepo-missing.t write() on Python 3 returns a value whereas does not return anything on Python 2. So we need to supress the value. Differential Revision: https://phab.mercurial-scm.org/D3283
Thu, 12 Apr 2018 16:52:32 +0530 py3: add b'' prefixes in tests/test-linerange.py
Pulkit Goyal <7895pulkit@gmail.com> [Thu, 12 Apr 2018 16:52:32 +0530] rev 37583
py3: add b'' prefixes in tests/test-linerange.py This makes the test pass on Python 3. # skip-blame because just b'' prefixes Differential Revision: https://phab.mercurial-scm.org/D3282
Thu, 12 Apr 2018 15:23:36 +0530 py3: add b'' prefix to make the regex bytes
Pulkit Goyal <7895pulkit@gmail.com> [Thu, 12 Apr 2018 15:23:36 +0530] rev 37582
py3: add b'' prefix to make the regex bytes # skip-blame because just b'' prefix Differential Revision: https://phab.mercurial-scm.org/D3281
Thu, 12 Apr 2018 15:22:56 +0530 py3: use b'%d' to convert int to bytes instead of str()
Pulkit Goyal <7895pulkit@gmail.com> [Thu, 12 Apr 2018 15:22:56 +0530] rev 37581
py3: use b'%d' to convert int to bytes instead of str() Differential Revision: https://phab.mercurial-scm.org/D3280
Thu, 12 Apr 2018 15:03:15 +0530 py3: use print as a function in test-convert-git.t
Pulkit Goyal <7895pulkit@gmail.com> [Thu, 12 Apr 2018 15:03:15 +0530] rev 37580
py3: use print as a function in test-convert-git.t Differential Revision: https://phab.mercurial-scm.org/D3278
Thu, 12 Apr 2018 14:30:37 +0530 py3: use '%d' for integers instead of '%s'
Pulkit Goyal <7895pulkit@gmail.com> [Thu, 12 Apr 2018 14:30:37 +0530] rev 37579
py3: use '%d' for integers instead of '%s' Differential Revision: https://phab.mercurial-scm.org/D3277
Thu, 12 Apr 2018 14:28:08 +0530 py3: prevent transformer from adding b'' by adding r'' prefix
Pulkit Goyal <7895pulkit@gmail.com> [Thu, 12 Apr 2018 14:28:08 +0530] rev 37578
py3: prevent transformer from adding b'' by adding r'' prefix These are cases where we need to use str, therefore we add r'' prefix. # skip-blame because just r'' prefixes Differential Revision: https://phab.mercurial-scm.org/D3276
Thu, 12 Apr 2018 14:26:31 +0530 py3: use pycompat.{strkwargs|byteskwargs} in infinitepush
Pulkit Goyal <7895pulkit@gmail.com> [Thu, 12 Apr 2018 14:26:31 +0530] rev 37577
py3: use pycompat.{strkwargs|byteskwargs} in infinitepush Differential Revision: https://phab.mercurial-scm.org/D3275
Wed, 11 Apr 2018 22:36:16 +0530 py3: make sure we open file in bytes mode
Pulkit Goyal <7895pulkit@gmail.com> [Wed, 11 Apr 2018 22:36:16 +0530] rev 37576
py3: make sure we open file in bytes mode Differential Revision: https://phab.mercurial-scm.org/D3274
Sat, 07 Apr 2018 01:37:25 +0900 diffhelpers: be more tolerant for stripped empty lines of CRLF ending
Yuya Nishihara <yuya@tcha.org> [Sat, 07 Apr 2018 01:37:25 +0900] rev 37575
diffhelpers: be more tolerant for stripped empty lines of CRLF ending Exchange. It appears to trim lines containing only whitespace as well as converting LF to CRLF.
Mon, 09 Apr 2018 21:08:52 +0900 diffhelpers: make return value of testhunk() more Pythonic
Yuya Nishihara <yuya@tcha.org> [Mon, 09 Apr 2018 21:08:52 +0900] rev 37574
diffhelpers: make return value of testhunk() more Pythonic It's no longer C.
Mon, 09 Apr 2018 21:06:46 +0900 patch: error out if reached to EOF while reading hunk
Yuya Nishihara <yuya@tcha.org> [Mon, 09 Apr 2018 21:06:46 +0900] rev 37573
patch: error out if reached to EOF while reading hunk This was where out-of-bounds read occurred in old C extension.
Mon, 09 Apr 2018 20:55:05 +0900 diffhelpers: remove unused return value from fixnewline() and addlines()
Yuya Nishihara <yuya@tcha.org> [Mon, 09 Apr 2018 20:55:05 +0900] rev 37572
diffhelpers: remove unused return value from fixnewline() and addlines()
Mon, 09 Apr 2018 20:54:00 +0900 diffhelpers: move out of pure package
Yuya Nishihara <yuya@tcha.org> [Mon, 09 Apr 2018 20:54:00 +0900] rev 37571
diffhelpers: move out of pure package
Mon, 09 Apr 2018 20:52:54 +0900 diffhelpers: naming and whitespace cleanup
Yuya Nishihara <yuya@tcha.org> [Mon, 09 Apr 2018 20:52:54 +0900] rev 37570
diffhelpers: naming and whitespace cleanup
Mon, 09 Apr 2018 20:51:23 +0900 diffhelpers: remove C implementation in favor of pure Python version
Yuya Nishihara <yuya@tcha.org> [Mon, 09 Apr 2018 20:51:23 +0900] rev 37569
diffhelpers: remove C implementation in favor of pure Python version
Mon, 09 Apr 2018 20:49:39 +0900 patch: stop using cext.diffhelpers
Yuya Nishihara <yuya@tcha.org> [Mon, 09 Apr 2018 20:49:39 +0900] rev 37568
patch: stop using cext.diffhelpers The C implementation has a couple of memory bugs, and lacks error handling which could lead to SEGV. I could fix them one by one (and I mostly finished that), but the performance gain provided by cext.diffhelper is quite low. Besides, diffhelpers.addlines() calls back Python, linereader.readline(), from the innermost loop. $ hg export -R mozilla-central 0:100 > patch $ ls -lh patch -rw-r--r-- 184M patch $ hg init repo && hg -R repo import patch --time --bypass (cext) time: real 34.970 secs (user 32.720+0.000 sys 2.230+0.000) (pure) time: real 35.950 secs (user 33.600+0.000 sys 2.330+0.000) So, let's simply use the pure Python implementation.
Mon, 09 Apr 2018 20:47:43 +0900 diffhelpers: port docstrings from cext to pure
Yuya Nishihara <yuya@tcha.org> [Mon, 09 Apr 2018 20:47:43 +0900] rev 37567
diffhelpers: port docstrings from cext to pure I'll remove the C implementation.
Mon, 09 Apr 2018 20:44:41 +0900 py3: get rid of character access from pure.diffhelpers
Yuya Nishihara <yuya@tcha.org> [Mon, 09 Apr 2018 20:44:41 +0900] rev 37566
py3: get rid of character access from pure.diffhelpers 's' is a result of readline(), so 'c == "\n"' means 's == "\n"'.
Wed, 11 Apr 2018 18:23:29 -0400 lfs: handle paths that don't end with '/' when inferring the blob store
Matt Harbison <matt_harbison@yahoo.com> [Wed, 11 Apr 2018 18:23:29 -0400] rev 37565
lfs: handle paths that don't end with '/' when inferring the blob store While here, I also checked the lfs.url config directly instead of testing the scheme, as requested by Yuya.
Sun, 08 Apr 2018 14:22:12 -0400 lfs: infer the blob store URL from an explicit push dest or default-push
Matt Harbison <matt_harbison@yahoo.com> [Sun, 08 Apr 2018 14:22:12 -0400] rev 37564
lfs: infer the blob store URL from an explicit push dest or default-push Unlike pull, the blobs are uploaded within the exchange.push() window, so simply wrap it and swap in a properly configured remote store. The '_subtoppath' field shouldn't be available during this window, but give the passed path priority for clarity. At one point I hit an AttributeError in one of the convert tests when trying to save the original remote blobstore when the swap was run unconditionally. I wrapped it in a util.safehasattr(), but then today I wasn't able to reproduce it. But now the whole thing is tucked under the requirement guard because without the requirement, there are no blobs in the repo, even if the extension is loaded.
Sun, 08 Apr 2018 01:23:39 -0400 lfs: infer the blob store URL from an explicit pull source
Matt Harbison <matt_harbison@yahoo.com> [Sun, 08 Apr 2018 01:23:39 -0400] rev 37563
lfs: infer the blob store URL from an explicit pull source I don't see any easier way to do this because the update part of `hg pull -u` happens outside exchange.pull(), and commands.postincoming() doesn't take a path. So (ab)use the mechanism used by subrepos to redirect where subrepos are pulled from when an explicit path is given. As a bonus, this should allow lfs blobs to be pulled into a subrepo when it is checked out. An explicit push path can be handled within exchange.push(). That can be done next, outside of this dirty hack.
Wed, 11 Apr 2018 17:29:55 -0400 lfs: special case the null:// usercache instead of treating it as a url
Matt Harbison <matt_harbison@yahoo.com> [Wed, 11 Apr 2018 17:29:55 -0400] rev 37562
lfs: special case the null:// usercache instead of treating it as a url The previous code worked on Windows, but not on Unix, and a pending patch's test failed. The url being used was something like "/tmp/.../client1/null://", courtesy of ui.configpath(). Looking at the doc comment, this seems like it's maybe not the right function to call (why should a relative cache path be expanded relative to the repo root or config file?), but largefiles has been using it since 8b8dd13295db (Oct 2011). It was introduced in 1b591f9b7fd2 (Jan 2011) without comment or callers. A grep over the whole history shows that only largefiles used it until lfs and infinitepush came along recently. It looks like if the `if not os.path.isabs(v) or "://" not in v` in configpath() is changed to an 'and', both Linux and Windows are happy. I'm guessing that "://" is to pick off URLs, so that seems reasonable. But I'm not sure why it isn't explicitly "file://", and I thought that "file://foo" is relative anyway. (At least, there are doctests for file:///tmp in util.url.) There is no mention of this setting in the help, but it is referenced on the wiki page for largefiles. (There's no mention that this is intended to be a URL, and the example uses an absolute path.) I don't want this blocking the rest of the lfs server discovery stuff. It was also wrong to allow a file:// URL here, but not in largefiles.
Wed, 04 Apr 2018 17:37:35 +0530 tests: add tests showing pulling from infinitepush works over wire
Pulkit Goyal <7895pulkit@gmail.com> [Wed, 04 Apr 2018 17:37:35 +0530] rev 37561
tests: add tests showing pulling from infinitepush works over wire The current tests in test-infinitepush-ci.t showed that `hg pull -r <rev>` does not work. Digging in code, I found that we have logic for pulling from bundlestore without having client side logic. This patch adds test demonstrating that pulling from bundlestore works when working over wire. Pulling from bundlestore when the peer is a localpeer still does not works. Differential Revision: https://phab.mercurial-scm.org/D3072
Fri, 30 Mar 2018 17:01:12 -0700 fix: use a portable python script instead of sed in test
Danny Hooper <hooper@google.com> [Fri, 30 Mar 2018 17:01:12 -0700] rev 37560
fix: use a portable python script instead of sed in test Differential Revision: https://phab.mercurial-scm.org/D2988
(0) -30000 -10000 -3000 -1000 -300 -100 -50 -30 +30 +50 +100 +300 +1000 +3000 +10000 tip