Fri, 06 Apr 2018 22:39:58 -0700 filelog: wrap revlog instead of inheriting it (API)
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 06 Apr 2018 22:39:58 -0700] rev 37497
filelog: wrap revlog instead of inheriting it (API) The revlog base class exposes a ton of methods. Inheriting the revlog class for filelog will make it difficult to expose a clean interface. There will be abstraction violations. This commit breaks the inheritance of revlog by the filelog class. Filelog instances now contain a reference to a revlog instance. Various properties and methods are now proxied to that instance. There is precedence for doing this: manifestlog does something similar. Although, manifestlog has a cleaner interface than filelog. We'll get there with filelog... The new filelog class exposes a handful of extra properties and methods that aren't part of the declared filelog interface. Every extra item was added in order to get a test to pass. The set of tests that failed without these extra proxies has significant overlap with the set of tests that don't work with the simple store repo. There should be no surprise there. Hopefully the hardest part about this commit to review are the changes to bundlerepo and unionrepo. Both repository types define a custom revlog or revlog-like class and then have a custom filelog that inherits from both filelog and their custom revlog. This code has been changed so the filelog types don't inherit from revlog. Instead, they replace the revlog instance on the created filelog. This is super hacky. I plan to fix this in a future commit by parameterizing filelog.__init__. Because Python function call overhead is a thing, this change could impact performance by introducing a nearly empty proxy function for various methods and properties. I would gladly measure the performance impact of it, but I'm not sure what operations have tight loops over filelog attribute lookups or function calls. I know some of the DAG traversal code can be sensitive about the performance of e.g. parentrevs(). However, many of these functions are implemented on the revlog class and therefore have direct access to self.parentrevs() and aren't going through a proxy. .. api:: filelog.filelog is now a standalone class and doesn't inherit from revlog. Instead, it wraps a revlog instance at self._revlog. This change was made in an attempt to formalize storage APIs and prevent revlog implementation details leaking through to callers. Differential Revision: https://phab.mercurial-scm.org/D3154
Mon, 09 Apr 2018 10:18:10 -0700 util: drop write_content_size=True
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 09 Apr 2018 10:18:10 -0700] rev 37496
util: drop write_content_size=True This is now the default in python-zstandard 0.9. While we're here, also add a comment about the ability to drop frame magic to save space. Differential Revision: https://phab.mercurial-scm.org/D3199
Mon, 09 Apr 2018 10:13:29 -0700 zstandard: vendor python-zstandard 0.9.0
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 09 Apr 2018 10:13:29 -0700] rev 37495
zstandard: vendor python-zstandard 0.9.0 This was just released. It features a number of goodies. More info at https://gregoryszorc.com/blog/2018/04/09/release-of-python-zstandard-0.9/. The clang-format ignore list was updated to reflect the new source of files. The project contains a vendored copy of zstandard 1.3.4. The old version was 1.1.3. One of the changes between those versions is that zstandard is now dual licensed BSD + GPLv2 and the patent rights grant has been removed. Good riddance. The API should be backwards compatible. So no changes in core should be needed. However, there were a number of changes in the library that we'll want to adapt to. Those will be addressed in subsequent commits. Differential Revision: https://phab.mercurial-scm.org/D3198
Sun, 08 Apr 2018 01:08:43 +0200 revlog: reset _nodepos after strip
Joerg Sonnenberger <joerg@bec.de> [Sun, 08 Apr 2018 01:08:43 +0200] rev 37494
revlog: reset _nodepos after strip When using the pure revlog parser, _nodepos is used to keep track of the position during index scanning in the non-cached cache. If it is out of bounds, BaseIndexObject._fix_index will assert. Since strip can actually remove the position scanned last, make sure to reset it. Add an assertion in the place where the invariance is clearer. Differential Revision: https://phab.mercurial-scm.org/D3188
Wed, 04 Apr 2018 13:14:48 +0800 paper: make all source lines have the same minimum height
Anton Shestakov <av6@dwimlabs.net> [Wed, 04 Apr 2018 13:14:48 +0800] rev 37493
paper: make all source lines have the same minimum height Empty source lines in paper and coal themes used to have smaller height than every other line (because of the way line numbers are shown and because they are using smaller font). This wasn't very noticeable before the follow lines functionality was added, but after that just using the follow-lines button to select a block of code with empty lines would demonstrate the fact that empty lines didn't have enough height - there were white "gaps" in the selection block. Since this problem occurs when lines don't have any content inside, let's create a pseudo-element (it's unselectable because of that) which still doesn't have any content, but fills up empty lines to 100% of their height because of display: inline-block. This is the most natural way to solve this annoyance that I've found so far. Hardcoding height isn't useful because we can have wrapped lines, in which case multiple lines of text need to fit into a single <span>. Setting min-height or line-height doesn't remove the gaps when viewed in Chromium.
Sun, 08 Apr 2018 20:53:07 +0800 hgweb: make followlines button absolutely positioned
Anton Shestakov <av6@dwimlabs.net> [Sun, 08 Apr 2018 20:53:07 +0800] rev 37492
hgweb: make followlines button absolutely positioned It used to have position: absolute only on annotate page, but it makes sense to have it everywhere, because the button shouldn't affect other elements at all. Especially since the button has a set height, which meant that for certain smaller fonts source lines were changing their height on hover. Note that the button doesn't set any of the usual properties that accompany absolute position (top, right, bottom or left). These properties would position the button without any account for source line padding. Instead, margins are used (the button already has all margins defined, they do the job).
Mon, 09 Apr 2018 22:00:11 +0800 hgweb: insert followlines buttons before any children, including text nodes
Anton Shestakov <av6@dwimlabs.net> [Mon, 09 Apr 2018 22:00:11 +0800] rev 37491
hgweb: insert followlines buttons before any children, including text nodes This way the buttons come before any other content, including text nodes. Because highlight extension replaces every line of text with some <span> elements that have CSS classes for highlighting, the placement of followlines buttons used to depend on if that extension was enabled or not. Let's make the placement more consistent, it'll help the next patch in this series.
Wed, 28 Mar 2018 16:28:54 -0700 wireproto: only expose "debugwireargs" to version 1 transports
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 28 Mar 2018 16:28:54 -0700] rev 37490
wireproto: only expose "debugwireargs" to version 1 transports I'm not even sure this command should be enabled for version 1 transports. It is just a reflection endpoint for argument data. We definitely don't need to support it in version 2. Differential Revision: https://phab.mercurial-scm.org/D3184
Wed, 28 Mar 2018 16:14:42 -0700 wireproto: only expose "hello" command to version 1 transports
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 28 Mar 2018 16:14:42 -0700] rev 37489
wireproto: only expose "hello" command to version 1 transports This command is only ever used for the handshake in the SSH protocol. We probably don't even need for it to be a proper command. Let's not carry it forward to version 2 because I don't see a use for it there. Differential Revision: https://phab.mercurial-scm.org/D3183
Wed, 28 Mar 2018 16:10:41 -0700 wireproto: port branchmap to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 28 Mar 2018 16:10:41 -0700] rev 37488
wireproto: port branchmap to wire protocol v2 Differential Revision: https://phab.mercurial-scm.org/D3182
Wed, 28 Mar 2018 16:00:02 -0700 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 28 Mar 2018 16:00:02 -0700] rev 37487
wireproto: port listkeys commands to wire protocol v2 Differential Revision: https://phab.mercurial-scm.org/D3181
Wed, 28 Mar 2018 15:44:47 -0700 wireproto: port keep command to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 28 Mar 2018 15:44:47 -0700] rev 37486
wireproto: port keep command to wire protocol v2 This is pretty straightforward. Differential Revision: https://phab.mercurial-scm.org/D3180
Wed, 28 Mar 2018 14:55:13 -0700 wireproto: port heads command to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 28 Mar 2018 14:55:13 -0700] rev 37485
wireproto: port heads command to wire protocol v2 After much thought and consideration, wire protocol version 2's commands will be defined in different functions from the existing commands. This will make it easier to implement these commands because it won't require shoehorning things like response formatting and argument declaration into the same APIs. For example, wire protocol version 1 requires that commands declare a fixed and ordered list of argument names. It isn't really possible to insert new arguments or have optional arguments without breaking backwards compatibility. Wire protocol version 2, however, uses CBOR maps for passing arguments. So arguments a) can be optional b) can be added without BC c) can be strongly typed. This commit starts our trek towards reimplementing the wire protocol for version 2 with the heads command. It is pretty similar to the existing heads command. One added feature is it can be told to operate on only public phase changesets. This is useful for making discovery faster when a repo has tens of thousands of draft phase heads (such as Mozilla's "try" repository). The HTTPv2 server-side protocol has had its `getargs()` implementation updated to reflect that arguments are a map and not a list. Differential Revision: https://phab.mercurial-scm.org/D3179
Wed, 28 Mar 2018 10:52:40 -0700 largefiles: wrap heads command handler more directly
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 28 Mar 2018 10:52:40 -0700] rev 37484
largefiles: wrap heads command handler more directly extensions.wrapfunction() is a more robust method for wrapping a function, since it allows multiple wrappers. While we're here, wrap the function registered with the command instead of installing a new command handler. Differential Revision: https://phab.mercurial-scm.org/D3178
Wed, 28 Mar 2018 15:09:34 -0700 wireproto: crude support for version 2 HTTP peer
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 28 Mar 2018 15:09:34 -0700] rev 37483
wireproto: crude support for version 2 HTTP peer As part of implementing the server-side bits of the wire protocol command handlers for version 2, we want a way to easily test those commands. Currently, we use the "httprequest" action of `hg debugwireproto`. But this requires explicitly specifying the HTTP request headers, low-level frame details, and the data structure to encode with CBOR. That's a lot of boilerplate and a lot of it can change as the wire protocol evolves. `hg debugwireproto` has a mechanism to issue commands via the peer interface. That is *much* easier to use and we prefer to test with that going forward. This commit implements enough parts of the peer API to send basic requests via the HTTP version 2 transport. The peer code is super hacky. Again, the goal is to facilitate server testing, not robustly implement a client. The client code will receive love at a later time. Differential Revision: https://phab.mercurial-scm.org/D3177
Mon, 26 Mar 2018 15:34:52 -0700 tests: extract wire protocol shell helpers to standalone file
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 26 Mar 2018 15:34:52 -0700] rev 37482
tests: extract wire protocol shell helpers to standalone file This will make it easier for other tests to get up and running without the boilerplate. Differential Revision: https://phab.mercurial-scm.org/D3176
Sun, 08 Apr 2018 09:30:35 -0700 addbranchrevs: no longer accept revset as "revs" (API)
Martin von Zweigbergk <martinvonz@google.com> [Sun, 08 Apr 2018 09:30:35 -0700] rev 37481
addbranchrevs: no longer accept revset as "revs" (API) The only caller was removed in 0b4692b9646d (bundle: avoid repo.lookup() for converting revnum to nodeid, 2018-04-02). Differential Revision: https://phab.mercurial-scm.org/D3192
Sun, 08 Apr 2018 08:53:43 -0700 clone: avoid using repo.lookup() with binary nodeid
Martin von Zweigbergk <martinvonz@google.com> [Sun, 08 Apr 2018 08:53:43 -0700] rev 37480
clone: avoid using repo.lookup() with binary nodeid The code in hg.clone() is a bit of a mess, but it seems like the "checkout" variable is always a binary nodeid (tests pass when run with "assert len(checkout) == 20" before the repo.lookup()). repo.lookup() will soon work only with string inputs, so we need remove this use. Differential Revision: https://phab.mercurial-scm.org/D3191
Sun, 08 Apr 2018 08:41:58 -0700 merge: avoid unnecessary conversion from binary nodeid to binary nodeid
Martin von Zweigbergk <martinvonz@google.com> [Sun, 08 Apr 2018 08:41:58 -0700] rev 37479
merge: avoid unnecessary conversion from binary nodeid to binary nodeid "node" is already a binary nodeid here, so there's no need to convert it. repo.lookup() will soon lose support for binary nodeids as input. Differential Revision: https://phab.mercurial-scm.org/D3190
Sun, 08 Apr 2018 22:56:16 -0400 tests: stabilize test-push-http.t for Windows
Matt Harbison <matt_harbison@yahoo.com> [Sun, 08 Apr 2018 22:56:16 -0400] rev 37478
tests: stabilize test-push-http.t for Windows See 594dd384803c.
Sat, 07 Apr 2018 13:10:20 -0400 tests: add a substitution pattern for HTTP error log dates
Matt Harbison <matt_harbison@yahoo.com> [Sat, 07 Apr 2018 13:10:20 -0400] rev 37477
tests: add a substitution pattern for HTTP error log dates This will make tests with error log content less of a nuisance. I didn't roll it into to $LOGDATE$ because the regex got long and line wrapped. It didn't seem worth the obscurity.
Sun, 08 Apr 2018 11:55:46 +0900 wireproto: convert python literal to object without using unsafe eval()
Yuya Nishihara <yuya@tcha.org> [Sun, 08 Apr 2018 11:55:46 +0900] rev 37476
wireproto: convert python literal to object without using unsafe eval() Follows up cc5a040fe150. At this point, I don't think we need a real eval(). If we want to support a set literal, maybe we can vendor ast.literal_eval(), which is relatively simple function.
Sun, 08 Apr 2018 12:30:59 +0900 tests: quote variable passed to shell test command
Yuya Nishihara <yuya@tcha.org> [Sun, 08 Apr 2018 12:30:59 +0900] rev 37475
tests: quote variable passed to shell test command
Sun, 08 Apr 2018 11:23:55 +0900 py3: system-stringify repr(frame)
Yuya Nishihara <yuya@tcha.org> [Sun, 08 Apr 2018 11:23:55 +0900] rev 37474
py3: system-stringify repr(frame) That's the Py3 requirement.
Sun, 08 Apr 2018 11:21:58 +0900 wireproto: show unknown id and flags in repr(frame)
Yuya Nishihara <yuya@tcha.org> [Sun, 08 Apr 2018 11:21:58 +0900] rev 37473
wireproto: show unknown id and flags in repr(frame) Perhaps we'll want it for debugging.
Sun, 08 Apr 2018 11:14:47 +0900 wireproto: fix repr(frame) to not crash by unknown type id
Yuya Nishihara <yuya@tcha.org> [Sun, 08 Apr 2018 11:14:47 +0900] rev 37472
wireproto: fix repr(frame) to not crash by unknown type id Follows up 5ef2da00e935.
Sun, 08 Apr 2018 15:39:08 +0900 py3: use s.startswith() instead of s[n] while parsing patches
Yuya Nishihara <yuya@tcha.org> [Sun, 08 Apr 2018 15:39:08 +0900] rev 37471
py3: use s.startswith() instead of s[n] while parsing patches I know 'bytes[n] in bytes' magically works, but I'm tired of finding which one breaks the tests.
Sun, 08 Apr 2018 15:32:09 +0900 py3: do not try to byte-stringify None in cmdutil.tryimportone()
Yuya Nishihara <yuya@tcha.org> [Sun, 08 Apr 2018 15:32:09 +0900] rev 37470
py3: do not try to byte-stringify None in cmdutil.tryimportone() It's a debug message, so just use '' instead.
Sun, 08 Apr 2018 15:22:30 +0900 py3: work around weird handling of bytes/unicode in decode_header()
Yuya Nishihara <yuya@tcha.org> [Sun, 08 Apr 2018 15:22:30 +0900] rev 37469
py3: work around weird handling of bytes/unicode in decode_header() Basically decode_header() works as follows, and on Python 3, email headers ARE UNICODE. def decode_header(header): if not ecre.search(header): # ecre is unicode regexp return [(header, None)] # so header is unicode string ... decode header into [(bytes_data, unicode_charset_name)] return collapsed
Sun, 08 Apr 2018 15:03:00 +0900 py3: use system string to access email headers
Yuya Nishihara <yuya@tcha.org> [Sun, 08 Apr 2018 15:03:00 +0900] rev 37468
py3: use system string to access email headers
(0) -30000 -10000 -3000 -1000 -300 -100 -50 -30 +30 +50 +100 +300 +1000 +3000 +10000 tip