morestatus: mention --stop even if not using --verbose
Differential Revision: https://phab.mercurial-scm.org/D8811
exchange: backout changeset
c26335fa4225
Changeset
c26335fa4225 has good intends but introduce significant behavior
regressions for multiple important cases. In short there are many case where
push would have caught instability creation/propagation that are no longer
covered. These behavior have been covered for many years and even if some
related case are not currently caught, the covered one should not be regressed.
The next four changesets introduce tests for some of these cases. However we
could produce many more tests cases since the area is wide and they are many
possible combination. (And we should cover them when getting back to this issue)
Since 5.5 is one week away, the most reasonable approach seems to back this out
while we devise a new way to move forward that preserve the current behavior,
catch more issues and also improves the situation that
c26335fa4225 target.
In addition to the behavior change,
c26335fa4225 also introduced output
changes. These output changes does not requires a backout per-se, but are part of
the same changeset. However they come with a couple of issues that also requires
attention:
1) the bulk of the error message have been shoehorned into a multiple line abort
message. This seems quite different from what we usually do. The abort message
should be a compact and efficient message, with extra details being issued as
normal error output beforehand. (with --verbose/--quiet) support.
2) the current output is unbounded, so if there is many (tens, hundreds,
thousands, …) of unstable/obsolete changeset involved in the push, the output
can quickly become a scary and un-usuable wall of text. So we need some
limitation here (same as we have with the remote head list that says A, B , C
and # others).
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
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.
infinitepush: remove unused import to tempfile
Spotted by test-check-pyflakes.t
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
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
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
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
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
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