-
Notifications
You must be signed in to change notification settings - Fork 378
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cli: Add an option to record consecutive snapshots as a single op
- Loading branch information
Showing
8 changed files
with
96 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,3 +30,31 @@ fn test_snapshot_large_file() { | |
want this file to be snapshotted. Otherwise add it to your `.gitignore` file. | ||
"###); | ||
} | ||
|
||
#[test] | ||
fn test_consecutive_snapshots() { | ||
let test_env = TestEnvironment::default(); | ||
test_env.jj_cmd_ok(test_env.env_root(), &["init", "repo", "--git"]); | ||
let repo_path = test_env.env_root().join("repo"); | ||
|
||
test_env.add_config(r#"snapshot.squash-consecutive-snapshots = true"#); | ||
|
||
std::fs::write(repo_path.join("a"), "").unwrap(); | ||
test_env.jj_cmd_success(&repo_path, &["log"]); | ||
|
||
std::fs::write(repo_path.join("b"), "").unwrap(); | ||
test_env.jj_cmd_success(&repo_path, &["log"]); | ||
|
||
let stdout = test_env.jj_cmd_success(&repo_path, &["operation", "log"]); | ||
insta::assert_snapshot!(stdout, @r###" | ||
@ a0f9fa640725 [email protected] 2001-02-03 04:05:09.000 +07:00 - 2001-02-03 04:05:09.000 +07:00 | ||
│ snapshot working copy | ||
│ args: jj log | ||
│ snapshots: 2 | ||
◉ 6ac4339ad699 [email protected] 2001-02-03 04:05:07.000 +07:00 - 2001-02-03 04:05:07.000 +07:00 | ||
│ add workspace 'default' | ||
◉ 1b0049c19762 [email protected] 2001-02-03 04:05:07.000 +07:00 - 2001-02-03 04:05:07.000 +07:00 | ||
│ initialize repo | ||
◉ 000000000000 root() | ||
"###); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters