It seems like a small usability improvement if users don't need to
enter the "$schema" link manually when they create a new config file.
This doesn't help existing users.
A pattern has emerged where a integration tests check for the
availability of an external tool (`git`, `taplo`, `gpg`, ...) and skip
the test (by simply passing it) when it is not available. To check this,
the program is run with the `--version` flag.
Some tests require that the program be available at least when running
in CI, by calling `ensure_running_outside_ci` conditionally on the
outcome. The decision is up to each test, though, the utility merely
returns a `bool`.
The previous implementation of `assert_no_forgotten_test_files`
hard-coded the name of the `runner` integration test and required all
other source files to appear in matching `mod` declarations. Thus, this
approach cannot handle multiple integration tests.
However, additional integration tests may be desirable
- to support tests using a custom test harness (see upcoming commits)
- to balance the trade-off between test run time and compile time as
the test suite grows in the future.
The new implementation first uses `taplo` to parse the `[[test]]`
sections of the manifest to identify integration test main modules,
and then searches in those for `mod` declarations. This is then compared
to the list of source files in the tests directory. Like the previous
implementation, the new one does not attempt to recurse into submodules
or to handle directory-style modules; just like before it only treats
source files without a module declaration as an error and relies on the
compiler to complain about the other way around.
When `taplo` is not installed, the check is skipped unless it is running
in CI where we require `taplo` to be available.
I don't have any plan to implement incremental UI for file annotation, but I
think the new API is nicer in that they have fewer function arguments.
Note that this wouldn't help implement interactive UI to go ancestor annotation
by clicking annotated line. To achieve that cheaply, we'll need weave-like data.
We were not calling `view.mark_dirty()` after adding heads, which
means that we would not enforce the usual view invariants, such that
ancestors of heads should not also be in the set of heads. This patch
fixes that and updates the test (which actually shows the broken
invariant in its current form).
We ran into a crash on our server at Google today because we
accidentally called `RepoPathBuf::from_internal_string()` with a
string starting with a '/', which resulted in a the assertion in that
function failing. This patch changes that constructor and its siblings
to return a `Result` instead.
The logic is similar to the color-words diff's. We first resolve trivial
conflicts, then compare each hunk of Merge<&BStr> type. We also apply the same
optimization as the resolved case to minimize lines to be merged and diffed.
This allows the customization of the duplicated commit descriptions.
An ideal use case for this is emulating `git cherry-pick -x`, as
illustrated in the tests.
namely Signed-off-by and cherry-pick trailers. The cherry-pick trailer
doesn't appear in the parsed trailer though, to match the
`git interpret-trailers` implementation.
see https://github.com/git/git/blob/master/trailer.c for reference
We call `RevsetEvaluationError::expect_backend_error()` in lots of
places. If the revset engine had returned a non-`BackendError`, it
would result in a panic. For example, a revset engine might return
something like `RevsetEvaluationError::Other("not supported".into())`
for some revsets. We shouldn't crash when this happens.
We may want to create some higher-level `RepoError` to return here,
but for now let's just avoid the crash.
We're going to make "jj resolve" error out on exec bit conflict. This behavior
should be more consistent with tree::try_resolve_file_conflict(), which exits
early if the tree value had absent entries.
Since unchanged exec bit shouldn't be lost when resolving change-delete content
conflict, the resolution function falls back to the original state if the
exec-bit conflict is resolved to None.
This seems a bit easier to follow than nesting Option types.
try_resolve_file_conflict() doesn't have this problem, but it is the only caller
of maybe_map(), so I've gone ahead and replaced it, too.
The return type is unchanged because it looked equally bad if to_tree_merge()
returned Result<Result<Merge<Tree>, ()>, BackendError>.
This will probably help debug weird problem like #6287. File names are a bit
redundant for ReadObject errors (which include ObjectId), but that should be
okay.
This helps propagate error from tx.write(). I made the error variants
non-transparent because it's easier than manually implementing From<> that maps
each inner error to the other inner error.