Mon, 20 Aug 2018 23:08:57 +0000 debugcommands: use openstorage() in debugdata (BC)
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 20 Aug 2018 23:08:57 +0000] rev 39281
debugcommands: use openstorage() in debugdata (BC) Nothing we're doing here requires a revlog. So use openstorage(). .. bc:: `hg debugdata` no longer accepts the path to a revlog file. Differential Revision: https://phab.mercurial-scm.org/D4357
Mon, 20 Aug 2018 23:06:47 +0000 tests: use inline Python for revlog test
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 20 Aug 2018 23:06:47 +0000] rev 39280
tests: use inline Python for revlog test `hg debugdata` will soon stop accepting the raw path to a revlog file. Adjust a test accordingly. The changed test is for a security bug. So this should be reviewed with scrutiny. Differential Revision: https://phab.mercurial-scm.org/D4356
Mon, 20 Aug 2018 21:01:05 +0000 debugcommands: use openstorage() in debugindexdot
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 20 Aug 2018 21:01:05 +0000] rev 39279
debugcommands: use openstorage() in debugindexdot And add test coverage for changelog and manifests. Differential Revision: https://phab.mercurial-scm.org/D4355
Tue, 14 Aug 2018 16:28:21 +0000 cmdutil: return a revlog from openrevlog() and split function
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 14 Aug 2018 16:28:21 +0000] rev 39278
cmdutil: return a revlog from openrevlog() and split function The filelog class is a wrapper around a revlog instance. I have plans to give manifests and the changelog a similar treatment. When filelog was ported away from revlog and when I started writing patches to do the same for manifests, I noticed that a lot of debug* and perf* commands were relying on low-level revlog APIs like start(), end(), deltaparent(), etc. For filelog, I added these to the interface, even though I didn't want to because they don't belong on a generic storage interface. For manifest (and eventually changelog), the pain is too much to bear. We need to cut the tight coupling. These debug* and perf* commands use cmdutil.openrevlog() to obtain a revlog instance. This commit effectively renames openrevlog() to openstorage(), adds an argument to ensure a revlog instance is returned, and introduces a replacement openrevlog() that calls openstorage() such that a revlog instance is returned. By doing things this way, we allow the debug* and perf* commands to still work on revlog-based repositories without having to expose low-level revlog APIs in the storage interfaces. The practical side-effect of this on the current code base is we return a revlog instance instead of a filelog. The manifest and changelog are not affected at this time. Some of filelog's storage APIs are different from revlog. For example, read() strips the optional header containing copy/rename metadata. This may impact some perf* commands. But I don't think the impact is worth worrying about. Upcoming commits will port existing consumers to openstorage(), where appropriate. This commit does cause some test regressions when using the simple store. These will be fixed as commands are ported to use storage APIs. .. api:: cmdutil.openrevlog() now returns a revlog instance or aborts Previously, it would return a storage object, which may not be a revlog instance. Use the new cmdutil.openstorage() API to return an object conforming to the storage interface of the thing you are accessing if you don't need a revlog instance. Differential Revision: https://phab.mercurial-scm.org/D4354
Mon, 20 Aug 2018 13:29:48 -0400 merge: improve interactive one-changed one-deleted message (issue5550)
Augie Fackler <augie@google.com> [Mon, 20 Aug 2018 13:29:48 -0400] rev 39277
merge: improve interactive one-changed one-deleted message (issue5550) I like the wording from the bug, so I figured I'd package it up in a change and see what people think. Differential Revision: https://phab.mercurial-scm.org/D4336
Thu, 16 Aug 2018 17:19:27 +0200 bookmark: add an --active flag to display the active bookmark
Boris Feld <boris.feld@octobus.net> [Thu, 16 Aug 2018 17:19:27 +0200] rev 39276
bookmark: add an --active flag to display the active bookmark There is currently no official simple way to retrieve the current bookmark. In particular for automation. We add a `--active` flag to the `hg bookmarks` command. When set, the command display the current bookmark name if any or return 1. For now, this flag is read-only. However sensible combinations exist with `--delete`, `--rename` and `--rev` and can be implemented later.
Thu, 23 Aug 2018 01:48:39 +0200 phase: use `_phase` revset instead of string interpolation
Boris Feld <boris.feld@octobus.net> [Thu, 23 Aug 2018 01:48:39 +0200] rev 39275
phase: use `_phase` revset instead of string interpolation The previous code was hackyer and assume all phases had an associated revset. The later might no longer be true once we introduce more internal phase.
Thu, 23 Aug 2018 01:48:26 +0200 phase: expose a `_phase(idx)` revset
Boris Feld <boris.feld@octobus.net> [Thu, 23 Aug 2018 01:48:26 +0200] rev 39274
phase: expose a `_phase(idx)` revset Internally phase related revset are calling the `_phase` function. We expose it as an internal revset. This is useful to refer to phase in revset doing debatable things around the phase name.
Thu, 23 Aug 2018 01:15:19 +0200 phase: handle phase with no command flag
Boris Feld <boris.feld@octobus.net> [Thu, 23 Aug 2018 01:15:19 +0200] rev 39273
phase: handle phase with no command flag Before this changeset, all existing phases have a corresponding flag on the `hg phase` command. (eg: `hg phase --draft`). After this changeset, a phase can exists without having an associated flag. This is useful to introduce a new internal phase that we do not want to expose to user.
Tue, 05 Jun 2018 20:47:52 +0200 phase: explicitly exclude secret phase and above
Boris Feld <boris.feld@octobus.net> [Tue, 05 Jun 2018 20:47:52 +0200] rev 39272
phase: explicitly exclude secret phase and above The comment explicitly mention the secret phase so we should as well use that in the code.
Tue, 05 Jun 2018 18:16:07 +0200 phase: use `trackedphases` in `_getphaserevsnative`
Boris Feld <boris.feld@octobus.net> [Tue, 05 Jun 2018 18:16:07 +0200] rev 39271
phase: use `trackedphases` in `_getphaserevsnative` Instead of manually listing secret and draft, simply use the `trackedphases` constant. The constant is already used by `_getphaserevsnative`.
Fri, 24 Aug 2018 17:45:46 -0400 lfs: add a progress bar when searching for blobs to upload
Matt Harbison <matt_harbison@yahoo.com> [Fri, 24 Aug 2018 17:45:46 -0400] rev 39270
lfs: add a progress bar when searching for blobs to upload The search itself can take an extreme amount of time if there are a lot of revisions involved. I've got a local repo that took 6 minutes to push 1850 commits, and 60% of that time was spent here (there are ~70K files): \ 58.1% wrapper.py: extractpointers line 297: pointers = extractpointers(... | 57.7% wrapper.py: pointersfromctx line 352: for p in pointersfromctx(ct... | 57.4% wrapper.py: pointerfromctx line 397: p = pointerfromctx(ctx, f, ... \ 38.7% context.py: __contains__ line 368: if f not in ctx: | 38.7% util.py: __get__ line 82: return key in self._manifest | 38.7% context.py: _manifest line 1416: result = self.func(obj) | 38.7% manifest.py: read line 472: return self._manifestctx.re... \ 25.6% revlog.py: revision line 1562: text = rl.revision(self._node) \ 12.8% revlog.py: _chunks line 2217: bins = self._chunks(chain, ... | 12.0% revlog.py: decompressline 2112: ladd(decomp(buffer(data, ch... \ 7.8% revlog.py: checkhash line 2232: self.checkhash(text, node, ... | 7.8% revlog.py: hash line 2315: if node != self.hash(text, ... | 7.8% revlog.py: hash line 2242: return hash(text, p1, p2) \ 12.0% manifest.py: __init__ line 1565: self._data = manifestdict(t... \ 16.8% context.py: filenode line 378: if not _islfs(fctx.filelog(... | 15.7% util.py: __get__ line 706: return self._filelog | 14.8% context.py: _filelog line 1416: result = self.func(obj) | 14.8% localrepo.py: file line 629: return self._repo.file(self... | 14.8% filelog.py: __init__ line 1134: return filelog.filelog(self... | 14.5% revlog.py: __init__ line 24: censorable=True)
Wed, 22 Aug 2018 14:37:56 +0900 i18n: merge i18n comments of translatable texts correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Wed, 22 Aug 2018 14:37:56 +0900] rev 39269
i18n: merge i18n comments of translatable texts correctly Before this patch, i18n comments of translatable texts are lost at creation of hg.pot file, if: - same translatable text appears multiple times, - the 1st appearance does not have i18n comment, and - any of rest has it For example, previous patch for filemerge.py adds translatable texts with i18n comments, but these comments are lost, because: - automatically added texts in docstring of internal merge tools are picked up earlier than these translatable texts, because of location in filemerge.py - but docstring has no i18n comment This patch makes addentry() of posplit merge i18n comments of later translatable texts, in order to keep them at creation of hg.pot.
Wed, 22 Aug 2018 14:22:59 +0900 help: revise explanation about capability check while selecting merge tool
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Wed, 22 Aug 2018 14:22:59 +0900] rev 39268
help: revise explanation about capability check while selecting merge tool This is follow up of 7c6044634957 and cded904f7acc. This patch adds explanations about: - notation in capability columns in the table - how capabilities of external merge tools are treated
Wed, 22 Aug 2018 14:08:27 +0900 filemerge: avoid putting translated text into docstring
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Wed, 22 Aug 2018 14:08:27 +0900] rev 39267
filemerge: avoid putting translated text into docstring This is follow up of my mistake in e09fad982ef5. There is no merge tool, which has only one of binary or symlink capabilities, but this patch lists up all combinations of them for safety in the future. Maybe, it is too paranoid, though.
Wed, 22 Aug 2018 13:57:01 +0900 filemerge: make capability check for internal tools ignore merge-tools section
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Wed, 22 Aug 2018 13:57:01 +0900] rev 39266
filemerge: make capability check for internal tools ignore merge-tools section This is follow up of 4d7b11877dd0. Before this patch, capability check of internal merge tools falls back to _toolbool(), which examines configurations in "merge-tools" section. But "hg help config" explicitly says that "merge-tools" section configures external merge tools. Therefore, this patch makes capability check for internal tools in hascapability() always ignore configurations in merge-tools section. In this patch, command line configurations below are added at tests in tests/test-merge-tools.t, in order to confirm that explicit configuration is intentionally ignored at tool selection. --config merge-tools.:INTERNAL_TOOL.CAPABILITY=true
Fri, 24 Aug 2018 22:21:04 -0700 merge with stable
Martin von Zweigbergk <martinvonz@google.com> [Fri, 24 Aug 2018 22:21:04 -0700] rev 39265
merge with stable
Fri, 24 Aug 2018 18:21:55 -0700 scmutil: avoid quadratic membership testing (issue5969) stable
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 24 Aug 2018 18:21:55 -0700] rev 39264
scmutil: avoid quadratic membership testing (issue5969) tr.changes['revs'] is an xrange, which has an O(n) __contains__ implementation. The `rev not in newrevs` lookup a few lines below will therefore be O(n^2) if all incoming changesets are public. This issue isn't present on @ because 45e05d39d9ce introduced a custom type implementing an xrange primitive with O(1) contains and switched tr.changes['revs'] to be an instance of that type. We work around the problem on the stable branch by casting the xrange to a set. This is a bit hacky because it requires allocating memory to hold each integer in the range. But we are already holding the full set of pulled revision numbers in memory multiple times (such as in `tr.changes['phases']`). So this is a relatively minor problem. This issue has been present since the phases reporting code was introduced in the 4.7 cycle by eb9835014d20. This change should be reverted/ignored when stable is merged into default. On the mozilla-unified repository with 483492 changesets, `hg clone` time improves substantially: before: 1843.700s user; 29.810s sys after: 461.170s user; 29.360s sys
Wed, 15 Aug 2018 14:41:27 -0700 copies: correctly skip directories that have already been considered
Kyle Lippincott <spectral@google.com> [Wed, 15 Aug 2018 14:41:27 -0700] rev 39263
copies: correctly skip directories that have already been considered Previously, `if dsrc in invalid` would never be true, since we added `dsrc +"/"` to invalid, not `dsrc` itself. Since it's much more common for individual files (not whole directories) to be moved, it seemed cleaner to delay appending the "/" until we know we have some directory moves to actually consider. I haven't benchmarked this, but I imagine this is a mild performance win. Differential Revision: https://phab.mercurial-scm.org/D4284
Fri, 24 Aug 2018 12:55:05 -0700 merge with stable
Martin von Zweigbergk <martinvonz@google.com> [Fri, 24 Aug 2018 12:55:05 -0700] rev 39262
merge with stable
Fri, 24 Aug 2018 10:19:31 -0700 match: make exactmatcher.visitchildrenset return file children as well
Kyle Lippincott <spectral@google.com> [Fri, 24 Aug 2018 10:19:31 -0700] rev 39261
match: make exactmatcher.visitchildrenset return file children as well Previously, if we had an exactmatcher like ['foo.txt', 'a/bar.txt', 'a/b/c/baz.txt'], we'd get back the following data: '.': {'a'} 'a': {'b'} 'a/b': {'c'} 'a/b/c': 'this' 'a/b/c/d': set() This was incorrect, since visitchildrenset explicitly says not to pay attention to 'foo.txt' and 'a/bar.txt' by not returning them or 'this'. Given the near impossibility of making visitchildrenset reliabbly produce only subdirectories, a previous commit has made it documented and expected that visitchildrenset can return a set containing both files and subdirectories to visit, instead of implying/requiring that visitchildrenset() return 'this' if there are files to visit. This makes the code for exactmatcher match this clarified documentation. Differential Revision: https://phab.mercurial-scm.org/D4365
Thu, 23 Aug 2018 18:04:15 -0700 match: document that visitchildrenset might return files
Kyle Lippincott <spectral@google.com> [Thu, 23 Aug 2018 18:04:15 -0700] rev 39260
match: document that visitchildrenset might return files At least when using includematcher, and probably most matchers, we do not know if a/b/f refers to a file 'f' in a/b, or a subdirectory 'f' in a/b, so most matchers will return {'f'} for visitchildrenset('a/b'). Arguably, all matchers could/should - for exactmatcher, we know that 'f' is a file, but there's no reason to return 'this' for visitchildrenset('a/b') causing code to investigate 'a/b/x', for example. Differential Revision: https://phab.mercurial-scm.org/D4364
Fri, 24 Aug 2018 10:13:27 -0700 util: make timedcm require the label (API)
Augie Fackler <augie@google.com> [Fri, 24 Aug 2018 10:13:27 -0700] rev 39259
util: make timedcm require the label (API) Differential Revision: https://phab.mercurial-scm.org/D4350
Tue, 21 Aug 2018 17:15:51 -0400 cleanup: make all uses of timedcm specify what they're timing
Augie Fackler <augie@google.com> [Tue, 21 Aug 2018 17:15:51 -0400] rev 39258
cleanup: make all uses of timedcm specify what they're timing It's not used in the timing itself, but it's valuable for the trace events we emit. Differential Revision: https://phab.mercurial-scm.org/D4349
Tue, 21 Aug 2018 17:13:35 -0400 util: make timedcm context manager also emit trace events
Augie Fackler <augie@google.com> [Tue, 21 Aug 2018 17:13:35 -0400] rev 39257
util: make timedcm context manager also emit trace events Differential Revision: https://phab.mercurial-scm.org/D4348
Tue, 21 Aug 2018 15:27:30 -0400 demandimport: instrument python 2 code with trace events
Augie Fackler <augie@google.com> [Tue, 21 Aug 2018 15:27:30 -0400] rev 39256
demandimport: instrument python 2 code with trace events This causes the evaluation of an import in Python 3 to emit some trace data. There's some interesting wrinkles in here, like the fact that before we even hit dispatch we've demand-imported `sys` several times, despite the fact that `sys` was already fully loaded as one of the first few statements in the `hg` script. I don't think that's actually costing us a ton of performance, but it's probably something we should investigate fixing some day. Differential Revision: https://phab.mercurial-scm.org/D4347
Tue, 21 Aug 2018 15:25:07 -0400 dispatch: have dispatch.dispatch and dispatch._runcatch emit trace events
Augie Fackler <augie@google.com> [Tue, 21 Aug 2018 15:25:07 -0400] rev 39255
dispatch: have dispatch.dispatch and dispatch._runcatch emit trace events Differential Revision: https://phab.mercurial-scm.org/D4345
Tue, 21 Aug 2018 15:24:20 -0400 tracing: new module to make tracing events in hg easier
Augie Fackler <augie@google.com> [Tue, 21 Aug 2018 15:24:20 -0400] rev 39254
tracing: new module to make tracing events in hg easier This lives in hgdemandimport because I want to instrument a bunch of low-level stuff including the bare `hg` script and demandimport, so it can't live at a higher layer. Differential Revision: https://phab.mercurial-scm.org/D4344
Tue, 21 Aug 2018 15:23:01 -0400 tests: add support for emitting trace events to run-tests
Augie Fackler <augie@google.com> [Tue, 21 Aug 2018 15:23:01 -0400] rev 39253
tests: add support for emitting trace events to run-tests Right now this is pretty basic, but it's a start. Differential Revision: https://phab.mercurial-scm.org/D4343
Tue, 21 Aug 2018 15:01:09 -0400 contrib: new script to read events from a named pipe and emit catapult traces
Augie Fackler <augie@google.com> [Tue, 21 Aug 2018 15:01:09 -0400] rev 39252
contrib: new script to read events from a named pipe and emit catapult traces I'm starting to get more serious about getting some insight into where we're spending our time, both in hg itself but also in the test suite. As a first pass, I'm going to try and produce catapult traces[0] that can be viewed with Chrome's `about:tracing` tool. 0: https://docs.google.com/document/d/1CvAClvFfyA5R-PhYUmn5OOQtYMH4h6I0nSsKchNAySU/edit#heading=h.nso4gcezn7n1 Differential Revision: https://phab.mercurial-scm.org/D4342
Tue, 21 Aug 2018 22:49:08 -0400 fastannotate: pconvert paths from the server for Windows
Matt Harbison <matt_harbison@yahoo.com> [Tue, 21 Aug 2018 22:49:08 -0400] rev 39251
fastannotate: pconvert paths from the server for Windows I'm guessing that the right thing to do here is to convert the paths on the server, but I know this is a WIP, and I don't know where that needs to happen. I'm just trying to eliminate the malicious path warnings in the tests.
Tue, 21 Aug 2018 22:34:32 -0400 test-fastannotate: close fd before unlinking to keep Windows happy
Matt Harbison <matt_harbison@yahoo.com> [Tue, 21 Aug 2018 22:34:32 -0400] rev 39250
test-fastannotate: close fd before unlinking to keep Windows happy
Tue, 21 Aug 2018 21:43:44 -0400 test-fastannotate: fix trivial output differences on Windows
Matt Harbison <matt_harbison@yahoo.com> [Tue, 21 Aug 2018 21:43:44 -0400] rev 39249
test-fastannotate: fix trivial output differences on Windows
Tue, 21 Aug 2018 21:29:10 -0400 fastannotate: make the default value for `fastannotate.useflock` dynamic
Matt Harbison <matt_harbison@yahoo.com> [Tue, 21 Aug 2018 21:29:10 -0400] rev 39248
fastannotate: make the default value for `fastannotate.useflock` dynamic fcntl.flock isn't available on Windows.
Wed, 08 Aug 2018 13:56:53 +0300 narrow: add a --narrowspec flag to clone command
Pulkit Goyal <pulkit@yandex-team.ru> [Wed, 08 Aug 2018 13:56:53 +0300] rev 39247
narrow: add a --narrowspec flag to clone command This patch adds a --narrowspec flag to `hg clone` command in narrow extension which can be used to read a file and parse narrowspecs from it and use it while cloning a repository. The --narrowspec flag assumes that the user wanted to narrow the clone. Tests are added both for ellipsis and non-ellipsis mode. Differential Revision: https://phab.mercurial-scm.org/D4156
Fri, 10 Aug 2018 16:01:19 -0700 manifest: use rev() instead of nodemap.__contains__
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 10 Aug 2018 16:01:19 -0700] rev 39246
manifest: use rev() instead of nodemap.__contains__ nodemap is an implementation detail of revlogs and isn't appropriate to expose on the manifest storage API. While revlogs don't have a __contains__, they do have lookup() for resolving a value to a node. And this calls rev(), whose API is documented to raise LookupError if a node doesn't exist. And the parameters to LookupError are identical to what was being raised here. So this change should be backwards compatible. Differential Revision: https://phab.mercurial-scm.org/D4279
Fri, 10 Aug 2018 15:06:41 -0700 manifest: rename manifestlog._treeinmem to ._treemanifests
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 10 Aug 2018 15:06:41 -0700] rev 39245
manifest: rename manifestlog._treeinmem to ._treemanifests Not sure what "inmem" was supposed to indicate. This object is an interface to manifest data on disk as well as "in memory" (assuming that's what "inmem" means). Differential Revision: https://phab.mercurial-scm.org/D4278
Fri, 10 Aug 2018 15:01:06 -0700 manifest: add getstorage() to manifestlog and use it globally
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 10 Aug 2018 15:01:06 -0700] rev 39244
manifest: add getstorage() to manifestlog and use it globally It is a common pattern to obtain a directory manifest storage instance (a manifestrevlog) by going through manifestlog._revlog.dirlog(). Why access to storage and caching of other manifests is done through manifestrevlog instead of manifestlog, I don't know. This commit establishes a getstorage(tree) API on manifestlog and imanifestlog that provides a public API for accessing manifest storage. All consumers previously using private attributes have been updated to use this new method. .. api:: manifestlog now has a getstorage(tree) method It should be used for obtaining an object representing the manifest's storage implementation. Accessing manifestlog._revlog should be avoided. Differential Revision: https://phab.mercurial-scm.org/D4277
Fri, 10 Aug 2018 14:44:50 -0700 manifest: rename dir argument and attribute to tree
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 10 Aug 2018 14:44:50 -0700] rev 39243
manifest: rename dir argument and attribute to tree dir shadows a built-in. We use it throughout the manifest code, which is unfortunate. This commit updates just manifestrevlog to be more well behaved. .. api:: renamed manifest.manifestrevlog.__init__ dir argument to tree Differential Revision: https://phab.mercurial-scm.org/D4276
Fri, 10 Aug 2018 14:40:02 -0700 manifest: set appropriate cache entry when clearing _dirlogcache()
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 10 Aug 2018 14:40:02 -0700] rev 39242
manifest: set appropriate cache entry when clearing _dirlogcache() manifestrevlog applies to any manifest, not just the root manifest. Resetting the cache and populating its root entry with self is not correct when the instance does not refer to the root manifest. This has no test fallout. So I'm guessing we only ever call clearcaches() on the root manifest. Or we have no test coverage that are impacted by a bad cache on a non-root manifestrevlog. Differential Revision: https://phab.mercurial-scm.org/D4275
Fri, 10 Aug 2018 14:20:47 -0700 manifest: remove addgroup() from manifestlog and imanifestlog
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 10 Aug 2018 14:20:47 -0700] rev 39241
manifest: remove addgroup() from manifestlog and imanifestlog addgroup() is part of the storage interface for manifests. Unfortunately, we don't yet have a formal storage interface for manifests. (One will be established in subsequent commits.) One thing is for sure, addgroup() doesn't belong on imanifestlog - at least not unless we extend that interface to encompass storage. For now, let's access addgroup() on the _revlog attribute, just like we do for tree manifests. Even though this violates visibility, it is consistent. Differential Revision: https://phab.mercurial-scm.org/D4274
Fri, 10 Aug 2018 13:59:27 -0700 repository: clarify role of imanifestlog
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 10 Aug 2018 13:59:27 -0700] rev 39240
repository: clarify role of imanifestlog Looking at the implementation of manifest.manifestlog, it is highly tailored towards servicing the root manifest. So clarify that in the interface docstring. Differential Revision: https://phab.mercurial-scm.org/D4273
Fri, 10 Aug 2018 13:43:26 -0700 changegroup: change topics during generation
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 10 Aug 2018 13:43:26 -0700] rev 39239
changegroup: change topics during generation Changegroup generation and consumption currently uses different sets of topics. Generation uses "bundling" and consumption uses the name of the thing being consumed. This commit makes the topic and unit names consistent on both ends. The reason I chose to change the generation side is because when "bundling" is used for 3 different stages, it is unclear which stage of changegroup generation we're in. By making the topics "changesets," "manifests," and "files," one can get a better feel for how far along in the bundling process we are. Differential Revision: https://phab.mercurial-scm.org/D4272
Fri, 10 Aug 2018 12:44:15 -0700 changegroup: rename mfs to manifests
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 10 Aug 2018 12:44:15 -0700] rev 39238
changegroup: rename mfs to manifests In the name of readability. Differential Revision: https://phab.mercurial-scm.org/D4271
Fri, 10 Aug 2018 12:42:00 -0700 changegroup: clean up changelog callback
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 10 Aug 2018 12:42:00 -0700] rev 39237
changegroup: clean up changelog callback changelog.read() calls changelog.changelogrevion() then turns it into a tuple. Let's call changelogrevision() directly and used named attributes to make code easier to read. While we're here, also change some variable names to make code easier to read. Differential Revision: https://phab.mercurial-scm.org/D4270
Fri, 10 Aug 2018 12:08:45 -0700 changegroup: call rev() on manifestlog instance
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 10 Aug 2018 12:08:45 -0700] rev 39236
changegroup: call rev() on manifestlog instance rev() is part of the imanifestlog interface and should be used instead of using the private revlog instance, which is an implementation detail. Differential Revision: https://phab.mercurial-scm.org/D4269
Fri, 10 Aug 2018 11:00:06 -0700 manifest: rename dir to tree to avoid shadowing built-in
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 10 Aug 2018 11:00:06 -0700] rev 39235
manifest: rename dir to tree to avoid shadowing built-in And update the argument name in the imanifestlog interface. Differential Revision: https://phab.mercurial-scm.org/D4268
Thu, 09 Aug 2018 19:27:54 -0700 repository: remove candelta() from ifileindex
Gregory Szorc <gregory.szorc@gmail.com> [Thu, 09 Aug 2018 19:27:54 -0700] rev 39234
repository: remove candelta() from ifileindex candelta() was previously called by changegroup code. With delta generation moved to the storage API, there are no more external consumers of this method and it can be removed from the storage interface. Differential Revision: https://phab.mercurial-scm.org/D4236
Thu, 09 Aug 2018 19:30:36 -0700 changegroup: rename dir to tree to avoid shadowing a built-in
Gregory Szorc <gregory.szorc@gmail.com> [Thu, 09 Aug 2018 19:30:36 -0700] rev 39233
changegroup: rename dir to tree to avoid shadowing a built-in Differential Revision: https://phab.mercurial-scm.org/D4235
Thu, 09 Aug 2018 16:11:24 -0700 repository: remove storedeltachains from ifilestorage
Gregory Szorc <gregory.szorc@gmail.com> [Thu, 09 Aug 2018 16:11:24 -0700] rev 39232
repository: remove storedeltachains from ifilestorage The ifilestorage interface was bootstrapped from requirements of callers outside the storage implementation (revlogs). I believe we even made some members public so they could be part of the interface! Historically, the changegroup code was a gross offender when it came to accessing low-level storage primitives. There are a handful of members on the ifilestorage interface that are/were used only for changegroup code. With the recent refactor of changegroup code and the establishment of a formal API on the storage interface for producing revision deltas, the changegroup code is no longer accessing these low-level primitives related to delta generation directly. Instead, things are abstracted away in the storage implementation. This means we can remove elements from the storage interface that are no longer needed. We start with "storedeltachains." We remove it from the interface. Then we make it a private attribute and update all references. .. api:: storedeltachains has been dropped from ifilestorage interface .. api:: storedeltachains on revlog classes is now _storedeltachains Differential Revision: https://phab.mercurial-scm.org/D4227
Thu, 09 Aug 2018 16:02:14 -0700 repository: establish API for emitting revision deltas
Gregory Szorc <gregory.szorc@gmail.com> [Thu, 09 Aug 2018 16:02:14 -0700] rev 39231
repository: establish API for emitting revision deltas With our revision delta and revision delta request interfaces defined, it is now time to define a method on storage interfaces for using them. So far, the only storage interface that is well-defined and used is file storage. So that is the only interface we need to add a method on. We define an ``emitrevisiondeltas()`` method that takes an iterable of ``irevisiondeltarequest``s and turns them into ``irevisiondelta`` instances. changegroup._handlerevisiondeltarequest() and the looping logic from changegroup.deltagroup() has effectively been moved to revlog.emitrevisiondeltas(). Our filelog wrapper class proxies its emitrevisiondeltas() to the internal revlog instance. The simple store test extension used to verify sanity of storage abstractions has also implemented emitrevisiondeltas() for file storage and the test harness when run with this extension doesn't seem to exhibit any regressions. Rather than create a shared type to represent revision deltas, each storage backend has its own type and the class name identifies where the revision delta was derived from. Differential Revision: https://phab.mercurial-scm.org/D4226
Thu, 09 Aug 2018 15:40:14 -0700 repository: formalize interfaces for revision deltas and requests
Gregory Szorc <gregory.szorc@gmail.com> [Thu, 09 Aug 2018 15:40:14 -0700] rev 39230
repository: formalize interfaces for revision deltas and requests Now that we've sufficiently abstracted how revision deltas are produced in changegroup code, we can now start the process of formalizing that as part of the interfaces defined in the repository module. This commit essentially converts the revisiondelta and revisiondeltarequest classes into well-defined interfaces. This is not strictly necessary. But I want all types formalized by the storage interface to have interfaces. This makes it much easier to test for interface conformance and for implementing new storage backends. Because the interface is documented, comments and docstrings from changegroup.py have been dropped. Differential Revision: https://phab.mercurial-scm.org/D4225
Thu, 09 Aug 2018 14:31:25 -0700 changegroup: move node sorting into deltagroup()
Gregory Szorc <gregory.szorc@gmail.com> [Thu, 09 Aug 2018 14:31:25 -0700] rev 39229
changegroup: move node sorting into deltagroup() The 3 callers of deltagroup() all sort nodes and convert to integer revs immediately before calling deltagroup(). Stepping back a bit, aside from the constraints on node ordering that always apply (namely that a node must follow its ancestor), it makes sense for sorting to be an implementation detail of the store. Moving the sorting into deltagroup() will open the door for moving sorting into a storage API. The test for the changelog in deltagroup() to impact the sorting method is a bit hacky. I suspect this will be resolved once we establish a formal interface for delta group generation and port changelog to it. Differential Revision: https://phab.mercurial-scm.org/D4224
Tue, 21 Aug 2018 21:05:15 -0400 cext: fix truncation warnings in revlog on Windows
Matt Harbison <matt_harbison@yahoo.com> [Tue, 21 Aug 2018 21:05:15 -0400] rev 39228
cext: fix truncation warnings in revlog on Windows
Tue, 21 Aug 2018 20:57:58 -0400 cext: fix revlog compiler error on Windows
Matt Harbison <matt_harbison@yahoo.com> [Tue, 21 Aug 2018 20:57:58 -0400] rev 39227
cext: fix revlog compiler error on Windows
Sun, 05 Aug 2018 00:42:07 -0700 shortest: use nodetree for finding shortest node within revset
Martin von Zweigbergk <martinvonz@google.com> [Sun, 05 Aug 2018 00:42:07 -0700] rev 39226
shortest: use nodetree for finding shortest node within revset This speeds up `hg log -T '{shortest(node,1)}\n'` in my repo from 12s to 4.5s. That's very close to the 4.1s it takes without the disambiguation revset configured. My repo has 69.5k revisions, of which 550 were in the configured revset ("not public()"). Differential Revision: https://phab.mercurial-scm.org/D4120
Mon, 20 Aug 2018 15:57:03 -0700 index: fix a comment about overflow-checking
Martin von Zweigbergk <martinvonz@google.com> [Mon, 20 Aug 2018 15:57:03 -0700] rev 39225
index: fix a comment about overflow-checking There's no "argument-checking" done in this method. This was a bad copy paste. Differential Revision: https://phab.mercurial-scm.org/D4339
Mon, 20 Aug 2018 16:19:36 -0400 tests: demonstrate a problem with renames on the p2 side of a conversion
Matt Harbison <matt_harbison@yahoo.com> [Mon, 20 Aug 2018 16:19:36 -0400] rev 39224
tests: demonstrate a problem with renames on the p2 side of a conversion I think this is related to the octopus merge being sloppy, and that's having a cascading affect on the fixup merge. If this change is made on p1 (specifically with the 'Added parent file' commit), the failure doesn't occur. The file modification with the rename doesn't seem to be necessary, but it's what's happening in a production repo where I first noticed, so I left it. This is an example of the manifest divergence I'd been seeing, which wasn't fixed by Yuya's recent changes. This is separate from the changelog divergence I was also seeing[1]. Probably nobody cares about bzr anymore, but this will also affect git, since the octopus fixup code is in the hg sink. [1] https://www.mercurial-scm.org/pipermail/mercurial-devel/2018-August/120473.html
Fri, 13 Jul 2018 15:03:15 -0400 tests: add a test to show the added/modified/removed files in a bzr convert
Matt Harbison <matt_harbison@yahoo.com> [Fri, 13 Jul 2018 15:03:15 -0400] rev 39223
tests: add a test to show the added/modified/removed files in a bzr convert
Fri, 13 Jul 2018 12:33:06 -0400 tests: show added/modified/removed files when logging repos converted from bzr
Matt Harbison <matt_harbison@yahoo.com> [Fri, 13 Jul 2018 12:33:06 -0400] rev 39222
tests: show added/modified/removed files when logging repos converted from bzr There's a bug related to incorrect status values that can be triggered by an octopus fixup merge. Seeing what the current status is (instead of just the aggregate list) will hopefully help track this down.
(0) -30000 -10000 -3000 -1000 -300 -100 -60 +60 +100 +300 +1000 +3000 +10000 tip