Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

conflcts.rs: label conflict markers with conflict #, side #, whether it's a side or a diff #3459

Merged
merged 3 commits into from
May 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

* `jj tag list` now prints commit summary along with the tag name.

* Conflict markers now include an explanation of what each part of the conflict
represents.


>>>>>>>
### Fixed bugs

## [0.17.0] - 2024-05-01
Expand Down
6 changes: 3 additions & 3 deletions cli/tests/test_cat_command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,11 @@ fn test_cat() {
test_env.jj_cmd_ok(&repo_path, &["rebase", "-r", "@", "-d", "@--"]);
let stdout = test_env.jj_cmd_success(&repo_path, &["cat", "file1"]);
insta::assert_snapshot!(stdout, @r###"
<<<<<<<
%%%%%%%
<<<<<<< Conflict 1 of 1
%%%%%%% Changes from base to side #1
-b
+a
+++++++
+++++++ Contents of side #2
c
>>>>>>>
"###);
Expand Down
30 changes: 15 additions & 15 deletions cli/tests/test_chmod_command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,11 @@ fn test_chmod_regular_conflict() {
let stdout = test_env.jj_cmd_success(&repo_path, &["cat", "file"]);
insta::assert_snapshot!(stdout,
@r###"
<<<<<<<
%%%%%%%
<<<<<<< Conflict 1 of 1
%%%%%%% Changes from base to side #1
-base
+x
+++++++
+++++++ Contents of side #2
n
>>>>>>>
"###);
Expand All @@ -90,11 +90,11 @@ fn test_chmod_regular_conflict() {
let stdout = test_env.jj_cmd_success(&repo_path, &["cat", "file"]);
insta::assert_snapshot!(stdout,
@r###"
<<<<<<<
%%%%%%%
<<<<<<< Conflict 1 of 1
%%%%%%% Changes from base to side #1
-base
+x
+++++++
+++++++ Contents of side #2
n
>>>>>>>
"###);
Expand All @@ -107,11 +107,11 @@ fn test_chmod_regular_conflict() {
let stdout = test_env.jj_cmd_success(&repo_path, &["cat", "file"]);
insta::assert_snapshot!(stdout,
@r###"
<<<<<<<
%%%%%%%
<<<<<<< Conflict 1 of 1
%%%%%%% Changes from base to side #1
-base
+x
+++++++
+++++++ Contents of side #2
n
>>>>>>>
"###);
Expand Down Expand Up @@ -201,10 +201,10 @@ fn test_chmod_file_dir_deletion_conflicts() {
let stdout = test_env.jj_cmd_success(&repo_path, &["cat", "-r=file_deletion", "file"]);
insta::assert_snapshot!(stdout,
@r###"
<<<<<<<
+++++++
<<<<<<< Conflict 1 of 1
+++++++ Contents of side #1
a
%%%%%%%
%%%%%%% Changes from base to side #2
-base
>>>>>>>
"###);
Expand Down Expand Up @@ -234,10 +234,10 @@ fn test_chmod_file_dir_deletion_conflicts() {
let stdout = test_env.jj_cmd_success(&repo_path, &["cat", "-r=file_deletion", "file"]);
insta::assert_snapshot!(stdout,
@r###"
<<<<<<<
+++++++
<<<<<<< Conflict 1 of 1
+++++++ Contents of side #1
a
%%%%%%%
%%%%%%% Changes from base to side #2
-base
>>>>>>>
"###);
Expand Down
6 changes: 3 additions & 3 deletions cli/tests/test_diffedit_command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -395,11 +395,11 @@ fn test_diffedit_merge() {
assert!(!repo_path.join("file1").exists());
let stdout = test_env.jj_cmd_success(&repo_path, &["print", "file2"]);
insta::assert_snapshot!(stdout, @r###"
<<<<<<<
%%%%%%%
<<<<<<< Conflict 1 of 1
%%%%%%% Changes from base to side #1
-a
+c
+++++++
+++++++ Contents of side #2
b
>>>>>>>
"###);
Expand Down
6 changes: 3 additions & 3 deletions cli/tests/test_interdiff_command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,11 @@ fn test_interdiff_conflicting() {
--- a/file
+++ b/file
@@ -1,7 +1,1 @@
-<<<<<<<
-%%%%%%%
-<<<<<<< Conflict 1 of 1
-%%%%%%% Changes from base to side #1
--foo
-+abc
-+++++++
-+++++++ Contents of side #2
-bar
->>>>>>>
+def
Expand Down
12 changes: 6 additions & 6 deletions cli/tests/test_obslog_command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ fn test_obslog_with_or_without_diff() {
@ rlvkpnrz [email protected] 2001-02-03 08:05:10 66b42ad3
│ my description
│ Resolved conflict in file1:
│ 1 1: <<<<<<<resolved
│ 2 : %%%%%%%
│ 1 1: <<<<<<< Conflict 1 of 1resolved
│ 2 : %%%%%%% Changes from base to side #1
│ 3 : -foo
│ 4 : +++++++
│ 4 : +++++++ Contents of side #2
│ 5 : foo
│ 6 : bar
│ 7 : >>>>>>>
Expand Down Expand Up @@ -111,10 +111,10 @@ fn test_obslog_with_or_without_diff() {
--- a/file1
+++ b/file1
@@ -1,7 +1,1 @@
-<<<<<<<
-%%%%%%%
-<<<<<<< Conflict 1 of 1
-%%%%%%% Changes from base to side #1
--foo
-+++++++
-+++++++ Contents of side #2
-foo
-bar
->>>>>>>
Expand Down
Loading