Wed, 26 Sep 2018 14:38:43 -0700 exchangev2: recognize narrow patterns when pulling
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 26 Sep 2018 14:38:43 -0700] rev 40327
exchangev2: recognize narrow patterns when pulling pulloperation instances were recently taught to record file include and exclude patterns to facilitate narrow file transfer. Teaching the exchangev2 code to transfer a subset of files is as simple as constructing a narrow matcher from these patterns and filtering all seen file paths through it. Keep in mind that this change only influences file data: we're still fetching all changeset and manifest data. So, there's still a ton of "partial clone" to implement in exchangev2. On a personal note, I derive gratification that this feature requires very few lines of new code to implement. To test this, we implemented a minimal extension which allows us to specify --include/--exclude to clone. While the narrow extension provides these arguments, I explicitly wanted to test this functionality without the narrow extension enabled, as that extension monkeypatches various things and I want to isolate the behavior of core Mercurial. Differential Revision: https://phab.mercurial-scm.org/D5132
Tue, 09 Oct 2018 08:50:13 -0700 sqlitestore: file storage backend using SQLite
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 09 Oct 2018 08:50:13 -0700] rev 40326
sqlitestore: file storage backend using SQLite This commit provides an extension which uses SQLite to store file data (as opposed to revlogs). As the inline documentation describes, there are still several aspects to the extension that are incomplete. But it's a start. The extension does support basic clone, checkout, and commit workflows, which makes it suitable for simple use cases. One notable missing feature is support for "bundlerepos." This is probably responsible for the most test failures when the extension is activated as part of the test suite. All revision data is stored in SQLite. Data is stored as zstd compressed chunks (default if zstd is available), zlib compressed chunks (default if zstd is not available), or raw chunks (if configured or if a compressed delta is not smaller than the raw delta). This makes things very similar to revlogs. Unlike revlogs, the extension doesn't yet enforce a limit on delta chain length. This is an obvious limitation and should be addressed. This is somewhat mitigated by the use of zstd, which is much faster than zlib to decompress. There is a dedicated table for storing deltas. Deltas are stored by the SHA-1 hash of their uncompressed content. The "fileindex" table has columns that reference the delta for each revision and the base delta that delta should be applied against. A recursive SQL query is used to resolve the delta chain along with the delta data. By storing deltas by hash, we are able to de-duplicate delta storage! With revlogs, the same deltas in different revlogs would result in duplicate storage of that delta. In this scheme, inserting the duplicate delta is a no-op and delta chains simply reference the existing delta. When initially implementing this extension, I did not have content-indexed deltas and deltas could be duplicated across files (just like revlogs). When I implemented content-indexed deltas, the size of the SQLite database for a full clone of mozilla-unified dropped: before: 2,554,261,504 bytes after: 2,488,754,176 bytes Surprisingly, this is still larger than the bytes size of revlog files: revlog files: 2,104,861,230 bytes du -b: 2,254,381,614 I would have expected storage to be smaller since we're not limiting delta chain length and since we're using zstd instead of zlib. I suspect the SQLite indexes and per-column overhead account for the bulk of the differences. (Keep in mind that revlog uses a 64-byte packed struct for revision index data and deltas are stored without padding. Aside from the 12 unused bytes in the 32 byte node field, revlogs are pretty efficient.) Another source of overhead is file name storage. With revlogs, file names are stored in the filesystem. But with SQLite, we need to store file names in the database. This is roughly equivalent to the size of the fncache file, which for the mozilla-unified repository is ~34MB. Since the SQLite database isn't append-only and since delta chains can reference any delta, this opens some interesting possibilities. For example, we could store deltas in reverse, such that fulltexts are stored for newer revisions and deltas are applied to reconstruct older revisions. This is likely a more optimal storage strategy for version control, as new data tends to be more frequently accessed than old data. We would obviously need wire protocol support for transferring revision data from newest to oldest. And we would probably need some kind of mechanism for "re-encoding" stores. But it should be doable. This extension is very much experimental quality. There are a handful of features that don't work. It probably isn't suitable for day-to-day use. But it could be used in limited cases (e.g. read-only checkouts like in CI). And it is also a good proving ground for alternate storage backends. As we continue to define interfaces for all things storage, it will be useful to have a viable alternate storage backend to see how things shake out in practice. test-storage.py passes on Python 2 and introduces no new test failures on Python 3. Having the storage-level unit tests has proved to be insanely useful when developing this extension. Those tests caught numerous bugs during development and I'm convinced this style of testing is the way forward for ensuring alternate storage backends work as intended. Of course, test coverage isn't close to what it needs to be. But it is a start. And what coverage we have gives me confidence that basic store functionality is implemented properly. Differential Revision: https://phab.mercurial-scm.org/D4928
Tue, 16 Oct 2018 15:36:19 +0200 storageutil: extract most of peek_censored from revlog
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 16 Oct 2018 15:36:19 +0200] rev 40325
storageutil: extract most of peek_censored from revlog This function is super hacky and isn't correct 100% of the time. I'm going to need this functionality on a future non-revlog store. Let's copy things to storageutil so this code only exists once. Differential Revision: https://phab.mercurial-scm.org/D5118
Thu, 20 Sep 2018 17:27:01 -0700 lfs: autoload the extension when cloning from repo with lfs enabled
Matt Harbison <matt_harbison@yahoo.com> [Thu, 20 Sep 2018 17:27:01 -0700] rev 40324
lfs: autoload the extension when cloning from repo with lfs enabled This is based on a patch by Gregory Szorc. I made small adjustments to clean up the messaging when the server has the extension enabled, but the client has it disabled (to prevent autoloading). Additionally, I added a second server capability to distinguish between the server having the extension enabled, and the server having LFS commits. This helps prevent unnecessary requirement propagation- the client shouldn't add a requirement that the server doesn't have, just because the server had the extension loaded. The TODO I had about advertising a capability when the server can natively serve up blobs isn't relevant anymore (we've had 2 releases that support this), so I dropped it. Currently, we lazily add the "lfs" requirement to a repo when we first encounter LFS data. Due to a pretxnchangegroup hook that looks for LFS data, this can happen at the end of clone. Now that we have more control over how repositories are created, we can do better. This commit adds a repo creation option to add the "lfs" requirement. hg.clone() sets this creation option if the remote peer is advertising lfs usage (as opposed to just support needed to push). So, what this change effectively does is have cloned repos automatically inherit the "lfs" requirement. Differential Revision: https://phab.mercurial-scm.org/D5130
Tue, 16 Oct 2018 16:24:46 +0200 testing: switch to inserting deltas
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 16 Oct 2018 16:24:46 +0200] rev 40323
testing: switch to inserting deltas As the comment in the test specifies, this was relying on storage backend implementation details. We switch to inserting a raw delta, skipping the regular insert path to ensure we have the desired outcome. This required implementing support for handling deltas in the revlog testing code. Differential Revision: https://phab.mercurial-scm.org/D5116
Tue, 16 Oct 2018 15:24:06 +0200 testing: remove expectation of error on bad node insert
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 16 Oct 2018 15:24:06 +0200] rev 40322
testing: remove expectation of error on bad node insert addgroup() doesn't necessarily validate the hashes of each incoming revision. This is an optimization that allows delta group application to complete faster. The fact that revlog raises in this particular test is an implementation detail due to the way revlogs are testing multiple deltas. Differential Revision: https://phab.mercurial-scm.org/D5115
Tue, 16 Oct 2018 17:45:39 +0200 storageutil: convert fileid to bytes to avoid cast to %s
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 16 Oct 2018 17:45:39 +0200] rev 40321
storageutil: convert fileid to bytes to avoid cast to %s test-storage.py manages to trigger this on Python 3. Differential Revision: https://phab.mercurial-scm.org/D5117
Tue, 16 Oct 2018 17:48:28 +0200 tests: use byte literals in test-storage.py
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 16 Oct 2018 17:48:28 +0200] rev 40320
tests: use byte literals in test-storage.py This fixes a Python 3 breakage due to unknown key due to str/bytes type mismatch. # skip-blame just b'' literals Differential Revision: https://phab.mercurial-scm.org/D5114
Tue, 16 Oct 2018 07:19:38 +0200 py3: byte-stringify literals in test-keyword.t
Yuya Nishihara <yuya@tcha.org> [Tue, 16 Oct 2018 07:19:38 +0200] rev 40319
py3: byte-stringify literals in test-keyword.t # skip-blame just some b'' prefixes
Tue, 16 Oct 2018 07:18:30 +0200 py3: flush std streams before/after running user code in heredoctest.py
Yuya Nishihara <yuya@tcha.org> [Tue, 16 Oct 2018 07:18:30 +0200] rev 40318
py3: flush std streams before/after running user code in heredoctest.py Otherwise, things written to stdout.buffer would be interleaved.
Tue, 16 Oct 2018 08:06:17 +0200 py3: rewrite StringIO fallback for Python 3
Yuya Nishihara <yuya@tcha.org> [Tue, 16 Oct 2018 08:06:17 +0200] rev 40317
py3: rewrite StringIO fallback for Python 3
Tue, 16 Oct 2018 07:04:07 +0200 py3: reinvent print() function for contrib/hgclient.py
Yuya Nishihara <yuya@tcha.org> [Tue, 16 Oct 2018 07:04:07 +0200] rev 40316
py3: reinvent print() function for contrib/hgclient.py
Tue, 16 Oct 2018 07:08:12 +0200 py3: work around unicode stdio streams in contrib/hgclient.py
Yuya Nishihara <yuya@tcha.org> [Tue, 16 Oct 2018 07:08:12 +0200] rev 40315
py3: work around unicode stdio streams in contrib/hgclient.py
Tue, 16 Oct 2018 07:00:41 +0200 py3: convert string literals to bytes in contrib/hgclient.py
Yuya Nishihara <yuya@tcha.org> [Tue, 16 Oct 2018 07:00:41 +0200] rev 40314
py3: convert string literals to bytes in contrib/hgclient.py # skip-blame just many b'' prefixes
Tue, 16 Oct 2018 08:16:11 -0400 merge with stable
Augie Fackler <augie@google.com> [Tue, 16 Oct 2018 08:16:11 -0400] rev 40313
merge with stable
Fri, 31 Aug 2018 19:58:41 +0100 branchmap: remove redundant sort
Martijn Pieters <mj@octobus.net> [Fri, 31 Aug 2018 19:58:41 +0100] rev 40312
branchmap: remove redundant sort There is absoluty no benefit in sorting a list that's being merged into a set on the next line. The changelog.ancestors() call later on also doesn't benefit from a sorted sequence of revs. Differential Revision: https://phab.mercurial-scm.org/D5111
Thu, 11 Oct 2018 03:15:04 +0200 revset: drop special case of 'revset(...)' function in analyze
Boris Feld <boris.feld@octobus.net> [Thu, 11 Oct 2018 03:15:04 +0200] rev 40311
revset: drop special case of 'revset(...)' function in analyze We now have a valid no-op function. We no longer need the special case.
Thu, 11 Oct 2018 03:13:53 +0200 revset: document the `revset(...)` syntax
Boris Feld <boris.feld@octobus.net> [Thu, 11 Oct 2018 03:13:53 +0200] rev 40310
revset: document the `revset(...)` syntax We introduce a new "no-op" function to bear the documentation. In practice, the parsing step is skipping it so it is not even called. This will get fixed in the next changeset.
Tue, 16 Oct 2018 12:39:21 +0200 check-commit: update test expectation per removal of "double empty line" rule
Yuya Nishihara <yuya@tcha.org> [Tue, 16 Oct 2018 12:39:21 +0200] rev 40309
check-commit: update test expectation per removal of "double empty line" rule Follow up for 47084b5ffd80.
Sun, 14 Oct 2018 15:40:16 +0200 style: drop requirement to only use single lines between top-level objects
Martijn Pieters <mj@octobus.net> [Sun, 14 Oct 2018 15:40:16 +0200] rev 40308
style: drop requirement to only use single lines between top-level objects Differential Revision: https://phab.mercurial-scm.org/D5105
Sun, 14 Oct 2018 13:05:53 -0400 py3: byteify extension in test-relink.t
Matt Harbison <matt_harbison@yahoo.com> [Sun, 14 Oct 2018 13:05:53 -0400] rev 40307
py3: byteify extension in test-relink.t
Sat, 13 Oct 2018 04:20:22 -0400 f: fix a Python 3 bytes/string issue
Augie Fackler <augie@google.com> [Sat, 13 Oct 2018 04:20:22 -0400] rev 40306
f: fix a Python 3 bytes/string issue I suspect we should test this tool in isolation, but we don't yet. Oh well. Differential Revision: https://phab.mercurial-scm.org/D5061
Sun, 14 Oct 2018 08:55:30 -0400 tests: use regex instead of Python versions for archive hash changes
Augie Fackler <augie@google.com> [Sun, 14 Oct 2018 08:55:30 -0400] rev 40305
tests: use regex instead of Python versions for archive hash changes It turns out this behavior changed between versions of Python 3. Let's just always accept either size or sha1, and move on. Differential Revision: https://phab.mercurial-scm.org/D5104
Sun, 14 Oct 2018 05:29:00 -0400 notify: a ton of encoding dancing to deal with the email module
Augie Fackler <augie@google.com> [Sun, 14 Oct 2018 05:29:00 -0400] rev 40304
notify: a ton of encoding dancing to deal with the email module Almost fixes test-keyword.t on Python 3, but leaves us with some extremely confusing failures at the end of the test that seem related to the command server? Differential Revision: https://phab.mercurial-scm.org/D5100
Sun, 14 Oct 2018 11:06:21 -0400 tests: add missing b prefix in test-context-metadata.t
Augie Fackler <augie@google.com> [Sun, 14 Oct 2018 11:06:21 -0400] rev 40303
tests: add missing b prefix in test-context-metadata.t # skip-blame just a b prefix Differential Revision: https://phab.mercurial-scm.org/D5109
Sun, 14 Oct 2018 11:05:41 -0400 context: raise runtime errors with sysstrs
Augie Fackler <augie@google.com> [Sun, 14 Oct 2018 11:05:41 -0400] rev 40302
context: raise runtime errors with sysstrs We should probably *not* use RuntimeError for this, but let's deal with that later, rather than as part of the Python 3 effort. Differential Revision: https://phab.mercurial-scm.org/D5108
Mon, 15 Oct 2018 11:16:12 +0200 rust: rustfmt config for hg-direct-ffi
Georges Racinet <gracinet@anybox.fr> [Mon, 15 Oct 2018 11:16:12 +0200] rev 40301
rust: rustfmt config for hg-direct-ffi For now, we're duplicating it, but it would be probably a good idea to use a single one for the whole workspace (would have implications on the other crates as well)
Mon, 08 Oct 2018 19:11:41 +0200 rust: rustlazyancestors.__contains__
Georges Racinet <gracinet@anybox.fr> [Mon, 08 Oct 2018 19:11:41 +0200] rev 40300
rust: rustlazyancestors.__contains__ This changeset provides a Rust implementation of the iteration performed by lazyancestor.__contains__ It has the advantage over the Python iteration to use the 'seen' set encapsuled into the dedicated iterator (self._containsiter), rather than storing emitted items in another set (self._containsseen), and hence should reduce the memory footprint. Also, there's no need to convert intermediate emitted revisions back into Python integers. At this point, it would be tempting to implement the whole lazyancestor object in Rust, but that would lead to more C wrapping code (two objects) for little expected benefits.
Sun, 14 Oct 2018 01:39:22 -0400 help: fix a missing quote character in ui.tweakdefaults
Matt Harbison <matt_harbison@yahoo.com> [Sun, 14 Oct 2018 01:39:22 -0400] rev 40299
help: fix a missing quote character in ui.tweakdefaults
Thu, 27 Sep 2018 16:55:44 +0200 rust: hooking into Python code
Georges Racinet <gracinet@anybox.fr> [Thu, 27 Sep 2018 16:55:44 +0200] rev 40298
rust: hooking into Python code We introduce a new class called 'rustlazyancestors' in the ancestors module, which is used only if parsers.rustlazyancestors does exist. The implementation of __contains__ stays unchanged, but is now backed by the Rust iterator. It would probably be a good candidate for further development, though, as it is mostly looping, and duplicates the 'seen' set. The Rust code could be further optimized, however it already gives rise to performance improvements: median timing from hg perfancestors: - on pypy: before: 0.077566s after: 0.016676s -79% - on mozilla central: before: 0.190037s after: 0.082225s -58% - on a private repository (about one million revisions): before: 0.567085s after: 0.108816s -80% - on another private repository (about 400 000 revisions): before: 1.440918s after: 0.290116s -80% median timing for hg perfbranchmap base - on pypy: before: 1.383413s after: 0.507993s -63% - on mozilla central: before: 2.821940s after: 1.258902s -55% - on a private repository (about one million revisions): before: 77.065076s after: 16.158475s -80% - on another private repository (about 401 000 revisions): before: 7.835503s after: 3.545331s -54%
(0) -30000 -10000 -3000 -1000 -300 -100 -50 -30 +30 +50 +100 +300 +1000 +3000 +10000 tip