Thu, 23 Jul 2020 17:32:09 +0200 infinitepush: remove unused import to tempfile stable
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 23 Jul 2020 17:32:09 +0200] rev 45211
infinitepush: remove unused import to tempfile Spotted by test-check-pyflakes.t
Wed, 22 Jul 2020 00:09:17 -0700 templater: do search for include of unqualified builtin outside of config code
Martin von Zweigbergk <martinvonz@google.com> [Wed, 22 Jul 2020 00:09:17 -0700] rev 45210
templater: do search for include of unqualified builtin outside of config code Commit 081b08e4ea13 (templater: look for mapfiles in template paths, 2015-05-15) added support for using things like `%include map-cmdline.default` to include built-in map files without using a valid path to them. This patch rewrites that support by moving it into `_readmapfile()` so it can later be adapted for reading from a non-file resource. Differential Revision: https://phab.mercurial-scm.org/D8792
Tue, 21 Jul 2020 21:59:12 -0700 templater: switch to lower-level config.parse() in _readmapfile()
Martin von Zweigbergk <martinvonz@google.com> [Tue, 21 Jul 2020 21:59:12 -0700] rev 45209
templater: switch to lower-level config.parse() in _readmapfile() I hope to modify this code to also work with resources loaded from memory (for PyOxidizer support). For that, we'll need to handle the lookup of relative `%include` path (not joined with the base directory of the containing file). This patch prepares for that by using `config.parse()` instead of `config.read()`, since the latter expects a file in the file system. As it happens, this change also lets us clean up the `config` class to not need the `_includepaths` field. That will happen next. Differential Revision: https://phab.mercurial-scm.org/D8791
Tue, 21 Jul 2020 23:50:42 -0700 config: pass both relative and absolute paths to `include` callback
Martin von Zweigbergk <martinvonz@google.com> [Tue, 21 Jul 2020 23:50:42 -0700] rev 45208
config: pass both relative and absolute paths to `include` callback The `include` callback is responsible for loading configs from `%include` statements. The callback currently gets passed the absolute path [1] to the config to read. That is created by joining the dirname of the file that contains the `%include` statement. For PyOxidizer support, I'm trying to reduce dependence on paths. This patch helps with that by passing the relative path found in the `%include` statement (but with username expansion, etc.) to the `include` callback. It also turns out that the existing callers can easily adapt to using the relative path. Coming patches will clean that up and then we'll remove the absolute path from the callback. [1] The "absolute path" bit is a bit of a lie -- it's going to be an absolute path if the path that was passed into `config.parse()` was absolute. Differential Revision: https://phab.mercurial-scm.org/D8790
Wed, 22 Jul 2020 22:38:42 -0700 tests: add test for bad template %include and __base__
Martin von Zweigbergk <martinvonz@google.com> [Wed, 22 Jul 2020 22:38:42 -0700] rev 45207
tests: add test for bad template %include and __base__ It doesn't seem like we had any tests for `%include non-existent` and `__base__ = non-existent`. The latter raises an error while the former ignores the include. We should probably also make the former an error. Differential Revision: https://phab.mercurial-scm.org/D8798
Tue, 21 Jul 2020 22:52:22 -0700 tests: add test for unqualified include of a built-in template map
Martin von Zweigbergk <martinvonz@google.com> [Tue, 21 Jul 2020 22:52:22 -0700] rev 45206
tests: add test for unqualified include of a built-in template map The feature was added in 081b08e4ea13 (templater: look for mapfiles in template paths, 2015-05-15), but no test case was added. Differential Revision: https://phab.mercurial-scm.org/D8797
Wed, 22 Jul 2020 22:09:38 -0400 merge with stable
Augie Fackler <augie@google.com> [Wed, 22 Jul 2020 22:09:38 -0400] rev 45205
merge with stable
Tue, 07 Jul 2020 00:18:15 +0200 commitctx: extract _filecommit too
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 07 Jul 2020 00:18:15 +0200] rev 45204
commitctx: extract _filecommit too This function is exclusively used in `commitctx`. So we should extract it too for consistency and to reduce the `localrepo` bloat. This is part of a larger refactoring/cleanup of the commitctx code to clarify and augment the logic gathering metadata useful for copy tracing. The current code is a tad too long and entangled to make such update easy. Differential Revision: https://phab.mercurial-scm.org/D8710
Mon, 06 Jul 2020 23:14:52 +0200 commitctx: extract the function in a dedicated module
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 06 Jul 2020 23:14:52 +0200] rev 45203
commitctx: extract the function in a dedicated module the function have few callers (< 15) is quite long a mostly independent from the repository itself. It seems like a good candidate to reduce the bloatness of the localrepository class. Extracting it will help us cleaning the code up and splitting it into more reasonable-size function. We don't use a copy trick because the amount of code extract is quite small (<5%) and the de-indent means every single line change anyway. So this is not deemed valuable to do so. This is part of a larger refactoring/cleanup of the commitctx code to clarify and augment the logic gathering metadata useful for copy tracing. The current code is a tad too long and entangled to make such update easy. Differential Revision: https://phab.mercurial-scm.org/D8709
Mon, 06 Jul 2020 19:13:19 +0200 commitctx: document a fast path in _filecommit
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 06 Jul 2020 19:13:19 +0200] rev 45202
commitctx: document a fast path in _filecommit This block cut off a lot of logic, documenting the why and how seems useful to future reader. This is part of a larger refactoring/cleanup of the commitctx code to clarify and augment the logic gathering metadata useful for copy tracing. The current code is a tad too long and entangled to make such update easy. We start with easy and small cleanup. Differential Revision: https://phab.mercurial-scm.org/D8700
(0) -30000 -10000 -3000 -1000 -300 -100 -10 +10 +100 +300 +1000 +3000 tip