Fri, 24 Jul 2020 11:24:59 -0700 templater: handle None returned from templatedir()
Martin von Zweigbergk <martinvonz@google.com> [Fri, 24 Jul 2020 11:24:59 -0700] rev 45213
templater: handle None returned from templatedir() My recent 91aa9bba3dc9 (templater: make templatepaths() return a single path, or None, 2020-07-21) didn't account for the fact that `templatedir()` returns `None` in frozen binaries. That is ironic, since the reason I'm working on this is to add support for built-in mapfiles in frozen binaries. This patch updates the callers to handle the `None` case. It's somewhat ugly, but I will have to revisit this soon anyway, since my goal is to make all callers handle that case by trying to read the map file using the resources API instead. Differential Revision: https://phab.mercurial-scm.org/D8810
Fri, 24 Jul 2020 00:50:57 +0530 tests: glob 'mercurial.error' in test-phases.t stable
Pulkit Goyal <7895pulkit@gmail.com> [Fri, 24 Jul 2020 00:50:57 +0530] rev 45212
tests: glob 'mercurial.error' in test-phases.t On python 2 with chg, `mercurial.error` is omitted while printing error. On other cases it's there in error message. I did tried to understand what might be the cause was unable to find one on quick skim through the code.
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
(0) -30000 -10000 -3000 -1000 -300 -100 -10 +10 +100 +300 +1000 +3000 tip