mirror of
https://github.com/martinvonz/jj.git
synced 2025-01-18 10:07:28 +00:00
cli: show placeholder text for empty commit message
It can be confusing that some commits (typically the working copy) don't have a description. Let's show a placeholder text in such cases. I chose the format to match the "(no email configured)" message we already have.
This commit is contained in:
parent
3750d1097b
commit
0865b1ccff
18 changed files with 104 additions and 102 deletions
20
README.md
20
README.md
|
@ -49,8 +49,8 @@ backend (the only minor reason might be
|
||||||
The backend exists mainly to make sure that it's possible to eventually add
|
The backend exists mainly to make sure that it's possible to eventually add
|
||||||
functionality that cannot easily be added to the Git backend.
|
functionality that cannot easily be added to the Git backend.
|
||||||
|
|
||||||
<a href="https://asciinema.org/a/YZTilpwDKJjf6bKjCDFwDpKf4" target="_blank">
|
<a href="https://asciinema.org/a/6UwpP2U4QxuRUY6eOGfRoJsgN" target="_blank">
|
||||||
<img src="https://asciinema.org/a/YZTilpwDKJjf6bKjCDFwDpKf4.svg" />
|
<img src="https://asciinema.org/a/6UwpP2U4QxuRUY6eOGfRoJsgN.svg" />
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
### The working copy is automatically committed
|
### The working copy is automatically committed
|
||||||
|
@ -61,8 +61,8 @@ working copy or any other commit. It also means that you can always check out a
|
||||||
different commit without first explicitly committing the working copy changes
|
different commit without first explicitly committing the working copy changes
|
||||||
(you can even check out a different commit while resolving merge conflicts).
|
(you can even check out a different commit while resolving merge conflicts).
|
||||||
|
|
||||||
<a href="https://asciinema.org/a/DYrJLVkp2TIPgfMmjyhptTo7d" target="_blank">
|
<a href="https://asciinema.org/a/OywNvPxShG4Zmul2eNcDiL3nj" target="_blank">
|
||||||
<img src="https://asciinema.org/a/DYrJLVkp2TIPgfMmjyhptTo7d.svg" />
|
<img src="https://asciinema.org/a/OywNvPxShG4Zmul2eNcDiL3nj.svg" />
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
### Operations update the repo first, then possibly the working copy
|
### Operations update the repo first, then possibly the working copy
|
||||||
|
@ -78,8 +78,8 @@ the repo state after the operation. This means that you can easily revert to an
|
||||||
earlier repo state, or to simply undo a particular operation (which does not
|
earlier repo state, or to simply undo a particular operation (which does not
|
||||||
necessarily have to be the most recent operation).
|
necessarily have to be the most recent operation).
|
||||||
|
|
||||||
<a href="https://asciinema.org/a/OFOTcm2XlZ09LLEI5bHYM8Alw" target="_blank">
|
<a href="https://asciinema.org/a/fggh1HkoYyH5HAA8amzm4LiV4" target="_blank">
|
||||||
<img src="https://asciinema.org/a/OFOTcm2XlZ09LLEI5bHYM8Alw.svg" />
|
<img src="https://asciinema.org/a/fggh1HkoYyH5HAA8amzm4LiV4.svg" />
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
### Conflicts can be recorded in commits
|
### Conflicts can be recorded in commits
|
||||||
|
@ -92,13 +92,13 @@ resolving conflicts, regardless of which command caused them. This design also
|
||||||
lets Jujutsu rebase merge commits correctly (unlike both Git and Mercurial).
|
lets Jujutsu rebase merge commits correctly (unlike both Git and Mercurial).
|
||||||
|
|
||||||
Basic conflict resolution:
|
Basic conflict resolution:
|
||||||
<a href="https://asciinema.org/a/ANyfj9M0hXZlDyw68QktpU5UM" target="_blank">
|
<a href="https://asciinema.org/a/egs4vOJGCd2lt8OBhCx0f139z" target="_blank">
|
||||||
<img src="https://asciinema.org/a/ANyfj9M0hXZlDyw68QktpU5UM.svg" />
|
<img src="https://asciinema.org/a/egs4vOJGCd2lt8OBhCx0f139z.svg" />
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
Juggling conflicts:
|
Juggling conflicts:
|
||||||
<a href="https://asciinema.org/a/HqYA9SL2tzarPAErpYs684GGR" target="_blank">
|
<a href="https://asciinema.org/a/sTQnMCthulo2NfwRnHX30qegq" target="_blank">
|
||||||
<img src="https://asciinema.org/a/HqYA9SL2tzarPAErpYs684GGR.svg" />
|
<img src="https://asciinema.org/a/sTQnMCthulo2NfwRnHX30qegq.svg" />
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
### Automatic rebase
|
### Automatic rebase
|
||||||
|
|
|
@ -15,7 +15,7 @@ Let's start by cloning the Jujutsu Git repo using `jj`:
|
||||||
# repos yet)
|
# repos yet)
|
||||||
$ jj git clone https://github.com/martinvonz/jj.git
|
$ jj git clone https://github.com/martinvonz/jj.git
|
||||||
Fetching into new repo in "<dir>/jj"
|
Fetching into new repo in "<dir>/jj"
|
||||||
Working copy now at: 265ecf5cab2d
|
Working copy now at: 265ecf5cab2d (no description set)
|
||||||
Added 98 files, modified 0 files, removed 0 files
|
Added 98 files, modified 0 files, removed 0 files
|
||||||
$ cd jj
|
$ cd jj
|
||||||
```
|
```
|
||||||
|
@ -24,7 +24,7 @@ Running `jj st` (short for`jj status`) now yields something like this:
|
||||||
```shell script
|
```shell script
|
||||||
$ jj st
|
$ jj st
|
||||||
Parent commit: 723ebb380971 cleanup: restructure escaped newlines to make new rustc happy
|
Parent commit: 723ebb380971 cleanup: restructure escaped newlines to make new rustc happy
|
||||||
Working copy : 265ecf5cab2d
|
Working copy : 265ecf5cab2d (no description set)
|
||||||
The working copy is clean
|
The working copy is clean
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ Working copy now at: 608c179a60df
|
||||||
Added 7 files, modified 65 files, removed 21 files
|
Added 7 files, modified 65 files, removed 21 files
|
||||||
$ jj st
|
$ jj st
|
||||||
Parent commit: 080a9b37ff7e cli: make `jj st` show parent commit before working copy commit
|
Parent commit: 080a9b37ff7e cli: make `jj st` show parent commit before working copy commit
|
||||||
Working copy : 608c179a60df
|
Working copy : 608c179a60df (no description set)
|
||||||
The working copy is clean
|
The working copy is clean
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -67,7 +67,7 @@ Now make the change in the README:
|
||||||
$ sed -i 's/not ready/ready/' README.md
|
$ sed -i 's/not ready/ready/' README.md
|
||||||
$ jj st
|
$ jj st
|
||||||
Parent commit: 080a9b37ff7e cli: make `jj st` show parent commit before working copy commit
|
Parent commit: 080a9b37ff7e cli: make `jj st` show parent commit before working copy commit
|
||||||
Working copy : 5f80190c44b9
|
Working copy : 5f80190c44b9 Jujutsu is ready!
|
||||||
Working copy changes:
|
Working copy changes:
|
||||||
M README.md
|
M README.md
|
||||||
```
|
```
|
||||||
|
@ -110,10 +110,10 @@ that commit itself will be checked out instead.
|
||||||
So, let's say we're now done with this commit, so we close it:
|
So, let's say we're now done with this commit, so we close it:
|
||||||
```shell script
|
```shell script
|
||||||
$ jj close
|
$ jj close
|
||||||
Working copy now at: 192b456b024b
|
Working copy now at: 192b456b024b (no description set)
|
||||||
$ jj st
|
$ jj st
|
||||||
Parent commit: fb563a4c6d26 Jujutsu is ready!
|
Parent commit: fb563a4c6d26 Jujutsu is ready!
|
||||||
Working copy : 192b456b024b
|
Working copy : 192b456b024b (no description set)
|
||||||
The working copy is clean
|
The working copy is clean
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -132,7 +132,7 @@ in its `jj log` command:
|
||||||
```shell script
|
```shell script
|
||||||
$ jj log
|
$ jj log
|
||||||
@ 192b456b024b f39aeb1a0200 martinvonz@google.com 2021-05-23 23:10:27.000 -07:00
|
@ 192b456b024b f39aeb1a0200 martinvonz@google.com 2021-05-23 23:10:27.000 -07:00
|
||||||
|
|
| (no description set)
|
||||||
o fb563a4c6d26 f63e76f175b9 martinvonz@google.com 2021-05-23 22:13:45.000 -07:00
|
o fb563a4c6d26 f63e76f175b9 martinvonz@google.com 2021-05-23 22:13:45.000 -07:00
|
||||||
| Jujutsu is ready!
|
| Jujutsu is ready!
|
||||||
o 080a9b37ff7e 6a91b4ba16c7 martinvonz@google.com 2021-05-23 22:08:37.000 -07:00 main
|
o 080a9b37ff7e 6a91b4ba16c7 martinvonz@google.com 2021-05-23 22:08:37.000 -07:00 main
|
||||||
|
@ -156,7 +156,7 @@ union, `&` for intersection and `~` for difference. For example:
|
||||||
```shell script
|
```shell script
|
||||||
$ jj log -r '@ | root | branches()'
|
$ jj log -r '@ | root | branches()'
|
||||||
@ 192b456b024b f39aeb1a0200 martinvonz@google.com 2021-05-23 23:10:27.000 -07:00
|
@ 192b456b024b f39aeb1a0200 martinvonz@google.com 2021-05-23 23:10:27.000 -07:00
|
||||||
:
|
: (no description set)
|
||||||
o 080a9b37ff7e 6a91b4ba16c7 martinvonz@google.com 2021-05-23 22:08:37.000 -07:00 main
|
o 080a9b37ff7e 6a91b4ba16c7 martinvonz@google.com 2021-05-23 22:08:37.000 -07:00 main
|
||||||
: cli: make `jj st` show parent commit before working copy commit
|
: cli: make `jj st` show parent commit before working copy commit
|
||||||
o 000000000000 000000000000 1970-01-01 00:00:00.000 +00:00
|
o 000000000000 000000000000 1970-01-01 00:00:00.000 +00:00
|
||||||
|
@ -178,16 +178,16 @@ commits:
|
||||||
```shell script
|
```shell script
|
||||||
# Check out the grandparent of the working copy
|
# Check out the grandparent of the working copy
|
||||||
$ jj co @--
|
$ jj co @--
|
||||||
Working copy now at: 9164f1d6a011
|
Working copy now at: 9164f1d6a011 (no description set)
|
||||||
Added 0 files, modified 1 files, removed 0 files
|
Added 0 files, modified 1 files, removed 0 files
|
||||||
$ echo a > file1; jj close -m A
|
$ echo a > file1; jj close -m A
|
||||||
Working copy now at: 5be91b2b5b69
|
Working copy now at: 5be91b2b5b69 (no description set)
|
||||||
$ echo b1 > file1; jj close -m B1
|
$ echo b1 > file1; jj close -m B1
|
||||||
Working copy now at: a0331f1eeece
|
Working copy now at: a0331f1eeece (no description set)
|
||||||
$ echo b2 > file1; jj close -m B2
|
$ echo b2 > file1; jj close -m B2
|
||||||
Working copy now at: fd571967346e
|
Working copy now at: fd571967346e (no description set)
|
||||||
$ echo c > file2; jj close -m C
|
$ echo c > file2; jj close -m C
|
||||||
Working copy now at: 4ae1e0587eef
|
Working copy now at: 4ae1e0587eef (no description set)
|
||||||
$ jj l
|
$ jj l
|
||||||
@ 4ae1e0587eef 47684978bf4b martinvonz@google.com 2021-05-26 12:39:56.000 -07:00
|
@ 4ae1e0587eef 47684978bf4b martinvonz@google.com 2021-05-26 12:39:56.000 -07:00
|
||||||
|
|
|
|
||||||
|
@ -206,11 +206,11 @@ modifies a different file. Let's now rebase B2 directly onto A:
|
||||||
```shell script
|
```shell script
|
||||||
$ jj rebase -s 5548374c0794 -d cf49e6bec410
|
$ jj rebase -s 5548374c0794 -d cf49e6bec410
|
||||||
Rebased 3 commits
|
Rebased 3 commits
|
||||||
Working copy now at: 9195b6d2e8dc
|
Working copy now at: 9195b6d2e8dc (no description set)
|
||||||
Added 0 files, modified 1 files, removed 0 files
|
Added 0 files, modified 1 files, removed 0 files
|
||||||
$ jj l
|
$ jj l
|
||||||
@ 9195b6d2e8dc 47684978bf4b martinvonz@google.com 2021-05-26 12:39:56.000 -07:00 conflict
|
@ 9195b6d2e8dc 47684978bf4b martinvonz@google.com 2021-05-26 12:39:56.000 -07:00 conflict
|
||||||
|
|
| (no description set)
|
||||||
o 66274d5a7d2d 8e6178b84ffb martinvonz@google.com 2021-05-26 12:39:35.000 -07:00 conflict
|
o 66274d5a7d2d 8e6178b84ffb martinvonz@google.com 2021-05-26 12:39:35.000 -07:00 conflict
|
||||||
| C
|
| C
|
||||||
o 0c305a9e6b27 5548374c0794 martinvonz@google.com 2021-05-26 12:39:30.000 -07:00 conflict
|
o 0c305a9e6b27 5548374c0794 martinvonz@google.com 2021-05-26 12:39:30.000 -07:00 conflict
|
||||||
|
@ -235,11 +235,11 @@ conflict, we'll squash the conflict resolution into the conflicted B2. That
|
||||||
might look like this:
|
might look like this:
|
||||||
```shell script
|
```shell script
|
||||||
$ jj co 5548374c0794 # Replace the hash by what you have for B2
|
$ jj co 5548374c0794 # Replace the hash by what you have for B2
|
||||||
Working copy now at: 619f58d8a988
|
Working copy now at: 619f58d8a988 (no description set)
|
||||||
Added 0 files, modified 1 files, removed 0 files
|
Added 0 files, modified 1 files, removed 0 files
|
||||||
$ jj st
|
$ jj st
|
||||||
Parent commit: 5548374c0794 B2
|
Parent commit: 5548374c0794 B2
|
||||||
Working copy : 619f58d8a988
|
Working copy : 619f58d8a988 (no description set)
|
||||||
The working copy is clean
|
The working copy is clean
|
||||||
There are unresolved conflicts at these paths:
|
There are unresolved conflicts at these paths:
|
||||||
file1
|
file1
|
||||||
|
@ -255,10 +255,10 @@ b2
|
||||||
$ echo resolved > file1
|
$ echo resolved > file1
|
||||||
$ jj squash
|
$ jj squash
|
||||||
Rebased 1 descendant commits
|
Rebased 1 descendant commits
|
||||||
Working copy now at: e659edc4a9fc
|
Working copy now at: e659edc4a9fc (no description set)
|
||||||
$ jj l
|
$ jj l
|
||||||
@ e659edc4a9fc 461f38324592 martinvonz@google.com 2021-05-26 12:53:08.000 -07:00
|
@ e659edc4a9fc 461f38324592 martinvonz@google.com 2021-05-26 12:53:08.000 -07:00
|
||||||
|
|
| (no description set)
|
||||||
| o 69dbcf76642a 8e6178b84ffb martinvonz@google.com 2021-05-26 12:39:35.000 -07:00
|
| o 69dbcf76642a 8e6178b84ffb martinvonz@google.com 2021-05-26 12:39:35.000 -07:00
|
||||||
|/ C
|
|/ C
|
||||||
o 576d647acf36 5548374c0794 martinvonz@google.com 2021-05-26 12:39:30.000 -07:00
|
o 576d647acf36 5548374c0794 martinvonz@google.com 2021-05-26 12:39:30.000 -07:00
|
||||||
|
@ -337,17 +337,17 @@ We'll need some more complex content to test these commands, so let's create a
|
||||||
few more commits:
|
few more commits:
|
||||||
```shell script
|
```shell script
|
||||||
$ jj co origin/main
|
$ jj co origin/main
|
||||||
Working copy now at: 61b0efa09dbe
|
Working copy now at: 61b0efa09dbe (no description set)
|
||||||
Added 0 files, modified 0 files, removed 1 files
|
Added 0 files, modified 0 files, removed 1 files
|
||||||
$ printf 'a\nb\nc\n' > file; jj close -m abc
|
$ printf 'a\nb\nc\n' > file; jj close -m abc
|
||||||
Working copy now at: f9147a088c0d
|
Working copy now at: f9147a088c0d (no description set)
|
||||||
$ printf 'A\nB\nc\n' > file; jj close -m ABC
|
$ printf 'A\nB\nc\n' > file; jj close -m ABC
|
||||||
Working copy now at: 9d97c5018b23
|
Working copy now at: 9d97c5018b23 (no description set)
|
||||||
$ printf 'A\nB\nC\nD\n' > file; jj close -m ABCD
|
$ printf 'A\nB\nC\nD\n' > file; jj close -m ABCD
|
||||||
Working copy now at: c5a985bc3f41
|
Working copy now at: c5a985bc3f41 (no description set)
|
||||||
$ jj l
|
$ jj l
|
||||||
@ c5a985bc3f41 3568f6e332d5 martinvonz@google.com 2021-05-26 14:36:46.000 -07:00
|
@ c5a985bc3f41 3568f6e332d5 martinvonz@google.com 2021-05-26 14:36:46.000 -07:00
|
||||||
|
|
| (no description set)
|
||||||
o 687009839bae 874f2d307594 martinvonz@google.com 2021-05-26 14:36:38.000 -07:00
|
o 687009839bae 874f2d307594 martinvonz@google.com 2021-05-26 14:36:38.000 -07:00
|
||||||
| ABCD
|
| ABCD
|
||||||
o ad9b1ce3b5d0 2bbc0c1eb382 martinvonz@google.com 2021-05-26 14:36:26.000 -07:00
|
o ad9b1ce3b5d0 2bbc0c1eb382 martinvonz@google.com 2021-05-26 14:36:26.000 -07:00
|
||||||
|
@ -366,7 +366,7 @@ Now try that:
|
||||||
```shell script
|
```shell script
|
||||||
$ jj squash -i -r @-
|
$ jj squash -i -r @-
|
||||||
Rebased 1 descendant commits
|
Rebased 1 descendant commits
|
||||||
Working copy now at: 4b4c714b36aa
|
Working copy now at: 4b4c714b36aa (no description set)
|
||||||
```
|
```
|
||||||
That will bring up Meld with a diff of the changes in the "ABCD" commit. Modify
|
That will bring up Meld with a diff of the changes in the "ABCD" commit. Modify
|
||||||
the right side of the diff to have the desired end state in "ABC" by removing
|
the right side of the diff to have the desired end state in "ABC" by removing
|
||||||
|
@ -392,7 +392,7 @@ checking it out.
|
||||||
$ jj edit -r @--
|
$ jj edit -r @--
|
||||||
Created 2423c134ea70 ABC
|
Created 2423c134ea70 ABC
|
||||||
Rebased 2 descendant commits
|
Rebased 2 descendant commits
|
||||||
Working copy now at: d31c52e8ca41
|
Working copy now at: d31c52e8ca41 (no description set)
|
||||||
Added 0 files, modified 1 files, removed 0 files
|
Added 0 files, modified 1 files, removed 0 files
|
||||||
```
|
```
|
||||||
When Meld starts, edit the right side by e.g. adding something to the first
|
When Meld starts, edit the right side by e.g. adding something to the first
|
||||||
|
|
|
@ -175,6 +175,8 @@ impl<'r> TemplateProperty<Commit, String> for DescriptionProperty {
|
||||||
let description = context.description().to_owned();
|
let description = context.description().to_owned();
|
||||||
if description.ends_with('\n') {
|
if description.ends_with('\n') {
|
||||||
description
|
description
|
||||||
|
} else if description.is_empty() {
|
||||||
|
"(no description set)\n".to_string()
|
||||||
} else {
|
} else {
|
||||||
description.add("\n")
|
description.add("\n")
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,8 +25,8 @@ fn smoke_test() {
|
||||||
// Check the output of `jj status` right after initializing repo
|
// Check the output of `jj status` right after initializing repo
|
||||||
let stdout = test_env.jj_cmd_success(&repo_path, &["status"]);
|
let stdout = test_env.jj_cmd_success(&repo_path, &["status"]);
|
||||||
insta::assert_snapshot!(stdout, @r###"
|
insta::assert_snapshot!(stdout, @r###"
|
||||||
Parent commit: 000000000000
|
Parent commit: 000000000000 (no description set)
|
||||||
Working copy : 230dd059e1b0
|
Working copy : 230dd059e1b0 (no description set)
|
||||||
The working copy is clean
|
The working copy is clean
|
||||||
"###);
|
"###);
|
||||||
|
|
||||||
|
@ -38,8 +38,8 @@ fn smoke_test() {
|
||||||
// The working copy's ID should have changed
|
// The working copy's ID should have changed
|
||||||
let stdout = test_env.jj_cmd_success(&repo_path, &["status"]);
|
let stdout = test_env.jj_cmd_success(&repo_path, &["status"]);
|
||||||
insta::assert_snapshot!(stdout, @r###"
|
insta::assert_snapshot!(stdout, @r###"
|
||||||
Parent commit: 000000000000
|
Parent commit: 000000000000 (no description set)
|
||||||
Working copy : d38745675403
|
Working copy : d38745675403 (no description set)
|
||||||
Working copy changes:
|
Working copy changes:
|
||||||
A file1
|
A file1
|
||||||
A file2
|
A file2
|
||||||
|
@ -59,6 +59,6 @@ fn smoke_test() {
|
||||||
// Close the commit
|
// Close the commit
|
||||||
let stdout = test_env.jj_cmd_success(&repo_path, &["close"]);
|
let stdout = test_env.jj_cmd_success(&repo_path, &["close"]);
|
||||||
insta::assert_snapshot!(stdout, @r###"
|
insta::assert_snapshot!(stdout, @r###"
|
||||||
Working copy now at: a13f828fab1a
|
Working copy now at: a13f828fab1a (no description set)
|
||||||
"###);
|
"###);
|
||||||
}
|
}
|
||||||
|
|
|
@ -65,7 +65,7 @@ fn test_alias_cannot_override_builtin() {
|
||||||
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-r", "root"]);
|
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-r", "root"]);
|
||||||
insta::assert_snapshot!(stdout, @r###"
|
insta::assert_snapshot!(stdout, @r###"
|
||||||
o 000000000000 000000000000 1970-01-01 00:00:00.000 +00:00
|
o 000000000000 000000000000 1970-01-01 00:00:00.000 +00:00
|
||||||
|
(no description set)
|
||||||
"###);
|
"###);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,7 @@ fn test_concurrent_operation_divergence() {
|
||||||
o message 2
|
o message 2
|
||||||
| @ message 1
|
| @ message 1
|
||||||
|/
|
|/
|
||||||
o
|
o (no description set)
|
||||||
"###);
|
"###);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -63,6 +63,6 @@ fn test_concurrent_operations_auto_rebase() {
|
||||||
Rebased 1 descendant commits onto commits rewritten by other operation
|
Rebased 1 descendant commits onto commits rewritten by other operation
|
||||||
o 4eeb7d76372418118a91c34f09e5e3936f0deeb5 new child
|
o 4eeb7d76372418118a91c34f09e5e3936f0deeb5 new child
|
||||||
@ 14176aeadc0259b2150fc7374969e74b1552a498 rewritten
|
@ 14176aeadc0259b2150fc7374969e74b1552a498 rewritten
|
||||||
o 0000000000000000000000000000000000000000
|
o 0000000000000000000000000000000000000000 (no description set)
|
||||||
"###);
|
"###);
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,8 +63,8 @@ fn test_edit() {
|
||||||
std::fs::write(&edit_script, "reset file2").unwrap();
|
std::fs::write(&edit_script, "reset file2").unwrap();
|
||||||
let stdout = test_env.jj_cmd_success(&repo_path, &["edit"]);
|
let stdout = test_env.jj_cmd_success(&repo_path, &["edit"]);
|
||||||
insta::assert_snapshot!(stdout, @r###"
|
insta::assert_snapshot!(stdout, @r###"
|
||||||
Created 8c79910b5033
|
Created 8c79910b5033 (no description set)
|
||||||
Working copy now at: 8c79910b5033
|
Working copy now at: 8c79910b5033 (no description set)
|
||||||
Added 0 files, modified 1 files, removed 0 files
|
Added 0 files, modified 1 files, removed 0 files
|
||||||
"###);
|
"###);
|
||||||
let stdout = test_env.jj_cmd_success(&repo_path, &["diff", "-s"]);
|
let stdout = test_env.jj_cmd_success(&repo_path, &["diff", "-s"]);
|
||||||
|
@ -77,9 +77,9 @@ fn test_edit() {
|
||||||
std::fs::write(&edit_script, "write file3\nmodified\n").unwrap();
|
std::fs::write(&edit_script, "write file3\nmodified\n").unwrap();
|
||||||
let stdout = test_env.jj_cmd_success(&repo_path, &["edit", "-r", "@-"]);
|
let stdout = test_env.jj_cmd_success(&repo_path, &["edit", "-r", "@-"]);
|
||||||
insta::assert_snapshot!(stdout, @r###"
|
insta::assert_snapshot!(stdout, @r###"
|
||||||
Created 472de2debaff
|
Created 472de2debaff (no description set)
|
||||||
Rebased 1 descendant commits
|
Rebased 1 descendant commits
|
||||||
Working copy now at: 6d19dc1ea106
|
Working copy now at: 6d19dc1ea106 (no description set)
|
||||||
Added 0 files, modified 1 files, removed 0 files
|
Added 0 files, modified 1 files, removed 0 files
|
||||||
"###);
|
"###);
|
||||||
let contents = String::from_utf8(std::fs::read(repo_path.join("file3")).unwrap()).unwrap();
|
let contents = String::from_utf8(std::fs::read(repo_path.join("file3")).unwrap()).unwrap();
|
||||||
|
@ -130,7 +130,7 @@ fn test_edit_merge() {
|
||||||
insta::assert_snapshot!(stdout, @r###"
|
insta::assert_snapshot!(stdout, @r###"
|
||||||
Created 608f32ad9e19 merge
|
Created 608f32ad9e19 merge
|
||||||
Rebased 1 descendant commits
|
Rebased 1 descendant commits
|
||||||
Working copy now at: a791bdbda05c
|
Working copy now at: a791bdbda05c (no description set)
|
||||||
Added 0 files, modified 0 files, removed 1 files
|
Added 0 files, modified 0 files, removed 1 files
|
||||||
"###);
|
"###);
|
||||||
let stdout = test_env.jj_cmd_success(&repo_path, &["diff", "-s", "-r", "@-"]);
|
let stdout = test_env.jj_cmd_success(&repo_path, &["diff", "-s", "-r", "@-"]);
|
||||||
|
|
|
@ -72,7 +72,7 @@ fn test_git_colocated_rebase_on_import() {
|
||||||
test_env.jj_cmd_success(&workspace_root, &["log", "-T", "commit_id \" \" branches"]);
|
test_env.jj_cmd_success(&workspace_root, &["log", "-T", "commit_id \" \" branches"]);
|
||||||
insta::assert_snapshot!(stdout, @r###"
|
insta::assert_snapshot!(stdout, @r###"
|
||||||
Rebased 1 descendant commits off of commits rewritten from git
|
Rebased 1 descendant commits off of commits rewritten from git
|
||||||
Working copy now at: a64f325e0516
|
Working copy now at: a64f325e0516 (no description set)
|
||||||
Added 0 files, modified 1 files, removed 0 files
|
Added 0 files, modified 1 files, removed 0 files
|
||||||
@ a64f325e05167129f3488f85a570f22a8940634f
|
@ a64f325e05167129f3488f85a570f22a8940634f
|
||||||
o f0f3ab56bfa927e3a65c2ac9a513693d438e271b master
|
o f0f3ab56bfa927e3a65c2ac9a513693d438e271b master
|
||||||
|
|
|
@ -85,7 +85,7 @@ fn test_init_git_external() {
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
insta::assert_snapshot!(stdout, @r###"
|
insta::assert_snapshot!(stdout, @r###"
|
||||||
Working copy now at: f6950fc115ae
|
Working copy now at: f6950fc115ae (no description set)
|
||||||
Added 1 files, modified 0 files, removed 0 files
|
Added 1 files, modified 0 files, removed 0 files
|
||||||
Initialized repo in "repo"
|
Initialized repo in "repo"
|
||||||
"###);
|
"###);
|
||||||
|
|
|
@ -31,7 +31,7 @@ fn test_log_with_or_without_diff() {
|
||||||
insta::assert_snapshot!(stdout, @r###"
|
insta::assert_snapshot!(stdout, @r###"
|
||||||
@ a new commit
|
@ a new commit
|
||||||
o add a file
|
o add a file
|
||||||
o
|
o (no description set)
|
||||||
"###);
|
"###);
|
||||||
|
|
||||||
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T", "description", "-p"]);
|
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T", "description", "-p"]);
|
||||||
|
@ -43,14 +43,14 @@ fn test_log_with_or_without_diff() {
|
||||||
o add a file
|
o add a file
|
||||||
| Added regular file file1:
|
| Added regular file file1:
|
||||||
| 1: foo
|
| 1: foo
|
||||||
o
|
o (no description set)
|
||||||
"###);
|
"###);
|
||||||
|
|
||||||
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T", "description", "--no-graph"]);
|
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T", "description", "--no-graph"]);
|
||||||
insta::assert_snapshot!(stdout, @r###"
|
insta::assert_snapshot!(stdout, @r###"
|
||||||
a new commit
|
a new commit
|
||||||
add a file
|
add a file
|
||||||
|
(no description set)
|
||||||
"###);
|
"###);
|
||||||
|
|
||||||
let stdout = test_env.jj_cmd_success(
|
let stdout = test_env.jj_cmd_success(
|
||||||
|
@ -74,7 +74,7 @@ fn test_log_with_or_without_diff() {
|
||||||
+++ b/file1
|
+++ b/file1
|
||||||
@@ -1,0 +1,1 @@
|
@@ -1,0 +1,1 @@
|
||||||
+foo
|
+foo
|
||||||
|
(no description set)
|
||||||
"###);
|
"###);
|
||||||
|
|
||||||
// `-s` implies `-p`, with or without graph
|
// `-s` implies `-p`, with or without graph
|
||||||
|
@ -84,7 +84,7 @@ fn test_log_with_or_without_diff() {
|
||||||
| M file1
|
| M file1
|
||||||
o add a file
|
o add a file
|
||||||
| A file1
|
| A file1
|
||||||
o
|
o (no description set)
|
||||||
"###);
|
"###);
|
||||||
let stdout = test_env.jj_cmd_success(
|
let stdout = test_env.jj_cmd_success(
|
||||||
&repo_path,
|
&repo_path,
|
||||||
|
@ -95,7 +95,7 @@ fn test_log_with_or_without_diff() {
|
||||||
M file1
|
M file1
|
||||||
add a file
|
add a file
|
||||||
A file1
|
A file1
|
||||||
|
(no description set)
|
||||||
"###);
|
"###);
|
||||||
|
|
||||||
// `--git` implies `-p`, with or without graph
|
// `--git` implies `-p`, with or without graph
|
||||||
|
@ -140,7 +140,7 @@ fn test_log_reversed() {
|
||||||
|
|
||||||
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T", "description", "--reversed"]);
|
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T", "description", "--reversed"]);
|
||||||
insta::assert_snapshot!(stdout, @r###"
|
insta::assert_snapshot!(stdout, @r###"
|
||||||
o
|
o (no description set)
|
||||||
o first
|
o first
|
||||||
@ second
|
@ second
|
||||||
"###);
|
"###);
|
||||||
|
@ -150,7 +150,7 @@ fn test_log_reversed() {
|
||||||
&["log", "-T", "description", "--reversed", "--no-graph"],
|
&["log", "-T", "description", "--reversed", "--no-graph"],
|
||||||
);
|
);
|
||||||
insta::assert_snapshot!(stdout, @r###"
|
insta::assert_snapshot!(stdout, @r###"
|
||||||
|
(no description set)
|
||||||
first
|
first
|
||||||
second
|
second
|
||||||
"###);
|
"###);
|
||||||
|
|
|
@ -78,7 +78,7 @@ fn test_move() {
|
||||||
// Can move from sibling, which results in the source being abandoned
|
// Can move from sibling, which results in the source being abandoned
|
||||||
let stdout = test_env.jj_cmd_success(&repo_path, &["move", "--from", "c"]);
|
let stdout = test_env.jj_cmd_success(&repo_path, &["move", "--from", "c"]);
|
||||||
insta::assert_snapshot!(stdout, @r###"
|
insta::assert_snapshot!(stdout, @r###"
|
||||||
Working copy now at: 1c03e3d3c63f
|
Working copy now at: 1c03e3d3c63f (no description set)
|
||||||
Added 0 files, modified 1 files, removed 0 files
|
Added 0 files, modified 1 files, removed 0 files
|
||||||
"###);
|
"###);
|
||||||
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
|
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
|
||||||
|
@ -105,7 +105,7 @@ fn test_move() {
|
||||||
test_env.jj_cmd_success(&repo_path, &["undo"]);
|
test_env.jj_cmd_success(&repo_path, &["undo"]);
|
||||||
let stdout = test_env.jj_cmd_success(&repo_path, &["move", "--from", "@--"]);
|
let stdout = test_env.jj_cmd_success(&repo_path, &["move", "--from", "@--"]);
|
||||||
insta::assert_snapshot!(stdout, @r###"
|
insta::assert_snapshot!(stdout, @r###"
|
||||||
Working copy now at: c8d83075e8c2
|
Working copy now at: c8d83075e8c2 (no description set)
|
||||||
"###);
|
"###);
|
||||||
// The change has been removed from the source (the change pointed to by 'd'
|
// The change has been removed from the source (the change pointed to by 'd'
|
||||||
// became empty and was abandoned)
|
// became empty and was abandoned)
|
||||||
|
@ -130,7 +130,7 @@ fn test_move() {
|
||||||
let stdout = test_env.jj_cmd_success(&repo_path, &["move", "--from", "e", "--to", "d"]);
|
let stdout = test_env.jj_cmd_success(&repo_path, &["move", "--from", "e", "--to", "d"]);
|
||||||
insta::assert_snapshot!(stdout, @r###"
|
insta::assert_snapshot!(stdout, @r###"
|
||||||
Rebased 1 descendant commits
|
Rebased 1 descendant commits
|
||||||
Working copy now at: 2b723b1d6033
|
Working copy now at: 2b723b1d6033 (no description set)
|
||||||
"###);
|
"###);
|
||||||
// The change has been removed from the source (the change pointed to by 'e'
|
// The change has been removed from the source (the change pointed to by 'e'
|
||||||
// became empty and was abandoned)
|
// became empty and was abandoned)
|
||||||
|
@ -193,7 +193,7 @@ fn test_move_partial() {
|
||||||
std::fs::write(&edit_script, "").unwrap();
|
std::fs::write(&edit_script, "").unwrap();
|
||||||
let stdout = test_env.jj_cmd_success(&repo_path, &["move", "-i", "--from", "c"]);
|
let stdout = test_env.jj_cmd_success(&repo_path, &["move", "-i", "--from", "c"]);
|
||||||
insta::assert_snapshot!(stdout, @r###"
|
insta::assert_snapshot!(stdout, @r###"
|
||||||
Working copy now at: 71b69e433fbc
|
Working copy now at: 71b69e433fbc (no description set)
|
||||||
Added 0 files, modified 2 files, removed 0 files
|
Added 0 files, modified 2 files, removed 0 files
|
||||||
"###);
|
"###);
|
||||||
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
|
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
|
||||||
|
@ -223,7 +223,7 @@ fn test_move_partial() {
|
||||||
std::fs::write(&edit_script, "reset file2").unwrap();
|
std::fs::write(&edit_script, "reset file2").unwrap();
|
||||||
let stdout = test_env.jj_cmd_success(&repo_path, &["move", "-i", "--from", "c"]);
|
let stdout = test_env.jj_cmd_success(&repo_path, &["move", "-i", "--from", "c"]);
|
||||||
insta::assert_snapshot!(stdout, @r###"
|
insta::assert_snapshot!(stdout, @r###"
|
||||||
Working copy now at: 63f1a6e96edb
|
Working copy now at: 63f1a6e96edb (no description set)
|
||||||
Added 0 files, modified 1 files, removed 0 files
|
Added 0 files, modified 1 files, removed 0 files
|
||||||
"###);
|
"###);
|
||||||
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
|
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
|
||||||
|
@ -256,7 +256,7 @@ fn test_move_partial() {
|
||||||
std::fs::write(&edit_script, "").unwrap();
|
std::fs::write(&edit_script, "").unwrap();
|
||||||
let stdout = test_env.jj_cmd_success(&repo_path, &["move", "--from", "c", "file1"]);
|
let stdout = test_env.jj_cmd_success(&repo_path, &["move", "--from", "c", "file1"]);
|
||||||
insta::assert_snapshot!(stdout, @r###"
|
insta::assert_snapshot!(stdout, @r###"
|
||||||
Working copy now at: 17c2e6632cc5
|
Working copy now at: 17c2e6632cc5 (no description set)
|
||||||
Added 0 files, modified 1 files, removed 0 files
|
Added 0 files, modified 1 files, removed 0 files
|
||||||
"###);
|
"###);
|
||||||
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
|
insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###"
|
||||||
|
|
|
@ -29,6 +29,6 @@ fn test_new_with_message() {
|
||||||
insta::assert_snapshot!(stdout, @r###"
|
insta::assert_snapshot!(stdout, @r###"
|
||||||
@ 88436dbcdbedc2b8a6ebd0687981906d09ccc68f a new commit
|
@ 88436dbcdbedc2b8a6ebd0687981906d09ccc68f a new commit
|
||||||
o 51e9c5819117991e4a6dc5a4a744283fc74f0746 add a file
|
o 51e9c5819117991e4a6dc5a4a744283fc74f0746 add a file
|
||||||
o 0000000000000000000000000000000000000000
|
o 0000000000000000000000000000000000000000 (no description set)
|
||||||
"###);
|
"###);
|
||||||
}
|
}
|
||||||
|
|
|
@ -139,7 +139,7 @@ fn test_rebase_branch_with_merge() {
|
||||||
let stdout = test_env.jj_cmd_success(&repo_path, &["rebase", "-b", "d", "-d", "b"]);
|
let stdout = test_env.jj_cmd_success(&repo_path, &["rebase", "-b", "d", "-d", "b"]);
|
||||||
insta::assert_snapshot!(stdout, @r###"
|
insta::assert_snapshot!(stdout, @r###"
|
||||||
Rebased 4 commits
|
Rebased 4 commits
|
||||||
Working copy now at: f6eecf0d8f36
|
Working copy now at: f6eecf0d8f36 (no description set)
|
||||||
Added 1 files, modified 0 files, removed 0 files
|
Added 1 files, modified 0 files, removed 0 files
|
||||||
"###);
|
"###);
|
||||||
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T", "branches"]);
|
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T", "branches"]);
|
||||||
|
@ -157,7 +157,7 @@ fn test_rebase_branch_with_merge() {
|
||||||
let stdout = test_env.jj_cmd_success(&repo_path, &["rebase", "-d", "b"]);
|
let stdout = test_env.jj_cmd_success(&repo_path, &["rebase", "-d", "b"]);
|
||||||
insta::assert_snapshot!(stdout, @r###"
|
insta::assert_snapshot!(stdout, @r###"
|
||||||
Rebased 4 commits
|
Rebased 4 commits
|
||||||
Working copy now at: a15dfb947f3f
|
Working copy now at: a15dfb947f3f (no description set)
|
||||||
Added 1 files, modified 0 files, removed 0 files
|
Added 1 files, modified 0 files, removed 0 files
|
||||||
"###);
|
"###);
|
||||||
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T", "branches"]);
|
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T", "branches"]);
|
||||||
|
@ -202,7 +202,7 @@ fn test_rebase_single_revision() {
|
||||||
let stdout = test_env.jj_cmd_success(&repo_path, &["rebase", "-r", "b", "-d", "a"]);
|
let stdout = test_env.jj_cmd_success(&repo_path, &["rebase", "-r", "b", "-d", "a"]);
|
||||||
insta::assert_snapshot!(stdout, @r###"
|
insta::assert_snapshot!(stdout, @r###"
|
||||||
Also rebased 3 descendant commits onto parent of rebased commit
|
Also rebased 3 descendant commits onto parent of rebased commit
|
||||||
Working copy now at: ee6a5a3f71d4
|
Working copy now at: ee6a5a3f71d4 (no description set)
|
||||||
Added 0 files, modified 0 files, removed 2 files
|
Added 0 files, modified 0 files, removed 2 files
|
||||||
"###);
|
"###);
|
||||||
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T", "branches"]);
|
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T", "branches"]);
|
||||||
|
@ -219,7 +219,7 @@ fn test_rebase_single_revision() {
|
||||||
let stdout = test_env.jj_cmd_success(&repo_path, &["rebase", "-r", "c", "-d", "root"]);
|
let stdout = test_env.jj_cmd_success(&repo_path, &["rebase", "-r", "c", "-d", "root"]);
|
||||||
insta::assert_snapshot!(stdout, @r###"
|
insta::assert_snapshot!(stdout, @r###"
|
||||||
Also rebased 2 descendant commits onto parent of rebased commit
|
Also rebased 2 descendant commits onto parent of rebased commit
|
||||||
Working copy now at: 6dc5b752c6ad
|
Working copy now at: 6dc5b752c6ad (no description set)
|
||||||
Added 0 files, modified 0 files, removed 1 files
|
Added 0 files, modified 0 files, removed 1 files
|
||||||
"###);
|
"###);
|
||||||
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T", "branches"]);
|
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T", "branches"]);
|
||||||
|
@ -300,7 +300,7 @@ fn test_rebase_with_descendants() {
|
||||||
let stdout = test_env.jj_cmd_success(&repo_path, &["rebase", "-s", "b", "-d", "a"]);
|
let stdout = test_env.jj_cmd_success(&repo_path, &["rebase", "-s", "b", "-d", "a"]);
|
||||||
insta::assert_snapshot!(stdout, @r###"
|
insta::assert_snapshot!(stdout, @r###"
|
||||||
Rebased 4 commits
|
Rebased 4 commits
|
||||||
Working copy now at: 60e083aa9086
|
Working copy now at: 60e083aa9086 (no description set)
|
||||||
"###);
|
"###);
|
||||||
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T", "branches"]);
|
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T", "branches"]);
|
||||||
insta::assert_snapshot!(stdout, @r###"
|
insta::assert_snapshot!(stdout, @r###"
|
||||||
|
|
|
@ -33,8 +33,8 @@ fn test_restore() {
|
||||||
// Restores from parent by default
|
// Restores from parent by default
|
||||||
let stdout = test_env.jj_cmd_success(&repo_path, &["restore"]);
|
let stdout = test_env.jj_cmd_success(&repo_path, &["restore"]);
|
||||||
insta::assert_snapshot!(stdout, @r###"
|
insta::assert_snapshot!(stdout, @r###"
|
||||||
Created b05f8b84f2fc
|
Created b05f8b84f2fc (no description set)
|
||||||
Working copy now at: b05f8b84f2fc
|
Working copy now at: b05f8b84f2fc (no description set)
|
||||||
Added 1 files, modified 1 files, removed 1 files
|
Added 1 files, modified 1 files, removed 1 files
|
||||||
"###);
|
"###);
|
||||||
let stdout = test_env.jj_cmd_success(&repo_path, &["diff", "-s"]);
|
let stdout = test_env.jj_cmd_success(&repo_path, &["diff", "-s"]);
|
||||||
|
@ -44,8 +44,8 @@ fn test_restore() {
|
||||||
test_env.jj_cmd_success(&repo_path, &["undo"]);
|
test_env.jj_cmd_success(&repo_path, &["undo"]);
|
||||||
let stdout = test_env.jj_cmd_success(&repo_path, &["restore", "--from", "@--"]);
|
let stdout = test_env.jj_cmd_success(&repo_path, &["restore", "--from", "@--"]);
|
||||||
insta::assert_snapshot!(stdout, @r###"
|
insta::assert_snapshot!(stdout, @r###"
|
||||||
Created 9cb58509136b
|
Created 9cb58509136b (no description set)
|
||||||
Working copy now at: 9cb58509136b
|
Working copy now at: 9cb58509136b (no description set)
|
||||||
Added 1 files, modified 0 files, removed 2 files
|
Added 1 files, modified 0 files, removed 2 files
|
||||||
"###);
|
"###);
|
||||||
let stdout = test_env.jj_cmd_success(&repo_path, &["diff", "-s"]);
|
let stdout = test_env.jj_cmd_success(&repo_path, &["diff", "-s"]);
|
||||||
|
@ -57,9 +57,9 @@ fn test_restore() {
|
||||||
test_env.jj_cmd_success(&repo_path, &["undo"]);
|
test_env.jj_cmd_success(&repo_path, &["undo"]);
|
||||||
let stdout = test_env.jj_cmd_success(&repo_path, &["restore", "--to", "@-"]);
|
let stdout = test_env.jj_cmd_success(&repo_path, &["restore", "--to", "@-"]);
|
||||||
insta::assert_snapshot!(stdout, @r###"
|
insta::assert_snapshot!(stdout, @r###"
|
||||||
Created 5ed06151e039
|
Created 5ed06151e039 (no description set)
|
||||||
Rebased 1 descendant commits
|
Rebased 1 descendant commits
|
||||||
Working copy now at: ca6c95b68bd2
|
Working copy now at: ca6c95b68bd2 (no description set)
|
||||||
"###);
|
"###);
|
||||||
let stdout = test_env.jj_cmd_success(&repo_path, &["diff", "-s"]);
|
let stdout = test_env.jj_cmd_success(&repo_path, &["diff", "-s"]);
|
||||||
insta::assert_snapshot!(stdout, @"");
|
insta::assert_snapshot!(stdout, @"");
|
||||||
|
@ -74,9 +74,9 @@ fn test_restore() {
|
||||||
test_env.jj_cmd_success(&repo_path, &["undo"]);
|
test_env.jj_cmd_success(&repo_path, &["undo"]);
|
||||||
let stdout = test_env.jj_cmd_success(&repo_path, &["restore", "--from", "@", "--to", "@-"]);
|
let stdout = test_env.jj_cmd_success(&repo_path, &["restore", "--from", "@", "--to", "@-"]);
|
||||||
insta::assert_snapshot!(stdout, @r###"
|
insta::assert_snapshot!(stdout, @r###"
|
||||||
Created c83e17dc46fd
|
Created c83e17dc46fd (no description set)
|
||||||
Rebased 1 descendant commits
|
Rebased 1 descendant commits
|
||||||
Working copy now at: df9fb6892f99
|
Working copy now at: df9fb6892f99 (no description set)
|
||||||
"###);
|
"###);
|
||||||
let stdout = test_env.jj_cmd_success(&repo_path, &["diff", "-s"]);
|
let stdout = test_env.jj_cmd_success(&repo_path, &["diff", "-s"]);
|
||||||
insta::assert_snapshot!(stdout, @"");
|
insta::assert_snapshot!(stdout, @"");
|
||||||
|
@ -91,8 +91,8 @@ fn test_restore() {
|
||||||
test_env.jj_cmd_success(&repo_path, &["undo"]);
|
test_env.jj_cmd_success(&repo_path, &["undo"]);
|
||||||
let stdout = test_env.jj_cmd_success(&repo_path, &["restore", "file2", "file3"]);
|
let stdout = test_env.jj_cmd_success(&repo_path, &["restore", "file2", "file3"]);
|
||||||
insta::assert_snapshot!(stdout, @r###"
|
insta::assert_snapshot!(stdout, @r###"
|
||||||
Created 28647642d4a5
|
Created 28647642d4a5 (no description set)
|
||||||
Working copy now at: 28647642d4a5
|
Working copy now at: 28647642d4a5 (no description set)
|
||||||
Added 0 files, modified 1 files, removed 1 files
|
Added 0 files, modified 1 files, removed 1 files
|
||||||
"###);
|
"###);
|
||||||
let stdout = test_env.jj_cmd_success(&repo_path, &["diff", "-s"]);
|
let stdout = test_env.jj_cmd_success(&repo_path, &["diff", "-s"]);
|
||||||
|
@ -146,8 +146,8 @@ fn test_restore_interactive() {
|
||||||
std::fs::write(&edit_script, "reset file2\0reset file3").unwrap();
|
std::fs::write(&edit_script, "reset file2\0reset file3").unwrap();
|
||||||
let stdout = test_env.jj_cmd_success(&repo_path, &["restore", "-i"]);
|
let stdout = test_env.jj_cmd_success(&repo_path, &["restore", "-i"]);
|
||||||
insta::assert_snapshot!(stdout, @r###"
|
insta::assert_snapshot!(stdout, @r###"
|
||||||
Created abdbf6271a1c
|
Created abdbf6271a1c (no description set)
|
||||||
Working copy now at: abdbf6271a1c
|
Working copy now at: abdbf6271a1c (no description set)
|
||||||
Added 0 files, modified 1 files, removed 1 files
|
Added 0 files, modified 1 files, removed 1 files
|
||||||
"###);
|
"###);
|
||||||
let stdout = test_env.jj_cmd_success(&repo_path, &["diff", "-s"]);
|
let stdout = test_env.jj_cmd_success(&repo_path, &["diff", "-s"]);
|
||||||
|
@ -160,8 +160,8 @@ fn test_restore_interactive() {
|
||||||
std::fs::write(&edit_script, "write file3\nunrelated\n").unwrap();
|
std::fs::write(&edit_script, "write file3\nunrelated\n").unwrap();
|
||||||
let stdout = test_env.jj_cmd_success(&repo_path, &["restore", "-i"]);
|
let stdout = test_env.jj_cmd_success(&repo_path, &["restore", "-i"]);
|
||||||
insta::assert_snapshot!(stdout, @r###"
|
insta::assert_snapshot!(stdout, @r###"
|
||||||
Created e31f7f33ad07
|
Created e31f7f33ad07 (no description set)
|
||||||
Working copy now at: e31f7f33ad07
|
Working copy now at: e31f7f33ad07 (no description set)
|
||||||
Added 0 files, modified 1 files, removed 0 files
|
Added 0 files, modified 1 files, removed 0 files
|
||||||
"###);
|
"###);
|
||||||
let stdout = test_env.jj_cmd_success(&repo_path, &["diff", "--git"]);
|
let stdout = test_env.jj_cmd_success(&repo_path, &["diff", "--git"]);
|
||||||
|
|
|
@ -36,9 +36,9 @@ fn test_split() {
|
||||||
std::fs::write(edit_script, "").unwrap();
|
std::fs::write(edit_script, "").unwrap();
|
||||||
let stdout = test_env.jj_cmd_success(&repo_path, &["split", "file2"]);
|
let stdout = test_env.jj_cmd_success(&repo_path, &["split", "file2"]);
|
||||||
insta::assert_snapshot!(stdout, @r###"
|
insta::assert_snapshot!(stdout, @r###"
|
||||||
First part: 5eebce1de3b0
|
First part: 5eebce1de3b0 (no description set)
|
||||||
Second part: 45833353d94e
|
Second part: 45833353d94e (no description set)
|
||||||
Working copy now at: 45833353d94e
|
Working copy now at: 45833353d94e (no description set)
|
||||||
"###);
|
"###);
|
||||||
|
|
||||||
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T", "commit_id.short()"]);
|
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T", "commit_id.short()"]);
|
||||||
|
|
|
@ -43,7 +43,7 @@ fn test_squash() {
|
||||||
// Squashes the working copy into the parent by default
|
// Squashes the working copy into the parent by default
|
||||||
let stdout = test_env.jj_cmd_success(&repo_path, &["squash"]);
|
let stdout = test_env.jj_cmd_success(&repo_path, &["squash"]);
|
||||||
insta::assert_snapshot!(stdout, @r###"
|
insta::assert_snapshot!(stdout, @r###"
|
||||||
Working copy now at: 6ca29c9d2e7c
|
Working copy now at: 6ca29c9d2e7c (no description set)
|
||||||
"###);
|
"###);
|
||||||
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T", template]);
|
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T", template]);
|
||||||
insta::assert_snapshot!(stdout, @r###"
|
insta::assert_snapshot!(stdout, @r###"
|
||||||
|
@ -61,7 +61,7 @@ fn test_squash() {
|
||||||
let stdout = test_env.jj_cmd_success(&repo_path, &["squash", "-r", "b"]);
|
let stdout = test_env.jj_cmd_success(&repo_path, &["squash", "-r", "b"]);
|
||||||
insta::assert_snapshot!(stdout, @r###"
|
insta::assert_snapshot!(stdout, @r###"
|
||||||
Rebased 1 descendant commits
|
Rebased 1 descendant commits
|
||||||
Working copy now at: e87cf8ebc7e1
|
Working copy now at: e87cf8ebc7e1 (no description set)
|
||||||
"###);
|
"###);
|
||||||
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T", template]);
|
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T", template]);
|
||||||
insta::assert_snapshot!(stdout, @r###"
|
insta::assert_snapshot!(stdout, @r###"
|
||||||
|
@ -108,7 +108,7 @@ fn test_squash() {
|
||||||
std::fs::write(repo_path.join("file1"), "e\n").unwrap();
|
std::fs::write(repo_path.join("file1"), "e\n").unwrap();
|
||||||
let stdout = test_env.jj_cmd_success(&repo_path, &["squash"]);
|
let stdout = test_env.jj_cmd_success(&repo_path, &["squash"]);
|
||||||
insta::assert_snapshot!(stdout, @r###"
|
insta::assert_snapshot!(stdout, @r###"
|
||||||
Working copy now at: 626d78245205
|
Working copy now at: 626d78245205 (no description set)
|
||||||
"###);
|
"###);
|
||||||
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T", template]);
|
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T", template]);
|
||||||
insta::assert_snapshot!(stdout, @r###"
|
insta::assert_snapshot!(stdout, @r###"
|
||||||
|
@ -162,7 +162,7 @@ fn test_squash_partial() {
|
||||||
let stdout = test_env.jj_cmd_success(&repo_path, &["squash", "-r", "b", "-i"]);
|
let stdout = test_env.jj_cmd_success(&repo_path, &["squash", "-r", "b", "-i"]);
|
||||||
insta::assert_snapshot!(stdout, @r###"
|
insta::assert_snapshot!(stdout, @r###"
|
||||||
Rebased 1 descendant commits
|
Rebased 1 descendant commits
|
||||||
Working copy now at: f03d5ce4a973
|
Working copy now at: f03d5ce4a973 (no description set)
|
||||||
"###);
|
"###);
|
||||||
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T", template]);
|
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T", template]);
|
||||||
insta::assert_snapshot!(stdout, @r###"
|
insta::assert_snapshot!(stdout, @r###"
|
||||||
|
@ -181,7 +181,7 @@ fn test_squash_partial() {
|
||||||
let stdout = test_env.jj_cmd_success(&repo_path, &["squash", "-r", "b", "-i"]);
|
let stdout = test_env.jj_cmd_success(&repo_path, &["squash", "-r", "b", "-i"]);
|
||||||
insta::assert_snapshot!(stdout, @r###"
|
insta::assert_snapshot!(stdout, @r###"
|
||||||
Rebased 1 descendant commits
|
Rebased 1 descendant commits
|
||||||
Working copy now at: e7a40106bee6
|
Working copy now at: e7a40106bee6 (no description set)
|
||||||
"###);
|
"###);
|
||||||
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T", template]);
|
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T", template]);
|
||||||
insta::assert_snapshot!(stdout, @r###"
|
insta::assert_snapshot!(stdout, @r###"
|
||||||
|
@ -214,7 +214,7 @@ fn test_squash_partial() {
|
||||||
let stdout = test_env.jj_cmd_success(&repo_path, &["squash", "-r", "b", "file2"]);
|
let stdout = test_env.jj_cmd_success(&repo_path, &["squash", "-r", "b", "file2"]);
|
||||||
insta::assert_snapshot!(stdout, @r###"
|
insta::assert_snapshot!(stdout, @r###"
|
||||||
Rebased 1 descendant commits
|
Rebased 1 descendant commits
|
||||||
Working copy now at: a911fa1d0627
|
Working copy now at: a911fa1d0627 (no description set)
|
||||||
"###);
|
"###);
|
||||||
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T", template]);
|
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T", template]);
|
||||||
insta::assert_snapshot!(stdout, @r###"
|
insta::assert_snapshot!(stdout, @r###"
|
||||||
|
|
|
@ -33,7 +33,7 @@ fn test_undo_rewrite_with_child() {
|
||||||
insta::assert_snapshot!(stdout, @r###"
|
insta::assert_snapshot!(stdout, @r###"
|
||||||
@ child
|
@ child
|
||||||
o modified
|
o modified
|
||||||
o
|
o (no description set)
|
||||||
"###);
|
"###);
|
||||||
test_env.jj_cmd_success(&repo_path, &["undo", &op_id_hex]);
|
test_env.jj_cmd_success(&repo_path, &["undo", &op_id_hex]);
|
||||||
|
|
||||||
|
@ -43,6 +43,6 @@ fn test_undo_rewrite_with_child() {
|
||||||
insta::assert_snapshot!(stdout, @r###"
|
insta::assert_snapshot!(stdout, @r###"
|
||||||
@ child
|
@ child
|
||||||
o initial
|
o initial
|
||||||
o
|
o (no description set)
|
||||||
"###);
|
"###);
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,7 +33,7 @@ fn test_workspaces_add_second_workspace() {
|
||||||
|
|
||||||
let stdout = test_env.jj_cmd_success(&main_path, &["workspace", "list"]);
|
let stdout = test_env.jj_cmd_success(&main_path, &["workspace", "list"]);
|
||||||
insta::assert_snapshot!(stdout, @r###"
|
insta::assert_snapshot!(stdout, @r###"
|
||||||
default: 988d8c1dca7e
|
default: 988d8c1dca7e (no description set)
|
||||||
"###);
|
"###);
|
||||||
|
|
||||||
let stdout = test_env.jj_cmd_success(
|
let stdout = test_env.jj_cmd_success(
|
||||||
|
@ -42,7 +42,7 @@ fn test_workspaces_add_second_workspace() {
|
||||||
);
|
);
|
||||||
insta::assert_snapshot!(stdout.replace('\\', "/"), @r###"
|
insta::assert_snapshot!(stdout.replace('\\', "/"), @r###"
|
||||||
Created workspace in "../secondary"
|
Created workspace in "../secondary"
|
||||||
Working copy now at: 8ac248e0c8d2
|
Working copy now at: 8ac248e0c8d2 (no description set)
|
||||||
Added 1 files, modified 0 files, removed 0 files
|
Added 1 files, modified 0 files, removed 0 files
|
||||||
"###);
|
"###);
|
||||||
|
|
||||||
|
@ -66,8 +66,8 @@ fn test_workspaces_add_second_workspace() {
|
||||||
// Both workspaces show up when we list them
|
// Both workspaces show up when we list them
|
||||||
let stdout = test_env.jj_cmd_success(&main_path, &["workspace", "list"]);
|
let stdout = test_env.jj_cmd_success(&main_path, &["workspace", "list"]);
|
||||||
insta::assert_snapshot!(stdout, @r###"
|
insta::assert_snapshot!(stdout, @r###"
|
||||||
default: 988d8c1dca7e
|
default: 988d8c1dca7e (no description set)
|
||||||
second: 8ac248e0c8d2
|
second: 8ac248e0c8d2 (no description set)
|
||||||
"###);
|
"###);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -101,7 +101,7 @@ fn test_workspaces_conflicting_edits() {
|
||||||
let stdout = test_env.jj_cmd_success(&main_path, &["squash"]);
|
let stdout = test_env.jj_cmd_success(&main_path, &["squash"]);
|
||||||
insta::assert_snapshot!(stdout, @r###"
|
insta::assert_snapshot!(stdout, @r###"
|
||||||
Rebased 1 descendant commits
|
Rebased 1 descendant commits
|
||||||
Working copy now at: 86bef7fee095
|
Working copy now at: 86bef7fee095 (no description set)
|
||||||
"###);
|
"###);
|
||||||
|
|
||||||
// The secondary workspace's checkout was updated
|
// The secondary workspace's checkout was updated
|
||||||
|
@ -143,7 +143,7 @@ fn test_workspaces_forget() {
|
||||||
// When listing workspaces, only the secondary workspace shows up
|
// When listing workspaces, only the secondary workspace shows up
|
||||||
let stdout = test_env.jj_cmd_success(&main_path, &["workspace", "list"]);
|
let stdout = test_env.jj_cmd_success(&main_path, &["workspace", "list"]);
|
||||||
insta::assert_snapshot!(stdout, @r###"
|
insta::assert_snapshot!(stdout, @r###"
|
||||||
secondary: 39a6d6c6f295
|
secondary: 39a6d6c6f295 (no description set)
|
||||||
"###);
|
"###);
|
||||||
|
|
||||||
// `jj status` tells us that there's no working copy here
|
// `jj status` tells us that there's no working copy here
|
||||||
|
|
Loading…
Reference in a new issue