ok/jj
1
0
Fork 0
forked from mirrors/jj
Commit graph

11 commits

Author SHA1 Message Date
Samuel Tardieu
605a39b84f jj new --insert-after 2023-02-07 09:16:48 +01:00
Samuel Tardieu
4119aa44a9 jj new --insert-before 2023-02-07 09:16:48 +01:00
Ilya Grigoriev
d153ced8ba cli_util: Make resolve_base_revs use IndexSet
This will make deduplication easier in the next commit.
The error message becomes slightly less informative, unfortunately.
2023-02-05 21:22:18 -08:00
Yuya Nishihara
e63ea86841 templater: do not complete "(no commit description)" by default
This allows us to use "if(description,)" to test empty description. And
I think this change is unavoidable if we want to add support for commit
template.
2023-02-01 16:13:43 +09:00
Yuya Nishihara
6f8fb09609 cli: append "\n" to commit description specified by -m/--message
Otherwise the description set by -m would differ from the one set by editor.
This fixes test_describe() which says "make no changes", but previously "\n"
would be added by the second "jj describe".

As you can see, almost all hashes change in CLI tests. This means in-flight
PRs will need to be rebased to update insta snapshots.

Description text could be normalized by CommitBuilder, but the caller would
have to normalize it beforehand to compare with the current description, so
we would need an explicit function anyway. Another idea is to add a newtype
that represents a normalized description, and make CommitBuilder require it.
Commit::description() will return &Description in place of &str to ensure
that commit.description() == raw_str wouldn't compile.

Git CLI provides --cleanup=<mode> option to switch normalization rules, but
I don't think we'll need such feature.
2022-12-22 14:59:03 +09:00
Martin von Zweigbergk
d8feed9be4 copyright: change from "Google LLC" to "The Jujutsu Authors"
Let's acknowledge everyone's contributions by replacing "Google LLC"
in the copyright header by "The Jujutsu Authors". If I understand
correctly, it won't have any legal effect, but maybe it still helps
reduce concerns from contributors (though I haven't heard any
concerns).

Google employees can read about Google's policy at
go/releasing/contributions#copyright.
2022-11-28 06:05:45 -10:00
Waleed Khan
9607d954e4 tests: assert result of TestEnvironment::jj_cmd_cli_error
In the test case `test_branch_mutually_exclusive_actions`, we weren't actually testing anything useful, because the interface has since changed to use subcommands instead of options. The test has been deleted in this commit, and `TestEnvironment::jj_cmd_cli_error` has been changed to return a `#[must_use]` `String` representing stderr. I also added `#[must_use]` to `TestEnvironment::jj_cmd_failure` while I was here.
2022-11-20 05:08:35 -08:00
Yuya Nishihara
c5aab9fe29 cli: fix crash on "jj merge whatever root" 2022-09-01 13:36:17 +09:00
Yuya Nishihara
1cc7fc4cd9 cli: error out if "new" parent revisions aren't unique
If more than one parents are specified, the user would expect a merge
commit.
2022-09-01 13:36:17 +09:00
Martin von Zweigbergk
3a46623446 cli: make jj merge delegate to jj new 2022-08-31 07:51:32 -07:00
Martin von Zweigbergk
a1a980d395 cli: make jj new create a merge commit if more than one arg given
`jj merge` just creates an empty change, which is practically the same
as `jj new`. The main difference is that the former requires more than
one argument and the latter requires at most one argument. It seems
cleaner to generalize them and make them aliases. This patch starts
doing that by making `jj new` accept more than one argument.

Instead of having `jj merge` be exactly an alias for `jj new`, we may
want to make it a thin wrapper that just checks that more than one
argument was given. That would probably be less confusing to users who
run `jj merge` without arguments to see what it does.

We should probably make `jj checkout` also be an alias for `jj new`,
but that will have to wait until we have removed support for open
commits (since `jj checkout` still has logic for dealing with open
commits).
2022-08-31 07:51:32 -07:00
Renamed from tests/test_new.rs (Browse further)