From 14b52205fb7585d34ffb592f6f7f0dc95471cdff Mon Sep 17 00:00:00 2001 From: Yuya Nishihara Date: Mon, 30 Dec 2024 17:35:24 +0900 Subject: [PATCH] repo: remove &UserSettings argument from start_transaction(), use self.settings --- cli/src/cli_util.rs | 24 +-- cli/src/commands/git/init.rs | 2 +- cli/src/commands/operation/diff.rs | 2 +- lib/src/repo.rs | 9 +- lib/src/working_copy.rs | 2 +- lib/src/workspace.rs | 2 +- lib/tests/test_annotate.rs | 12 +- lib/tests/test_bad_locking.rs | 10 +- lib/tests/test_commit_builder.rs | 24 +-- lib/tests/test_commit_concurrent.rs | 4 +- .../test_default_revset_graph_iterator.rs | 12 +- lib/tests/test_git.rs | 152 +++++++++--------- lib/tests/test_git_backend.rs | 4 +- lib/tests/test_id_prefix.rs | 6 +- lib/tests/test_index.rs | 40 ++--- lib/tests/test_init.rs | 8 +- lib/tests/test_load_repo.rs | 4 +- lib/tests/test_local_working_copy.rs | 4 +- lib/tests/test_merge_trees.rs | 4 +- lib/tests/test_mut_repo.rs | 88 +++++----- lib/tests/test_operations.rs | 34 ++-- lib/tests/test_refs.rs | 2 +- lib/tests/test_revset.rs | 109 +++++++------ lib/tests/test_rewrite.rs | 86 +++++----- lib/tests/test_rewrite_duplicate.rs | 20 +-- lib/tests/test_rewrite_transform.rs | 4 +- lib/tests/test_signing.rs | 14 +- lib/tests/test_view.rs | 64 ++++---- 28 files changed, 364 insertions(+), 382 deletions(-) diff --git a/cli/src/cli_util.rs b/cli/src/cli_util.rs index d8b1101887..74ee197d60 100644 --- a/cli/src/cli_util.rs +++ b/cli/src/cli_util.rs @@ -578,11 +578,7 @@ impl CommandHelper { )?; let base_repo = repo_loader.load_at(&op_heads[0])?; // TODO: It may be helpful to print each operation we're merging here - let mut tx = start_repo_transaction( - &base_repo, - &self.data.settings, - &self.data.string_args, - ); + let mut tx = start_repo_transaction(&base_repo, &self.data.string_args); for other_op_head in op_heads.into_iter().skip(1) { tx.merge_operation(other_op_head)?; let num_rebased = tx.repo_mut().rebase_descendants(&self.data.settings)?; @@ -1841,11 +1837,8 @@ See https://jj-vcs.github.io/jj/latest/working-copy/#stale-working-copy \ .map_err(snapshot_command_error)? }; if new_tree_id != *wc_commit.tree_id() { - let mut tx = start_repo_transaction( - &self.user_repo.repo, - self.env.settings(), - self.env.command.string_args(), - ); + let mut tx = + start_repo_transaction(&self.user_repo.repo, self.env.command.string_args()); tx.set_is_snapshot(true); let mut_repo = tx.repo_mut(); let commit = mut_repo @@ -1933,8 +1926,7 @@ See https://jj-vcs.github.io/jj/latest/working-copy/#stale-working-copy \ } pub fn start_transaction(&mut self) -> WorkspaceCommandTransaction { - let tx = - start_repo_transaction(self.repo(), self.settings(), self.env.command.string_args()); + let tx = start_repo_transaction(self.repo(), self.env.command.string_args()); let id_prefix_context = mem::take(&mut self.user_repo.id_prefix_context); WorkspaceCommandTransaction { helper: self, @@ -2424,12 +2416,8 @@ jj git init --colocate", } } -pub fn start_repo_transaction( - repo: &Arc, - settings: &UserSettings, - string_args: &[String], -) -> Transaction { - let mut tx = repo.start_transaction(settings); +pub fn start_repo_transaction(repo: &Arc, string_args: &[String]) -> Transaction { + let mut tx = repo.start_transaction(); // TODO: Either do better shell-escaping here or store the values in some list // type (which we currently don't have). let shell_escape = |arg: &String| { diff --git a/cli/src/commands/git/init.rs b/cli/src/commands/git/init.rs index 322ece2180..b4399da0d9 100644 --- a/cli/src/commands/git/init.rs +++ b/cli/src/commands/git/init.rs @@ -203,7 +203,7 @@ fn init_git_refs( repo: Arc, colocated: bool, ) -> Result, CommandError> { - let mut tx = start_repo_transaction(&repo, command.settings(), command.string_args()); + let mut tx = start_repo_transaction(&repo, command.string_args()); // There should be no old refs to abandon, but enforce it. let mut git_settings = command.settings().git_settings()?; git_settings.abandon_unreachable_commits = false; diff --git a/cli/src/commands/operation/diff.rs b/cli/src/commands/operation/diff.rs index 16622cc182..1523c1ab04 100644 --- a/cli/src/commands/operation/diff.rs +++ b/cli/src/commands/operation/diff.rs @@ -116,7 +116,7 @@ pub fn cmd_op_diff( let to_repo = repo_loader.load_at(&to_op)?; // Create a new transaction starting from `to_repo`. - let mut tx = to_repo.start_transaction(command.settings()); + let mut tx = to_repo.start_transaction(); // Merge index from `from_repo` to `to_repo`, so commits in `from_repo` are // accessible. tx.repo_mut().merge_index(&from_repo); diff --git a/lib/src/repo.rs b/lib/src/repo.rs index b630b29b53..8ab7ce541e 100644 --- a/lib/src/repo.rs +++ b/lib/src/repo.rs @@ -295,12 +295,9 @@ impl ReadonlyRepo { self.loader.settings() } - pub fn start_transaction( - self: &Arc, - user_settings: &UserSettings, - ) -> Transaction { + pub fn start_transaction(self: &Arc) -> Transaction { let mut_repo = MutableRepo::new(self.clone(), self.readonly_index(), &self.view); - Transaction::new(mut_repo, user_settings) + Transaction::new(mut_repo, self.settings()) } pub fn reload_at_head( @@ -779,7 +776,7 @@ impl RepoLoader { }; let final_op = if num_operations > 1 { let base_repo = self.load_at(&base_op)?; - let mut tx = base_repo.start_transaction(settings); + let mut tx = base_repo.start_transaction(); for other_op in operations { tx.merge_operation(other_op)?; tx.repo_mut().rebase_descendants(settings)?; diff --git a/lib/src/working_copy.rs b/lib/src/working_copy.rs index 59ed579d46..ac0bca65cd 100644 --- a/lib/src/working_copy.rs +++ b/lib/src/working_copy.rs @@ -437,7 +437,7 @@ pub fn create_and_check_out_recovery_commit( user_settings: &UserSettings, description: &str, ) -> Result<(Arc, Commit), RecoverWorkspaceError> { - let mut tx = repo.start_transaction(user_settings); + let mut tx = repo.start_transaction(); let repo_mut = tx.repo_mut(); let commit_id = repo diff --git a/lib/src/workspace.rs b/lib/src/workspace.rs index d31f682909..9e06f5e57c 100644 --- a/lib/src/workspace.rs +++ b/lib/src/workspace.rs @@ -134,7 +134,7 @@ fn init_working_copy( let working_copy_state_path = jj_dir.join("working_copy"); std::fs::create_dir(&working_copy_state_path).context(&working_copy_state_path)?; - let mut tx = repo.start_transaction(user_settings); + let mut tx = repo.start_transaction(); tx.repo_mut().check_out( workspace_id.clone(), user_settings, diff --git a/lib/tests/test_annotate.rs b/lib/tests/test_annotate.rs index d0cc459e12..040fe0d57a 100644 --- a/lib/tests/test_annotate.rs +++ b/lib/tests/test_annotate.rs @@ -112,7 +112,7 @@ fn test_annotate_linear() { let root_commit_id = repo.store().root_commit_id(); let file_path = RepoPath::from_internal_string("file"); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut create_commit = create_commit_fn(tx.repo_mut(), &settings); let content1 = ""; let content2 = "2a\n2b\n"; @@ -157,7 +157,7 @@ fn test_annotate_merge_simple() { // 2 | "2 1" // |/ // 1 "1" - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut create_commit = create_commit_fn(tx.repo_mut(), &settings); let content1 = "1\n"; let content2 = "2\n1\n"; @@ -232,7 +232,7 @@ fn test_annotate_merge_split() { // 2 | "2 1a" // |/ // 1 "1a 1b" - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut create_commit = create_commit_fn(tx.repo_mut(), &settings); let content1 = "1a\n1b\n"; let content2 = "2\n1a\n"; @@ -277,7 +277,7 @@ fn test_annotate_merge_split_interleaved() { // | 2 "2a 2b" // | // 1 "1a 1b" - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut create_commit = create_commit_fn(tx.repo_mut(), &settings); let content1 = "1a\n1b\n"; let content2 = "2a\n2b\n"; @@ -326,7 +326,7 @@ fn test_annotate_merge_dup() { // 2 | "2 1" // |/ // 1 "1" - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut create_commit = create_commit_fn(tx.repo_mut(), &settings); let content1 = "1\n"; let content2 = "2\n1\n"; @@ -373,7 +373,7 @@ fn test_annotate_file_directory_transition() { let file_path1 = RepoPath::from_internal_string("file/was_dir"); let file_path2 = RepoPath::from_internal_string("file"); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut create_commit = create_commit_fn(tx.repo_mut(), &settings); let tree1 = create_tree(repo, &[(file_path1, "1\n")]); let tree2 = create_tree(repo, &[(file_path2, "2\n")]); diff --git a/lib/tests/test_bad_locking.rs b/lib/tests/test_bad_locking.rs index 11a1606227..703ce02c61 100644 --- a/lib/tests/test_bad_locking.rs +++ b/lib/tests/test_bad_locking.rs @@ -109,7 +109,7 @@ fn test_bad_locking_children(backend: TestRepoBackend) { let repo = &test_workspace.repo; let workspace_root = test_workspace.workspace.workspace_root(); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let initial = create_random_commit(tx.repo_mut(), &settings) .set_parents(vec![repo.store().root_commit_id().clone()]) .write() @@ -130,7 +130,7 @@ fn test_bad_locking_children(backend: TestRepoBackend) { .repo_loader() .load_at_head(&settings) .unwrap(); - let mut machine1_tx = machine1_repo.start_transaction(&settings); + let mut machine1_tx = machine1_repo.start_transaction(); let child1 = create_random_commit(machine1_tx.repo_mut(), &settings) .set_parents(vec![initial.id().clone()]) .write() @@ -151,7 +151,7 @@ fn test_bad_locking_children(backend: TestRepoBackend) { .repo_loader() .load_at_head(&settings) .unwrap(); - let mut machine2_tx = machine2_repo.start_transaction(&settings); + let mut machine2_tx = machine2_repo.start_transaction(); let child2 = create_random_commit(machine2_tx.repo_mut(), &settings) .set_parents(vec![initial.id().clone()]) .write() @@ -191,7 +191,7 @@ fn test_bad_locking_interrupted(backend: TestRepoBackend) { let test_env = &test_workspace.env; let repo = &test_workspace.repo; - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let initial = create_random_commit(tx.repo_mut(), &settings) .set_parents(vec![repo.store().root_commit_id().clone()]) .write() @@ -205,7 +205,7 @@ fn test_bad_locking_interrupted(backend: TestRepoBackend) { let op_heads_dir = test_workspace.repo_path().join("op_heads"); let backup_path = test_workspace.root_dir().join("backup"); copy_directory(&op_heads_dir, &backup_path); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); create_random_commit(tx.repo_mut(), &settings) .set_parents(vec![initial.id().clone()]) .write() diff --git a/lib/tests/test_commit_builder.rs b/lib/tests/test_commit_builder.rs index 91fc34216a..b5be6f0a72 100644 --- a/lib/tests/test_commit_builder.rs +++ b/lib/tests/test_commit_builder.rs @@ -79,7 +79,7 @@ fn test_initial(backend: TestRepoBackend) { ], ); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let author_signature = Signature { name: "author name".to_string(), email: "author email".to_string(), @@ -147,7 +147,7 @@ fn test_rewrite(backend: TestRepoBackend) { ], ); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let initial_commit = tx .repo_mut() .new_commit( @@ -182,7 +182,7 @@ fn test_rewrite(backend: TestRepoBackend) { let repo = test_env.load_repo_at_head(&rewrite_settings, test_repo.repo_path()); let store = repo.store(); let initial_commit = store.get_commit(initial_commit.id()).unwrap(); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let rewritten_commit = tx .repo_mut() .rewrite_commit(&rewrite_settings, &initial_commit) @@ -230,7 +230,7 @@ fn test_rewrite_update_missing_user(backend: TestRepoBackend) { let test_env = &test_repo.env; let repo = &test_repo.repo; - let mut tx = repo.start_transaction(&missing_user_settings); + let mut tx = repo.start_transaction(); let initial_commit = tx .repo_mut() .new_commit( @@ -260,7 +260,7 @@ fn test_rewrite_update_missing_user(backend: TestRepoBackend) { let settings = UserSettings::from_config(config).unwrap(); let repo = test_env.load_repo_at_head(&settings, test_repo.repo_path()); let initial_commit = repo.store().get_commit(initial_commit.id()).unwrap(); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let rewritten_commit = tx .repo_mut() .rewrite_commit(&settings, &initial_commit) @@ -290,7 +290,7 @@ fn test_rewrite_resets_author_timestamp(backend: TestRepoBackend) { let settings = UserSettings::from_config(config_with_commit_timestamp(initial_timestamp)).unwrap(); let repo = test_env.load_repo_at_head(&settings, test_repo.repo_path()); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let initial_commit = tx .repo_mut() .new_commit( @@ -313,7 +313,7 @@ fn test_rewrite_resets_author_timestamp(backend: TestRepoBackend) { UserSettings::from_config(config_with_commit_timestamp(new_timestamp_1)).unwrap(); let repo = test_env.load_repo_at_head(&settings, test_repo.repo_path()); let initial_commit = repo.store().get_commit(initial_commit.id()).unwrap(); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let rewritten_commit_1 = tx .repo_mut() .rewrite_commit(&settings, &initial_commit) @@ -337,7 +337,7 @@ fn test_rewrite_resets_author_timestamp(backend: TestRepoBackend) { UserSettings::from_config(config_with_commit_timestamp(new_timestamp_2)).unwrap(); let repo = test_env.load_repo_at_head(&settings, test_repo.repo_path()); let rewritten_commit_1 = repo.store().get_commit(rewritten_commit_1.id()).unwrap(); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let rewritten_commit_2 = tx .repo_mut() .rewrite_commit(&settings, &rewritten_commit_1) @@ -363,7 +363,7 @@ fn test_commit_builder_descendants(backend: TestRepoBackend) { let repo = &test_repo.repo; let store = repo.store().clone(); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut graph_builder = CommitGraphBuilder::new(&settings, tx.repo_mut()); let commit1 = graph_builder.initial_commit(); let commit2 = graph_builder.commit_with_parents(&[&commit1]); @@ -371,7 +371,7 @@ fn test_commit_builder_descendants(backend: TestRepoBackend) { let repo = tx.commit("test").unwrap(); // Test with for_new_commit() - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); tx.repo_mut() .new_commit( &settings, @@ -387,7 +387,7 @@ fn test_commit_builder_descendants(backend: TestRepoBackend) { assert_eq!(rebase_map.len(), 0); // Test with for_rewrite_from() - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let commit4 = tx .repo_mut() .rewrite_commit(&settings, &commit2) @@ -401,7 +401,7 @@ fn test_commit_builder_descendants(backend: TestRepoBackend) { assert_eq!(rebase_map.len(), 1); // Test with for_rewrite_from() but new change id - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); tx.repo_mut() .rewrite_commit(&settings, &commit2) .generate_new_change_id() diff --git a/lib/tests/test_commit_concurrent.rs b/lib/tests/test_commit_concurrent.rs index 3ca20ddf69..3f26c66850 100644 --- a/lib/tests/test_commit_concurrent.rs +++ b/lib/tests/test_commit_concurrent.rs @@ -57,7 +57,7 @@ fn test_commit_parallel(backend: TestRepoBackend) { let settings = settings.clone(); let repo = repo.clone(); s.spawn(move || { - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); write_random_commit(tx.repo_mut(), &settings); tx.commit("test").unwrap(); }); @@ -88,7 +88,7 @@ fn test_commit_parallel_instances(backend: TestRepoBackend) { let settings = settings.clone(); let repo = test_env.load_repo_at_head(&settings, test_workspace.repo_path()); s.spawn(move || { - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); write_random_commit(tx.repo_mut(), &settings); tx.commit("test").unwrap(); }); diff --git a/lib/tests/test_default_revset_graph_iterator.rs b/lib/tests/test_default_revset_graph_iterator.rs index da445b3dea..69fcbeeaa0 100644 --- a/lib/tests/test_default_revset_graph_iterator.rs +++ b/lib/tests/test_default_revset_graph_iterator.rs @@ -67,7 +67,7 @@ fn test_graph_iterator_linearized(skip_transitive_edges: bool) { // A ~ // | // root - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut graph_builder = CommitGraphBuilder::new(&settings, tx.repo_mut()); let commit_a = graph_builder.initial_commit(); let commit_b = graph_builder.commit_with_parents(&[&commit_a]); @@ -105,7 +105,7 @@ fn test_graph_iterator_virtual_octopus(skip_transitive_edges: bool) { // A B C A B C // \|/ ~ ~ ~ // root - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut graph_builder = CommitGraphBuilder::new(&settings, tx.repo_mut()); let commit_a = graph_builder.initial_commit(); let commit_b = graph_builder.initial_commit(); @@ -157,7 +157,7 @@ fn test_graph_iterator_simple_fork(skip_transitive_edges: bool) { // A // | // root - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut graph_builder = CommitGraphBuilder::new(&settings, tx.repo_mut()); let commit_a = graph_builder.initial_commit(); let commit_b = graph_builder.commit_with_parents(&[&commit_a]); @@ -197,7 +197,7 @@ fn test_graph_iterator_multiple_missing(skip_transitive_edges: bool) { // a B c ~ // \|/ // root - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut graph_builder = CommitGraphBuilder::new(&settings, tx.repo_mut()); let commit_a = graph_builder.initial_commit(); let commit_b = graph_builder.initial_commit(); @@ -242,7 +242,7 @@ fn test_graph_iterator_edge_to_ancestor(skip_transitive_edges: bool) { // a // | // root - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut graph_builder = CommitGraphBuilder::new(&settings, tx.repo_mut()); let commit_a = graph_builder.initial_commit(); let commit_b = graph_builder.initial_commit(); @@ -293,7 +293,7 @@ fn test_graph_iterator_edge_escapes_from_(skip_transitive_edges: bool) { // A // | // root - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut graph_builder = CommitGraphBuilder::new(&settings, tx.repo_mut()); let commit_a = graph_builder.initial_commit(); let commit_b = graph_builder.commit_with_parents(&[&commit_a]); diff --git a/lib/tests/test_git.rs b/lib/tests/test_git.rs index 71624d7f69..a8404704c4 100644 --- a/lib/tests/test_git.rs +++ b/lib/tests/test_git.rs @@ -134,7 +134,7 @@ fn test_import_refs() { git_repo.set_head("refs/heads/main").unwrap(); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); git::import_head(tx.repo_mut()).unwrap(); let stats = git::import_refs(tx.repo_mut(), &git_settings).unwrap(); tx.repo_mut().rebase_descendants(&settings).unwrap(); @@ -257,7 +257,7 @@ fn test_import_refs_reimport() { .reference("refs/tags/my-gpg-key", pgp_key_oid, false, "") .unwrap(); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let stats = git::import_refs(tx.repo_mut(), &git_settings).unwrap(); tx.repo_mut().rebase_descendants(&settings).unwrap(); let repo = tx.commit("test").unwrap(); @@ -276,7 +276,7 @@ fn test_import_refs_reimport() { let commit5 = empty_git_commit(&git_repo, "refs/heads/feature2", &[&commit2]); // Also modify feature2 on the jj side - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let commit6 = create_random_commit(tx.repo_mut(), &settings) .set_parents(vec![jj_id(&commit2)]) .write() @@ -285,7 +285,7 @@ fn test_import_refs_reimport() { .set_local_bookmark_target("feature2", RefTarget::normal(commit6.id().clone())); let repo = tx.commit("test").unwrap(); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let stats = git::import_refs(tx.repo_mut(), &git_settings).unwrap(); tx.repo_mut().rebase_descendants(&settings).unwrap(); let repo = tx.commit("test").unwrap(); @@ -361,7 +361,7 @@ fn test_import_refs_reimport_head_removed() { let git_repo = get_git_repo(repo); let commit = empty_git_commit(&git_repo, "refs/heads/main", &[]); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); git::import_refs(tx.repo_mut(), &git_settings).unwrap(); tx.repo_mut().rebase_descendants(&settings).unwrap(); let commit_id = jj_id(&commit); @@ -388,7 +388,7 @@ fn test_import_refs_reimport_git_head_does_not_count() { let commit = empty_git_commit(&git_repo, "refs/heads/main", &[]); git_repo.set_head_detached(commit.id()).unwrap(); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); git::import_head(tx.repo_mut()).unwrap(); git::import_refs(tx.repo_mut(), &git_settings).unwrap(); tx.repo_mut().rebase_descendants(&settings).unwrap(); @@ -416,7 +416,7 @@ fn test_import_refs_reimport_git_head_without_ref() { let git_repo = get_git_repo(repo); // First, HEAD points to commit1. - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let commit1 = write_random_commit(tx.repo_mut(), &settings); let commit2 = write_random_commit(tx.repo_mut(), &settings); git_repo.set_head_detached(git_id(&commit1)).unwrap(); @@ -452,7 +452,7 @@ fn test_import_refs_reimport_git_head_with_moved_ref() { let git_repo = get_git_repo(repo); // First, both HEAD and main point to commit1. - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let commit1 = write_random_commit(tx.repo_mut(), &settings); let commit2 = write_random_commit(tx.repo_mut(), &settings); git_repo @@ -516,7 +516,7 @@ fn test_import_refs_reimport_with_deleted_remote_ref() { commit_remote_and_local.id(), ); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); git::import_refs(tx.repo_mut(), &git_settings).unwrap(); tx.repo_mut().rebase_descendants(&settings).unwrap(); let repo = tx.commit("test").unwrap(); @@ -572,7 +572,7 @@ fn test_import_refs_reimport_with_deleted_remote_ref() { delete_git_ref(&git_repo, "refs/remotes/origin/feature-remote-only"); delete_git_ref(&git_repo, "refs/remotes/origin/feature-remote-and-local"); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); git::import_refs(tx.repo_mut(), &git_settings).unwrap(); tx.repo_mut().rebase_descendants(&settings).unwrap(); let repo = tx.commit("test").unwrap(); @@ -638,7 +638,7 @@ fn test_import_refs_reimport_with_moved_remote_ref() { commit_remote_and_local.id(), ); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); git::import_refs(tx.repo_mut(), &git_settings).unwrap(); tx.repo_mut().rebase_descendants(&settings).unwrap(); let repo = tx.commit("test").unwrap(); @@ -704,7 +704,7 @@ fn test_import_refs_reimport_with_moved_remote_ref() { &[&commit_base], ); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); git::import_refs(tx.repo_mut(), &git_settings).unwrap(); tx.repo_mut().rebase_descendants(&settings).unwrap(); let repo = tx.commit("test").unwrap(); @@ -771,7 +771,7 @@ fn test_import_refs_reimport_with_moved_untracked_remote_ref() { let remote_ref_name = "refs/remotes/origin/feature"; let commit_base = empty_git_commit(&git_repo, remote_ref_name, &[]); let commit_remote_t0 = empty_git_commit(&git_repo, remote_ref_name, &[&commit_base]); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); git::import_refs(tx.repo_mut(), &git_settings).unwrap(); tx.repo_mut().rebase_descendants(&settings).unwrap(); let repo = tx.commit("test").unwrap(); @@ -791,7 +791,7 @@ fn test_import_refs_reimport_with_moved_untracked_remote_ref() { // Move the reference remotely and fetch the changes. delete_git_ref(&git_repo, remote_ref_name); let commit_remote_t1 = empty_git_commit(&git_repo, remote_ref_name, &[&commit_base]); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); git::import_refs(tx.repo_mut(), &git_settings).unwrap(); tx.repo_mut().rebase_descendants(&settings).unwrap(); let repo = tx.commit("test").unwrap(); @@ -829,7 +829,7 @@ fn test_import_refs_reimport_with_deleted_untracked_intermediate_remote_ref() { let remote_ref_name_b = "refs/remotes/origin/feature-b"; let commit_remote_a = empty_git_commit(&git_repo, remote_ref_name_a, &[]); let commit_remote_b = empty_git_commit(&git_repo, remote_ref_name_b, &[&commit_remote_a]); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); git::import_refs(tx.repo_mut(), &git_settings).unwrap(); tx.repo_mut().rebase_descendants(&settings).unwrap(); let repo = tx.commit("test").unwrap(); @@ -855,7 +855,7 @@ fn test_import_refs_reimport_with_deleted_untracked_intermediate_remote_ref() { // Delete feature-a remotely and fetch the changes. delete_git_ref(&git_repo, remote_ref_name_a); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); git::import_refs(tx.repo_mut(), &git_settings).unwrap(); tx.repo_mut().rebase_descendants(&settings).unwrap(); let repo = tx.commit("test").unwrap(); @@ -894,7 +894,7 @@ fn test_import_refs_reimport_with_deleted_abandoned_untracked_remote_ref() { let remote_ref_name_b = "refs/remotes/origin/feature-b"; let commit_remote_a = empty_git_commit(&git_repo, remote_ref_name_a, &[]); let commit_remote_b = empty_git_commit(&git_repo, remote_ref_name_b, &[&commit_remote_a]); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); git::import_refs(tx.repo_mut(), &git_settings).unwrap(); tx.repo_mut().rebase_descendants(&settings).unwrap(); let repo = tx.commit("test").unwrap(); @@ -921,7 +921,7 @@ fn test_import_refs_reimport_with_deleted_abandoned_untracked_remote_ref() { // Abandon feature-b locally: // x feature-b@origin (hidden) // o feature-a@origin - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); tx.repo_mut() .record_abandoned_commit(jj_id(&commit_remote_b)); tx.repo_mut().rebase_descendants(&settings).unwrap(); @@ -933,7 +933,7 @@ fn test_import_refs_reimport_with_deleted_abandoned_untracked_remote_ref() { // Delete feature-a remotely and fetch the changes. delete_git_ref(&git_repo, remote_ref_name_a); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); git::import_refs(tx.repo_mut(), &git_settings).unwrap(); tx.repo_mut().rebase_descendants(&settings).unwrap(); let repo = tx.commit("test").unwrap(); @@ -966,7 +966,7 @@ fn test_import_refs_reimport_git_head_with_fixed_ref() { let git_repo = get_git_repo(repo); // First, both HEAD and main point to commit1. - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let commit1 = write_random_commit(tx.repo_mut(), &settings); let commit2 = write_random_commit(tx.repo_mut(), &settings); git_repo @@ -1003,7 +1003,7 @@ fn test_import_refs_reimport_all_from_root_removed() { let git_repo = get_git_repo(repo); let commit = empty_git_commit(&git_repo, "refs/heads/main", &[]); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); git::import_refs(tx.repo_mut(), &git_settings).unwrap(); tx.repo_mut().rebase_descendants(&settings).unwrap(); // Test the setup @@ -1034,7 +1034,7 @@ fn test_import_refs_reimport_abandoning_disabled() { let commit1 = empty_git_commit(&git_repo, "refs/heads/main", &[]); let commit2 = empty_git_commit(&git_repo, "refs/heads/delete-me", &[&commit1]); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); git::import_refs(tx.repo_mut(), &git_settings).unwrap(); tx.repo_mut().rebase_descendants(&settings).unwrap(); // Test the setup @@ -1064,12 +1064,12 @@ fn test_import_refs_reimport_conflicted_remote_bookmark() { let commit1 = empty_git_commit(&git_repo, "refs/heads/commit1", &[]); git_ref(&git_repo, "refs/remotes/origin/main", commit1.id()); - let mut tx1 = repo.start_transaction(&settings); + let mut tx1 = repo.start_transaction(); git::import_refs(tx1.repo_mut(), &git_settings).unwrap(); let commit2 = empty_git_commit(&git_repo, "refs/heads/commit2", &[]); git_ref(&git_repo, "refs/remotes/origin/main", commit2.id()); - let mut tx2 = repo.start_transaction(&settings); + let mut tx2 = repo.start_transaction(); git::import_refs(tx2.repo_mut(), &git_settings).unwrap(); // Remote bookmark can diverge by divergent operations (like `jj git fetch`) @@ -1087,7 +1087,7 @@ fn test_import_refs_reimport_conflicted_remote_bookmark() { ); // The conflict can be resolved by importing the current Git state - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); git::import_refs(tx.repo_mut(), &git_settings).unwrap(); let repo = tx.commit("test").unwrap(); assert_eq!( @@ -1105,7 +1105,6 @@ fn test_import_refs_reimport_conflicted_remote_bookmark() { #[test] fn test_import_refs_reserved_remote_name() { - let settings = testutils::user_settings(); let git_settings = GitSettings::default(); let test_repo = TestRepo::init_with_backend(TestRepoBackend::Git); let repo = &test_repo.repo; @@ -1113,7 +1112,7 @@ fn test_import_refs_reserved_remote_name() { empty_git_commit(&git_repo, "refs/remotes/git/main", &[]); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let result = git::import_refs(tx.repo_mut(), &git_settings); assert_matches!(result, Err(GitImportError::RemoteReservedForLocalGitRepo)); } @@ -1149,7 +1148,7 @@ fn test_import_some_refs() { } // Import bookmarks feature1, feature2, and feature3. - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); git::import_some_refs(tx.repo_mut(), &git_settings, |ref_name| { get_remote_bookmark(ref_name) .map(|bookmark| bookmark.starts_with("feature")) @@ -1232,7 +1231,7 @@ fn test_import_some_refs() { delete_git_ref(&git_repo, "refs/remotes/origin/feature1"); delete_git_ref(&git_repo, "refs/remotes/origin/feature3"); delete_git_ref(&git_repo, "refs/remotes/origin/feature4"); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); git::import_some_refs(tx.repo_mut(), &git_settings, |ref_name| { get_remote_bookmark(ref_name) == Some("feature2") }) @@ -1248,7 +1247,7 @@ fn test_import_some_refs() { // Import feature1: this should cause the bookmark to be deleted, but the // corresponding commit should stay because it is reachable from feature2. - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); git::import_some_refs(tx.repo_mut(), &git_settings, |ref_name| { get_remote_bookmark(ref_name) == Some("feature1") }) @@ -1265,7 +1264,7 @@ fn test_import_some_refs() { // Import feature3: this should cause the bookmark to be deleted, but // feature4 should be left alone even though it is no longer in git. - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); git::import_some_refs(tx.repo_mut(), &git_settings, |ref_name| { get_remote_bookmark(ref_name) == Some("feature3") }) @@ -1281,7 +1280,7 @@ fn test_import_some_refs() { assert_eq!(*view.heads(), expected_heads); // Import feature4: both the head and the bookmark will disappear. - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); git::import_some_refs(tx.repo_mut(), &git_settings, |ref_name| { get_remote_bookmark(ref_name) == Some("feature4") }) @@ -1358,7 +1357,7 @@ fn test_import_refs_empty_git_repo() { let test_data = GitRepoData::create(); let git_settings = GitSettings::default(); let heads_before = test_data.repo.view().heads().clone(); - let mut tx = test_data.repo.start_transaction(&test_data.settings); + let mut tx = test_data.repo.start_transaction(); git::import_refs(tx.repo_mut(), &git_settings).unwrap(); tx.repo_mut() .rebase_descendants(&test_data.settings) @@ -1373,7 +1372,6 @@ fn test_import_refs_empty_git_repo() { #[test] fn test_import_refs_missing_git_commit() { - let settings = testutils::user_settings(); let git_settings = GitSettings::default(); let test_workspace = TestRepo::init_with_backend(TestRepoBackend::Git); let repo = &test_workspace.repo; @@ -1391,7 +1389,7 @@ fn test_import_refs_missing_git_commit() { // Missing commit is ancestor of ref git_repo.set_head("refs/heads/unborn").unwrap(); fs::rename(&object_file, &backup_object_file).unwrap(); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let result = git::import_refs(tx.repo_mut(), &git_settings); assert_matches!( result, @@ -1408,7 +1406,7 @@ fn test_import_refs_missing_git_commit() { .delete() .unwrap(); git_repo.set_head_detached(commit2.id()).unwrap(); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let result = git::import_head(tx.repo_mut()); assert_matches!( result, @@ -1426,7 +1424,7 @@ fn test_import_refs_missing_git_commit() { .unwrap(); git_repo.set_head("refs/heads/unborn").unwrap(); fs::rename(&object_file, &backup_object_file).unwrap(); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let result = git::import_refs(tx.repo_mut(), &git_settings); assert!(result.is_ok()); @@ -1440,7 +1438,7 @@ fn test_import_refs_missing_git_commit() { .unwrap(); git_repo.set_head_detached(commit1.id()).unwrap(); fs::rename(&object_file, &backup_object_file).unwrap(); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let result = git::import_head(tx.repo_mut()); assert!(result.is_ok()); } @@ -1460,7 +1458,7 @@ fn test_import_refs_detached_head() { .unwrap(); test_data.git_repo.set_head_detached(commit1.id()).unwrap(); - let mut tx = test_data.repo.start_transaction(&test_data.settings); + let mut tx = test_data.repo.start_transaction(); git::import_head(tx.repo_mut()).unwrap(); git::import_refs(tx.repo_mut(), &git_settings).unwrap(); tx.repo_mut() @@ -1483,7 +1481,7 @@ fn test_export_refs_no_detach() { let git_repo = test_data.git_repo; let commit1 = empty_git_commit(&git_repo, "refs/heads/main", &[]); git_repo.set_head("refs/heads/main").unwrap(); - let mut tx = test_data.repo.start_transaction(&test_data.settings); + let mut tx = test_data.repo.start_transaction(); let mut_repo = tx.repo_mut(); git::import_head(mut_repo).unwrap(); git::import_refs(mut_repo, &git_settings).unwrap(); @@ -1514,7 +1512,7 @@ fn test_export_refs_bookmark_changed() { .unwrap(); git_repo.set_head("refs/heads/feature").unwrap(); - let mut tx = test_data.repo.start_transaction(&test_data.settings); + let mut tx = test_data.repo.start_transaction(); let mut_repo = tx.repo_mut(); git::import_head(mut_repo).unwrap(); git::import_refs(mut_repo, &git_settings).unwrap(); @@ -1553,7 +1551,7 @@ fn test_export_refs_current_bookmark_changed() { let git_repo = test_data.git_repo; let commit1 = empty_git_commit(&git_repo, "refs/heads/main", &[]); git_repo.set_head("refs/heads/main").unwrap(); - let mut tx = test_data.repo.start_transaction(&test_data.settings); + let mut tx = test_data.repo.start_transaction(); let mut_repo = tx.repo_mut(); git::import_head(mut_repo).unwrap(); git::import_refs(mut_repo, &git_settings).unwrap(); @@ -1590,7 +1588,7 @@ fn test_export_refs_unborn_git_bookmark(move_placeholder_ref: bool) { let git_settings = GitSettings::default(); let git_repo = test_data.git_repo; git_repo.set_head("refs/heads/main").unwrap(); - let mut tx = test_data.repo.start_transaction(&test_data.settings); + let mut tx = test_data.repo.start_transaction(); let mut_repo = tx.repo_mut(); git::import_head(mut_repo).unwrap(); git::import_refs(mut_repo, &git_settings).unwrap(); @@ -1633,7 +1631,7 @@ fn test_export_import_sequence() { let test_data = GitRepoData::create(); let git_settings = GitSettings::default(); let git_repo = test_data.git_repo; - let mut tx = test_data.repo.start_transaction(&test_data.settings); + let mut tx = test_data.repo.start_transaction(); let mut_repo = tx.repo_mut(); let commit_a = write_random_commit(mut_repo, &test_data.settings); let commit_b = write_random_commit(mut_repo, &test_data.settings); @@ -1688,7 +1686,7 @@ fn test_import_export_non_tracking_bookmark() { let git_repo = test_data.git_repo; let commit_main_t0 = empty_git_commit(&git_repo, "refs/remotes/origin/main", &[]); - let mut tx = test_data.repo.start_transaction(&test_data.settings); + let mut tx = test_data.repo.start_transaction(); let mut_repo = tx.repo_mut(); git::import_refs(mut_repo, &git_settings).unwrap(); @@ -1770,7 +1768,7 @@ fn test_export_conflicts() { // We skip export of conflicted bookmarks let test_data = GitRepoData::create(); let git_repo = test_data.git_repo; - let mut tx = test_data.repo.start_transaction(&test_data.settings); + let mut tx = test_data.repo.start_transaction(); let mut_repo = tx.repo_mut(); let commit_a = write_random_commit(mut_repo, &test_data.settings); let commit_b = write_random_commit(mut_repo, &test_data.settings); @@ -1828,7 +1826,7 @@ fn test_export_conflicts() { fn test_export_bookmark_on_root_commit() { // We skip export of bookmarks pointing to the root commit let test_data = GitRepoData::create(); - let mut tx = test_data.repo.start_transaction(&test_data.settings); + let mut tx = test_data.repo.start_transaction(); let mut_repo = tx.repo_mut(); mut_repo.set_local_bookmark_target( "on_root", @@ -1845,7 +1843,7 @@ fn test_export_partial_failure() { // Check that we skip bookmarks that fail to export let test_data = GitRepoData::create(); let git_repo = test_data.git_repo; - let mut tx = test_data.repo.start_transaction(&test_data.settings); + let mut tx = test_data.repo.start_transaction(); let mut_repo = tx.repo_mut(); let commit_a = write_random_commit(mut_repo, &test_data.settings); let target = RefTarget::normal(commit_a.id().clone()); @@ -1930,7 +1928,7 @@ fn test_export_reexport_transitions() { // Test exporting after making changes on the jj side, or the git side, or both let test_data = GitRepoData::create(); let git_repo = test_data.git_repo; - let mut tx = test_data.repo.start_transaction(&test_data.settings); + let mut tx = test_data.repo.start_transaction(); let mut_repo = tx.repo_mut(); let commit_a = write_random_commit(mut_repo, &test_data.settings); let commit_b = write_random_commit(mut_repo, &test_data.settings); @@ -2083,7 +2081,7 @@ fn test_export_reexport_transitions() { fn test_export_undo_reexport() { let test_data = GitRepoData::create(); let git_repo = test_data.git_repo; - let mut tx = test_data.repo.start_transaction(&test_data.settings); + let mut tx = test_data.repo.start_transaction(); let mut_repo = tx.repo_mut(); // Initial export @@ -2134,7 +2132,7 @@ fn test_reset_head_to_root() { Workspace::init_external_git(&settings, &workspace_root, &workspace_root.join(".git")) .unwrap(); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut_repo = tx.repo_mut(); let root_commit_id = repo.store().root_commit_id(); @@ -2192,7 +2190,7 @@ fn test_reset_head_with_index() { Workspace::init_external_git(&settings, &workspace_root, &workspace_root.join(".git")) .unwrap(); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut_repo = tx.repo_mut(); let root_commit_id = repo.store().root_commit_id(); @@ -2261,7 +2259,7 @@ fn test_fetch_empty_repo() { let test_data = GitRepoData::create(); let git_settings = GitSettings::default(); - let mut tx = test_data.repo.start_transaction(&test_data.settings); + let mut tx = test_data.repo.start_transaction(); let stats = git::fetch( tx.repo_mut(), &test_data.git_repo, @@ -2288,7 +2286,7 @@ fn test_fetch_initial_commit_head_is_not_set() { }; let initial_git_commit = empty_git_commit(&test_data.origin_repo, "refs/heads/main", &[]); - let mut tx = test_data.repo.start_transaction(&test_data.settings); + let mut tx = test_data.repo.start_transaction(); let stats = git::fetch( tx.repo_mut(), &test_data.git_repo, @@ -2349,7 +2347,7 @@ fn test_fetch_initial_commit_head_is_set() { .reference("refs/tags/v1.0", new_git_commit.id(), false, "") .unwrap(); - let mut tx = test_data.repo.start_transaction(&test_data.settings); + let mut tx = test_data.repo.start_transaction(); let stats = git::fetch( tx.repo_mut(), &test_data.git_repo, @@ -2374,7 +2372,7 @@ fn test_fetch_success() { }; let initial_git_commit = empty_git_commit(&test_data.origin_repo, "refs/heads/main", &[]); - let mut tx = test_data.repo.start_transaction(&test_data.settings); + let mut tx = test_data.repo.start_transaction(); git::fetch( tx.repo_mut(), &test_data.git_repo, @@ -2398,7 +2396,7 @@ fn test_fetch_success() { .reference("refs/tags/v1.0", new_git_commit.id(), false, "") .unwrap(); - let mut tx = test_data.repo.start_transaction(&test_data.settings); + let mut tx = test_data.repo.start_transaction(); let stats = git::fetch( tx.repo_mut(), &test_data.git_repo, @@ -2456,7 +2454,7 @@ fn test_fetch_prune_deleted_ref() { }; let commit = empty_git_commit(&test_data.origin_repo, "refs/heads/main", &[]); - let mut tx = test_data.repo.start_transaction(&test_data.settings); + let mut tx = test_data.repo.start_transaction(); git::fetch( tx.repo_mut(), &test_data.git_repo, @@ -2508,7 +2506,7 @@ fn test_fetch_no_default_branch() { }; let initial_git_commit = empty_git_commit(&test_data.origin_repo, "refs/heads/main", &[]); - let mut tx = test_data.repo.start_transaction(&test_data.settings); + let mut tx = test_data.repo.start_transaction(); git::fetch( tx.repo_mut(), &test_data.git_repo, @@ -2554,7 +2552,7 @@ fn test_fetch_empty_refspecs() { empty_git_commit(&test_data.origin_repo, "refs/heads/main", &[]); // Base refspecs shouldn't be respected - let mut tx = test_data.repo.start_transaction(&test_data.settings); + let mut tx = test_data.repo.start_transaction(); git::fetch( tx.repo_mut(), &test_data.git_repo, @@ -2581,7 +2579,7 @@ fn test_fetch_empty_refspecs() { fn test_fetch_no_such_remote() { let test_data = GitRepoData::create(); let git_settings = GitSettings::default(); - let mut tx = test_data.repo.start_transaction(&test_data.settings); + let mut tx = test_data.repo.start_transaction(); let result = git::fetch( tx.repo_mut(), &test_data.git_repo, @@ -2656,7 +2654,7 @@ fn set_up_push_repos(settings: &UserSettings, temp_dir: &TempDir) -> PushTestSet .store() .get_commit(&jj_id(&parent_of_initial_git_commit)) .unwrap(); - let mut tx = jj_repo.start_transaction(settings); + let mut tx = jj_repo.start_transaction(); let sideways_commit = write_random_commit(tx.repo_mut(), settings); let child_of_main_commit = create_random_commit(tx.repo_mut(), settings) .set_parents(vec![main_commit.id().clone()]) @@ -2693,7 +2691,7 @@ fn test_push_bookmarks_success() { let temp_dir = testutils::new_temp_dir(); let mut setup = set_up_push_repos(&settings, &temp_dir); let clone_repo = get_git_repo(&setup.jj_repo); - let mut tx = setup.jj_repo.start_transaction(&settings); + let mut tx = setup.jj_repo.start_transaction(); let targets = GitBranchPushTargets { branch_updates: vec![( @@ -2747,7 +2745,7 @@ fn test_push_bookmarks_success() { // Check that the repo view reflects the changes in the Git repo setup.jj_repo = tx.commit("test").unwrap(); - let mut tx = setup.jj_repo.start_transaction(&settings); + let mut tx = setup.jj_repo.start_transaction(); git::import_refs(tx.repo_mut(), &GitSettings::default()).unwrap(); assert!(!tx.repo_mut().has_changes()); } @@ -2758,7 +2756,7 @@ fn test_push_bookmarks_deletion() { let temp_dir = testutils::new_temp_dir(); let mut setup = set_up_push_repos(&settings, &temp_dir); let clone_repo = get_git_repo(&setup.jj_repo); - let mut tx = setup.jj_repo.start_transaction(&settings); + let mut tx = setup.jj_repo.start_transaction(); let source_repo = git2::Repository::open(&setup.source_repo_dir).unwrap(); // Test the setup @@ -2799,7 +2797,7 @@ fn test_push_bookmarks_deletion() { // Check that the repo view reflects the changes in the Git repo setup.jj_repo = tx.commit("test").unwrap(); - let mut tx = setup.jj_repo.start_transaction(&settings); + let mut tx = setup.jj_repo.start_transaction(); git::import_refs(tx.repo_mut(), &GitSettings::default()).unwrap(); assert!(!tx.repo_mut().has_changes()); } @@ -2810,7 +2808,7 @@ fn test_push_bookmarks_mixed_deletion_and_addition() { let temp_dir = testutils::new_temp_dir(); let mut setup = set_up_push_repos(&settings, &temp_dir); let clone_repo = get_git_repo(&setup.jj_repo); - let mut tx = setup.jj_repo.start_transaction(&settings); + let mut tx = setup.jj_repo.start_transaction(); let targets = GitBranchPushTargets { branch_updates: vec![ @@ -2868,7 +2866,7 @@ fn test_push_bookmarks_mixed_deletion_and_addition() { // Check that the repo view reflects the changes in the Git repo setup.jj_repo = tx.commit("test").unwrap(); - let mut tx = setup.jj_repo.start_transaction(&settings); + let mut tx = setup.jj_repo.start_transaction(); git::import_refs(tx.repo_mut(), &GitSettings::default()).unwrap(); assert!(!tx.repo_mut().has_changes()); } @@ -2878,7 +2876,7 @@ fn test_push_bookmarks_not_fast_forward() { let settings = testutils::user_settings(); let temp_dir = testutils::new_temp_dir(); let setup = set_up_push_repos(&settings, &temp_dir); - let mut tx = setup.jj_repo.start_transaction(&settings); + let mut tx = setup.jj_repo.start_transaction(); let targets = GitBranchPushTargets { branch_updates: vec![( @@ -3173,7 +3171,7 @@ fn test_bulk_update_extra_on_import_refs() { .count() }; let import_refs = |repo: &Arc| { - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); git::import_refs(tx.repo_mut(), &git_settings).unwrap(); tx.repo_mut().rebase_descendants(&settings).unwrap(); tx.commit("test").unwrap() @@ -3212,14 +3210,14 @@ fn test_rewrite_imported_commit() { // Import git commit, which generates change id from the commit id. let git_commit = empty_git_commit(&git_repo, "refs/heads/main", &[]); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); git::import_refs(tx.repo_mut(), &git_settings).unwrap(); tx.repo_mut().rebase_descendants(&settings).unwrap(); let repo = tx.commit("test").unwrap(); let imported_commit = repo.store().get_commit(&jj_id(&git_commit)).unwrap(); // Try to create identical commit with different change id. - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let authored_commit = tx .repo_mut() .new_commit( @@ -3272,7 +3270,7 @@ fn test_concurrent_write_commit() { let sender = sender.clone(); s.spawn(move || { barrier.wait(); - let mut tx = repo.start_transaction(settings); + let mut tx = repo.start_transaction(); let commit = create_rooted_commit(tx.repo_mut(), settings) .set_description("racy commit") .write() @@ -3358,7 +3356,7 @@ fn test_concurrent_read_write_commit() { let barrier = barrier.clone(); s.spawn(move || { barrier.wait(); - let mut tx = repo.start_transaction(settings); + let mut tx = repo.start_transaction(); let commit = create_rooted_commit(tx.repo_mut(), settings) .set_description(format!("commit {i}")) .write() @@ -3384,7 +3382,7 @@ fn test_concurrent_read_write_commit() { } repo = repo.reload_at_head(settings).unwrap(); let git_backend = get_git_backend(&repo); - let mut tx = repo.start_transaction(settings); + let mut tx = repo.start_transaction(); pending_commit_ids = pending_commit_ids .into_iter() .filter_map(|commit_id| { @@ -3556,7 +3554,7 @@ fn test_shallow_commits_lack_parents() { }; let repo = make_shallow(repo, vec![b.id(), c.id()]); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); git::import_refs(tx.repo_mut(), &GitSettings::default()).unwrap(); let repo = tx.commit("import").unwrap(); let store = repo.store(); @@ -3587,7 +3585,7 @@ fn test_shallow_commits_lack_parents() { // deepen the shallow clone let repo = make_shallow(&repo, vec![a.id()]); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); git::import_refs(tx.repo_mut(), &GitSettings::default()).unwrap(); let repo = tx.commit("import").unwrap(); let store = repo.store(); diff --git a/lib/tests/test_git_backend.rs b/lib/tests/test_git_backend.rs index d9083c4d26..ec2bb4f6e3 100644 --- a/lib/tests/test_git_backend.rs +++ b/lib/tests/test_git_backend.rs @@ -114,7 +114,7 @@ fn test_gc() { // |/ // B // A - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut graph_builder = CommitGraphBuilder::new(&settings, tx.repo_mut()); let commit_a = graph_builder.initial_commit(); let commit_b = graph_builder.commit_with_parents(&[&commit_a]); @@ -249,7 +249,7 @@ fn test_copy_detection() { RepoPathBuf::from_internal_string("file2"), ]; - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let commit_a = make_commit( &mut tx, &settings, diff --git a/lib/tests/test_id_prefix.rs b/lib/tests/test_id_prefix.rs index 0e670a31a7..75f1856d81 100644 --- a/lib/tests/test_id_prefix.rs +++ b/lib/tests/test_id_prefix.rs @@ -37,7 +37,7 @@ fn test_id_prefix() { let root_commit_id = repo.store().root_commit_id(); let root_change_id = repo.store().root_change_id(); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut create_commit = |parent_id: &CommitId| { let signature = Signature { name: "Some One".to_string(), @@ -264,7 +264,7 @@ fn test_id_prefix_divergent() { let repo = &test_repo.repo; let root_commit_id = repo.store().root_commit_id(); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut create_commit_with_change_id = |parent_id: &CommitId, description: &str, change_id: ChangeId| { let signature = Signature { @@ -403,7 +403,7 @@ fn test_id_prefix_hidden() { let repo = &test_repo.repo; let root_commit_id = repo.store().root_commit_id(); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut commits = vec![]; for i in 0..10 { let signature = Signature { diff --git a/lib/tests/test_index.rs b/lib/tests/test_index.rs index f0a61637b2..21f5163ee8 100644 --- a/lib/tests/test_index.rs +++ b/lib/tests/test_index.rs @@ -94,7 +94,7 @@ fn test_index_commits_standard_cases() { // o root let root_commit_id = repo.store().root_commit_id(); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut graph_builder = CommitGraphBuilder::new(&settings, tx.repo_mut()); let commit_a = graph_builder.initial_commit(); let commit_b = graph_builder.commit_with_parents(&[&commit_a]); @@ -151,7 +151,7 @@ fn test_index_commits_criss_cross() { // Create a long chain of criss-crossed merges. If they were traversed without // keeping track of visited nodes, it would be 2^50 visits, so if this test // finishes in reasonable time, we know that we don't do a naive traversal. - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut graph_builder = CommitGraphBuilder::new(&settings, tx.repo_mut()); let mut left_commits = vec![graph_builder.initial_commit()]; let mut right_commits = vec![graph_builder.initial_commit()]; @@ -306,14 +306,14 @@ fn test_index_commits_previous_operations() { // |/ // o root - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut graph_builder = CommitGraphBuilder::new(&settings, tx.repo_mut()); let commit_a = graph_builder.initial_commit(); let commit_b = graph_builder.commit_with_parents(&[&commit_a]); let commit_c = graph_builder.commit_with_parents(&[&commit_b]); let repo = tx.commit("test").unwrap(); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); tx.repo_mut().remove_head(commit_c.id()); let repo = tx.commit("test").unwrap(); @@ -349,7 +349,7 @@ fn test_index_commits_hidden_but_referenced() { // history, but that's not guaranteed if old operations have been discarded. // This can also happen if imported remote bookmarks get immediately // abandoned because the other bookmark has moved. - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let commit_a = write_random_commit(tx.repo_mut(), &settings); let commit_b = write_random_commit(tx.repo_mut(), &settings); let commit_c = write_random_commit(tx.repo_mut(), &settings); @@ -403,7 +403,7 @@ fn test_index_commits_incremental() { // o root let root_commit = repo.store().root_commit(); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let commit_a = child_commit(tx.repo_mut(), &settings, &root_commit) .write() .unwrap(); @@ -413,7 +413,7 @@ fn test_index_commits_incremental() { // There should be the root commit, plus 1 more assert_eq!(index.num_commits(), 1 + 1); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let commit_b = child_commit(tx.repo_mut(), &settings, &commit_a) .write() .unwrap(); @@ -455,7 +455,7 @@ fn test_index_commits_incremental_empty_transaction() { // o root let root_commit = repo.store().root_commit(); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let commit_a = child_commit(tx.repo_mut(), &settings, &root_commit) .write() .unwrap(); @@ -465,7 +465,7 @@ fn test_index_commits_incremental_empty_transaction() { // There should be the root commit, plus 1 more assert_eq!(index.num_commits(), 1 + 1); - repo.start_transaction(&settings).commit("test").unwrap(); + repo.start_transaction().commit("test").unwrap(); let repo = test_env.load_repo_at_head(&settings, test_repo.repo_path()); let index = as_readonly_composite(&repo); @@ -497,7 +497,7 @@ fn test_index_commits_incremental_already_indexed() { // o root let root_commit = repo.store().root_commit(); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let commit_a = child_commit(tx.repo_mut(), &settings, &root_commit) .write() .unwrap(); @@ -505,7 +505,7 @@ fn test_index_commits_incremental_already_indexed() { assert!(repo.index().has_id(commit_a.id())); assert_eq!(as_readonly_composite(&repo).num_commits(), 1 + 1); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut_repo = tx.repo_mut(); mut_repo.add_head(&commit_a).unwrap(); assert_eq!(as_mutable_composite(mut_repo).num_commits(), 1 + 1); @@ -517,7 +517,7 @@ fn create_n_commits( repo: &Arc, num_commits: i32, ) -> Arc { - let mut tx = repo.start_transaction(settings); + let mut tx = repo.start_transaction(); for _ in 0..num_commits { write_random_commit(tx.repo_mut(), settings); } @@ -619,7 +619,7 @@ fn test_reindex_no_segments_dir() { let test_env = &test_repo.env; let repo = &test_repo.repo; - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let commit_a = write_random_commit(tx.repo_mut(), &settings); let repo = tx.commit("test").unwrap(); assert!(repo.index().has_id(commit_a.id())); @@ -640,7 +640,7 @@ fn test_reindex_corrupt_segment_files() { let test_env = &test_repo.env; let repo = &test_repo.repo; - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let commit_a = write_random_commit(tx.repo_mut(), &settings); let repo = tx.commit("test").unwrap(); assert!(repo.index().has_id(commit_a.id())); @@ -678,17 +678,17 @@ fn test_reindex_from_merged_operation() { // o let mut txs = Vec::new(); for _ in 0..2 { - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let commit = write_random_commit(tx.repo_mut(), &settings); let repo = tx.commit("test").unwrap(); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); tx.repo_mut().remove_head(commit.id()); txs.push(tx); } let repo = commit_transactions(&settings, txs); let mut op_ids_to_delete = Vec::new(); op_ids_to_delete.push(repo.op_id()); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); write_random_commit(tx.repo_mut(), &settings); let repo = tx.commit("test").unwrap(); op_ids_to_delete.push(repo.op_id()); @@ -718,12 +718,12 @@ fn test_reindex_missing_commit() { let test_env = &test_repo.env; let repo = &test_repo.repo; - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let missing_commit = write_random_commit(tx.repo_mut(), &settings); let repo = tx.commit("test").unwrap(); let bad_op_id = repo.op_id(); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); tx.repo_mut().remove_head(missing_commit.id()); let repo = tx.commit("test").unwrap(); @@ -764,7 +764,7 @@ fn test_change_id_index() { let test_repo = TestRepo::init(); let repo = &test_repo.repo; - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let root_commit = repo.store().root_commit(); let mut commit_number = 0; diff --git a/lib/tests/test_init.rs b/lib/tests/test_init.rs index cf73744d72..8d3a086b51 100644 --- a/lib/tests/test_init.rs +++ b/lib/tests/test_init.rs @@ -46,7 +46,7 @@ fn test_init_local() { assert_eq!(workspace.workspace_root(), &canonical); // Just test that we can write a commit to the store - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); write_random_commit(tx.repo_mut(), &settings); } @@ -74,7 +74,7 @@ fn test_init_internal_git() { ); // Just test that we can write a commit to the store - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); write_random_commit(tx.repo_mut(), &settings); } @@ -99,7 +99,7 @@ fn test_init_colocated_git() { ); // Just test that we can write a commit to the store - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); write_random_commit(tx.repo_mut(), &settings); } @@ -133,7 +133,7 @@ fn test_init_external_git() { ); // Just test that we can write a commit to the store - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); write_random_commit(tx.repo_mut(), &settings); } diff --git a/lib/tests/test_load_repo.rs b/lib/tests/test_load_repo.rs index 4dc3914490..92c7ae0dc8 100644 --- a/lib/tests/test_load_repo.rs +++ b/lib/tests/test_load_repo.rs @@ -22,11 +22,11 @@ fn test_load_at_operation() { let test_repo = TestRepo::init(); let repo = &test_repo.repo; - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let commit = write_random_commit(tx.repo_mut(), &settings); let repo = tx.commit("add commit").unwrap(); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); tx.repo_mut().remove_head(commit.id()); tx.commit("remove commit").unwrap(); diff --git a/lib/tests/test_local_working_copy.rs b/lib/tests/test_local_working_copy.rs index 25bb1bdce8..5d0bcf3105 100644 --- a/lib/tests/test_local_working_copy.rs +++ b/lib/tests/test_local_working_copy.rs @@ -241,7 +241,7 @@ fn test_checkout_file_transitions(backend: TestRepoBackend) { return; } Kind::GitSubmodule => { - let mut tx = repo.start_transaction(settings); + let mut tx = repo.start_transaction(); let id = write_random_commit(tx.repo_mut(), settings).id().clone(); tx.commit("test").unwrap(); Merge::normal(TreeValue::GitSubmodule(id)) @@ -1305,7 +1305,7 @@ fn test_git_submodule() { let repo = test_workspace.repo.clone(); let store = repo.store().clone(); let workspace_root = test_workspace.workspace.workspace_root().to_owned(); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let added_path = RepoPath::from_internal_string("added"); let submodule_path = RepoPath::from_internal_string("submodule"); diff --git a/lib/tests/test_merge_trees.rs b/lib/tests/test_merge_trees.rs index 46d45e3467..ae5d61d30a 100644 --- a/lib/tests/test_merge_trees.rs +++ b/lib/tests/test_merge_trees.rs @@ -559,7 +559,7 @@ fn test_simplify_conflict_after_resolving_parent() { // rebase C2 (the rebased C) onto the resolved conflict. C3 should not have // a conflict since it changed an unrelated line. let path = RepoPath::from_internal_string("dir/file"); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let tree_a = create_tree(repo, &[(path, "abc\ndef\nghi\n")]); let commit_a = tx .repo_mut() @@ -672,7 +672,7 @@ fn test_rebase_on_lossy_merge() { // had, it would have been resolved to just "2" before the rebase and we // get a conflict after the rebase). let path = RepoPath::from_internal_string("foo"); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let repo_mut = tx.repo_mut(); let tree_1 = create_tree(repo, &[(path, "1")]); let tree_2 = create_tree(repo, &[(path, "2")]); diff --git a/lib/tests/test_mut_repo.rs b/lib/tests/test_mut_repo.rs index eae11000e9..e869d18dbb 100644 --- a/lib/tests/test_mut_repo.rs +++ b/lib/tests/test_mut_repo.rs @@ -33,11 +33,11 @@ fn test_edit() { let test_repo = TestRepo::init(); let repo = &test_repo.repo; - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let wc_commit = write_random_commit(tx.repo_mut(), &settings); let repo = tx.commit("test").unwrap(); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let ws_id = WorkspaceId::default(); tx.repo_mut().edit(ws_id.clone(), &wc_commit).unwrap(); let repo = tx.commit("test").unwrap(); @@ -51,11 +51,11 @@ fn test_checkout() { let test_repo = TestRepo::init(); let repo = &test_repo.repo; - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let wc_commit_parent = write_random_commit(tx.repo_mut(), &settings); let repo = tx.commit("test").unwrap(); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let ws_id = WorkspaceId::default(); let wc_commit = tx .repo_mut() @@ -76,14 +76,14 @@ fn test_edit_previous_not_empty() { let test_repo = TestRepo::init(); let repo = &test_repo.repo; - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut_repo = tx.repo_mut(); let old_wc_commit = write_random_commit(mut_repo, &settings); let ws_id = WorkspaceId::default(); mut_repo.edit(ws_id.clone(), &old_wc_commit).unwrap(); let repo = tx.commit("test").unwrap(); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut_repo = tx.repo_mut(); let new_wc_commit = write_random_commit(mut_repo, &settings); mut_repo.edit(ws_id, &new_wc_commit).unwrap(); @@ -99,7 +99,7 @@ fn test_edit_previous_empty() { let test_repo = TestRepo::init(); let repo = &test_repo.repo; - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut_repo = tx.repo_mut(); let old_wc_commit = mut_repo .new_commit( @@ -113,7 +113,7 @@ fn test_edit_previous_empty() { mut_repo.edit(ws_id.clone(), &old_wc_commit).unwrap(); let repo = tx.commit("test").unwrap(); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut_repo = tx.repo_mut(); let new_wc_commit = write_random_commit(mut_repo, &settings); mut_repo.edit(ws_id, &new_wc_commit).unwrap(); @@ -129,7 +129,7 @@ fn test_edit_previous_empty_merge() { let test_repo = TestRepo::init(); let repo = &test_repo.repo; - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut_repo = tx.repo_mut(); let old_parent1 = write_random_commit(mut_repo, &settings); let old_parent2 = write_random_commit(mut_repo, &settings); @@ -152,7 +152,7 @@ fn test_edit_previous_empty_merge() { mut_repo.edit(ws_id.clone(), &old_wc_commit).unwrap(); let repo = tx.commit("test").unwrap(); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut_repo = tx.repo_mut(); let new_wc_commit = write_random_commit(mut_repo, &settings); mut_repo.edit(ws_id, &new_wc_commit).unwrap(); @@ -168,7 +168,7 @@ fn test_edit_previous_empty_with_description() { let test_repo = TestRepo::init(); let repo = &test_repo.repo; - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut_repo = tx.repo_mut(); let old_wc_commit = mut_repo .new_commit( @@ -183,7 +183,7 @@ fn test_edit_previous_empty_with_description() { mut_repo.edit(ws_id.clone(), &old_wc_commit).unwrap(); let repo = tx.commit("test").unwrap(); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut_repo = tx.repo_mut(); let new_wc_commit = write_random_commit(mut_repo, &settings); mut_repo.edit(ws_id, &new_wc_commit).unwrap(); @@ -199,7 +199,7 @@ fn test_edit_previous_empty_with_local_bookmark() { let test_repo = TestRepo::init(); let repo = &test_repo.repo; - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut_repo = tx.repo_mut(); let old_wc_commit = mut_repo .new_commit( @@ -214,7 +214,7 @@ fn test_edit_previous_empty_with_local_bookmark() { mut_repo.edit(ws_id.clone(), &old_wc_commit).unwrap(); let repo = tx.commit("test").unwrap(); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut_repo = tx.repo_mut(); let new_wc_commit = write_random_commit(mut_repo, &settings); mut_repo.edit(ws_id, &new_wc_commit).unwrap(); @@ -230,7 +230,7 @@ fn test_edit_previous_empty_with_other_workspace() { let test_repo = TestRepo::init(); let repo = &test_repo.repo; - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut_repo = tx.repo_mut(); let old_wc_commit = mut_repo .new_commit( @@ -246,7 +246,7 @@ fn test_edit_previous_empty_with_other_workspace() { mut_repo.edit(other_ws_id.clone(), &old_wc_commit).unwrap(); let repo = tx.commit("test").unwrap(); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut_repo = tx.repo_mut(); let new_wc_commit = write_random_commit(mut_repo, &settings); mut_repo.edit(ws_id, &new_wc_commit).unwrap(); @@ -262,7 +262,7 @@ fn test_edit_previous_empty_non_head() { let test_repo = TestRepo::init(); let repo = &test_repo.repo; - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut_repo = tx.repo_mut(); let old_wc_commit = mut_repo .new_commit( @@ -284,7 +284,7 @@ fn test_edit_previous_empty_non_head() { mut_repo.edit(ws_id.clone(), &old_wc_commit).unwrap(); let repo = tx.commit("test").unwrap(); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut_repo = tx.repo_mut(); let new_wc_commit = write_random_commit(mut_repo, &settings); mut_repo.edit(ws_id, &new_wc_commit).unwrap(); @@ -303,11 +303,11 @@ fn test_edit_initial() { let test_repo = TestRepo::init(); let repo = &test_repo.repo; - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let wc_commit = write_random_commit(tx.repo_mut(), &settings); let repo = tx.commit("test").unwrap(); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let workspace_id = WorkspaceId::new("new-workspace".to_string()); tx.repo_mut() .edit(workspace_id.clone(), &wc_commit) @@ -327,13 +327,13 @@ fn test_edit_hidden_commit() { let test_repo = TestRepo::init(); let repo = &test_repo.repo; - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let wc_commit = write_random_commit(tx.repo_mut(), &settings); // Intentionally not doing tx.commit, so the commit id is not tracked // in the view head ids. - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let ws_id = WorkspaceId::default(); tx.repo_mut().edit(ws_id.clone(), &wc_commit).unwrap(); let repo = tx.commit("test").unwrap(); @@ -351,11 +351,11 @@ fn test_add_head_success() { // Create a commit outside of the repo by using a temporary transaction. Then // add that as a head. - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let new_commit = write_random_commit(tx.repo_mut(), &settings); drop(tx); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut_repo = tx.repo_mut(); assert!(!mut_repo.view().heads().contains(new_commit.id())); assert!(!mut_repo.index().has_id(new_commit.id())); @@ -375,7 +375,7 @@ fn test_add_head_ancestor() { let test_repo = TestRepo::init(); let repo = &test_repo.repo; - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut graph_builder = CommitGraphBuilder::new(&settings, tx.repo_mut()); let commit1 = graph_builder.initial_commit(); let commit2 = graph_builder.commit_with_parents(&[&commit1]); @@ -383,7 +383,7 @@ fn test_add_head_ancestor() { let repo = tx.commit("test").unwrap(); assert_eq!(repo.view().heads(), &hashset! {commit3.id().clone()}); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut_repo = tx.repo_mut(); mut_repo.add_head(&commit1).unwrap(); assert_eq!(repo.view().heads(), &hashset! {commit3.id().clone()}); @@ -397,13 +397,13 @@ fn test_add_head_not_immediate_child() { let test_repo = TestRepo::init(); let repo = &test_repo.repo; - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let initial = write_random_commit(tx.repo_mut(), &settings); let repo = tx.commit("test").unwrap(); // Create some commits outside of the repo by using a temporary transaction. // Then add one of them as a head. - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let rewritten = create_random_commit(tx.repo_mut(), &settings) .set_change_id(initial.change_id().clone()) .set_predecessors(vec![initial.id().clone()]) @@ -416,7 +416,7 @@ fn test_add_head_not_immediate_child() { drop(tx); assert_eq!(repo.view().heads(), &hashset! {initial.id().clone()}); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut_repo = tx.repo_mut(); mut_repo.add_head(&child).unwrap(); assert_eq!( @@ -437,14 +437,14 @@ fn test_remove_head() { let test_repo = TestRepo::init(); let repo = &test_repo.repo; - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut graph_builder = CommitGraphBuilder::new(&settings, tx.repo_mut()); let commit1 = graph_builder.initial_commit(); let commit2 = graph_builder.commit_with_parents(&[&commit1]); let commit3 = graph_builder.commit_with_parents(&[&commit2]); let repo = tx.commit("test").unwrap(); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut_repo = tx.repo_mut(); assert!(mut_repo.view().heads().contains(commit3.id())); mut_repo.remove_head(commit3.id()); @@ -478,7 +478,7 @@ fn test_has_changed() { state: RemoteRefState::Tracking, // doesn't matter }; - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut_repo = tx.repo_mut(); let commit1 = write_random_commit(mut_repo, &settings); let commit2 = write_random_commit(mut_repo, &settings); @@ -493,7 +493,7 @@ fn test_has_changed() { // Test the setup assert_eq!(repo.view().heads(), &hashset! {commit1.id().clone()}); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut_repo = tx.repo_mut(); mut_repo.add_head(&commit1).unwrap(); @@ -539,7 +539,7 @@ fn test_rebase_descendants_simple() { let test_repo = TestRepo::init(); let repo = &test_repo.repo; - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut graph_builder = CommitGraphBuilder::new(&settings, tx.repo_mut()); let commit1 = graph_builder.initial_commit(); let commit2 = graph_builder.commit_with_parents(&[&commit1]); @@ -548,7 +548,7 @@ fn test_rebase_descendants_simple() { let commit5 = graph_builder.commit_with_parents(&[&commit4]); let repo = tx.commit("test").unwrap(); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut_repo = tx.repo_mut(); let mut graph_builder = CommitGraphBuilder::new(&settings, mut_repo); let commit6 = graph_builder.commit_with_parents(&[&commit1]); @@ -581,14 +581,14 @@ fn test_rebase_descendants_divergent_rewrite() { let test_repo = TestRepo::init(); let repo = &test_repo.repo; - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut graph_builder = CommitGraphBuilder::new(&settings, tx.repo_mut()); let commit1 = graph_builder.initial_commit(); let commit2 = graph_builder.commit_with_parents(&[&commit1]); let _commit3 = graph_builder.commit_with_parents(&[&commit2]); let repo = tx.commit("test").unwrap(); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut_repo = tx.repo_mut(); let mut graph_builder = CommitGraphBuilder::new(&settings, mut_repo); let commit4 = graph_builder.commit_with_parents(&[&commit1]); @@ -611,7 +611,7 @@ fn test_rename_remote() { let settings = testutils::user_settings(); let test_repo = TestRepo::init(); let repo = &test_repo.repo; - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut_repo = tx.repo_mut(); let commit = write_random_commit(mut_repo, &settings); let remote_ref = RemoteRef { @@ -635,14 +635,14 @@ fn test_remove_wc_commit_previous_not_discardable() { let test_repo = TestRepo::init(); let repo = &test_repo.repo; - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut_repo = tx.repo_mut(); let old_wc_commit = write_random_commit(mut_repo, &settings); let ws_id = WorkspaceId::default(); mut_repo.edit(ws_id.clone(), &old_wc_commit).unwrap(); let repo = tx.commit("test").unwrap(); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut_repo = tx.repo_mut(); mut_repo.remove_wc_commit(&ws_id).unwrap(); mut_repo.rebase_descendants(&settings).unwrap(); @@ -657,7 +657,7 @@ fn test_remove_wc_commit_previous_discardable() { let test_repo = TestRepo::init(); let repo = &test_repo.repo; - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut_repo = tx.repo_mut(); let old_wc_commit = mut_repo .new_commit( @@ -671,7 +671,7 @@ fn test_remove_wc_commit_previous_discardable() { mut_repo.edit(ws_id.clone(), &old_wc_commit).unwrap(); let repo = tx.commit("test").unwrap(); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut_repo = tx.repo_mut(); mut_repo.remove_wc_commit(&ws_id).unwrap(); mut_repo.rebase_descendants(&settings).unwrap(); @@ -686,7 +686,7 @@ fn test_reparent_descendants() { let test_repo = TestRepo::init(); let repo = &test_repo.repo; - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut graph_builder = CommitGraphBuilder::new(&settings, tx.repo_mut()); let commit_a = graph_builder.initial_commit(); let commit_b = graph_builder.initial_commit(); @@ -707,7 +707,7 @@ fn test_reparent_descendants() { let repo = tx.commit("test").unwrap(); // Rewrite "commit_a". - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut_repo = tx.repo_mut(); mut_repo .rewrite_commit(&settings, &commit_a) diff --git a/lib/tests/test_operations.rs b/lib/tests/test_operations.rs index 5d411c1ab9..e27843885d 100644 --- a/lib/tests/test_operations.rs +++ b/lib/tests/test_operations.rs @@ -53,7 +53,7 @@ fn test_unpublished_operation() { let op_id0 = repo.op_id().clone(); assert_eq!(list_dir(&op_heads_dir), vec![repo.op_id().hex()]); - let mut tx1 = repo.start_transaction(&settings); + let mut tx1 = repo.start_transaction(); write_random_commit(tx1.repo_mut(), &settings); let unpublished_op = tx1.write("transaction 1"); let op_id1 = unpublished_op.operation().id().clone(); @@ -75,7 +75,7 @@ fn test_consecutive_operations() { let op_id0 = repo.op_id().clone(); assert_eq!(list_dir(&op_heads_dir), vec![repo.op_id().hex()]); - let mut tx1 = repo.start_transaction(&settings); + let mut tx1 = repo.start_transaction(); write_random_commit(tx1.repo_mut(), &settings); let op_id1 = tx1 .commit("transaction 1") @@ -87,7 +87,7 @@ fn test_consecutive_operations() { assert_eq!(list_dir(&op_heads_dir), vec![op_id1.hex()]); let repo = repo.reload_at_head(&settings).unwrap(); - let mut tx2 = repo.start_transaction(&settings); + let mut tx2 = repo.start_transaction(); write_random_commit(tx2.repo_mut(), &settings); let op_id2 = tx2 .commit("transaction 2") @@ -117,7 +117,7 @@ fn test_concurrent_operations() { let op_id0 = repo.op_id().clone(); assert_eq!(list_dir(&op_heads_dir), vec![repo.op_id().hex()]); - let mut tx1 = repo.start_transaction(&settings); + let mut tx1 = repo.start_transaction(); write_random_commit(tx1.repo_mut(), &settings); let op_id1 = tx1 .commit("transaction 1") @@ -130,7 +130,7 @@ fn test_concurrent_operations() { // After both transactions have committed, we should have two op-heads on disk, // since they were run in parallel. - let mut tx2 = repo.start_transaction(&settings); + let mut tx2 = repo.start_transaction(); write_random_commit(tx2.repo_mut(), &settings); let op_id2 = tx2 .commit("transaction 2") @@ -167,16 +167,16 @@ fn test_isolation() { let test_repo = TestRepo::init(); let repo = &test_repo.repo; - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let initial = create_random_commit(tx.repo_mut(), &settings) .set_parents(vec![repo.store().root_commit_id().clone()]) .write() .unwrap(); let repo = tx.commit("test").unwrap(); - let mut tx1 = repo.start_transaction(&settings); + let mut tx1 = repo.start_transaction(); let mut_repo1 = tx1.repo_mut(); - let mut tx2 = repo.start_transaction(&settings); + let mut tx2 = repo.start_transaction(); let mut_repo2 = tx2.repo_mut(); assert_heads(repo.as_ref(), vec![initial.id()]); @@ -237,7 +237,7 @@ fn test_reparent_range_linear() { // A // 0 (initial) let random_tx = |repo: &Arc| { - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); write_random_commit(tx.repo_mut(), &settings); tx }; @@ -309,7 +309,7 @@ fn test_reparent_range_branchy() { // A // 0 (initial) let random_tx = |repo: &Arc| { - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); write_random_commit(tx.repo_mut(), &settings); tx }; @@ -445,7 +445,7 @@ fn test_resolve_op_id() { // The actual value of `i` doesn't matter, we just need to make sure we end // up with hashes with ambiguous prefixes. for i in (1..5).chain([39, 62]) { - let tx = repo.start_transaction(&settings); + let tx = repo.start_transaction(); let repo = tx.commit(format!("transaction {i}")).unwrap(); operations.push(repo.operation().clone()); } @@ -531,7 +531,7 @@ fn test_resolve_op_parents_children() { let mut repos = Vec::new(); for _ in 0..3 { - let tx = repo.start_transaction(&settings); + let tx = repo.start_transaction(); repos.push(tx.commit("test").unwrap()); repo = repos.last().unwrap(); } @@ -591,8 +591,8 @@ fn test_resolve_op_parents_children() { ); // Merge and fork - let tx1 = repo.start_transaction(&settings); - let tx2 = repo.start_transaction(&settings); + let tx1 = repo.start_transaction(); + let tx2 = repo.start_transaction(); let repo = testutils::commit_transactions(&settings, vec![tx1, tx2]); let op5_id_hex = repo.operation().id().hex(); assert_matches!( @@ -613,7 +613,7 @@ fn test_resolve_op_parents_children() { #[test] fn test_gc() { let settings = stable_op_id_settings(); - let test_repo = TestRepo::init(); + let test_repo = TestRepo::init_with_settings(&settings); let op_dir = test_repo.repo_path().join("op_store").join("operations"); let view_dir = test_repo.repo_path().join("op_store").join("views"); let repo_0 = test_repo.repo; @@ -629,9 +629,9 @@ fn test_gc() { // B // A // 0 (root) - let empty_tx = |repo: &Arc| repo.start_transaction(&settings); + let empty_tx = |repo: &Arc| repo.start_transaction(); let random_tx = |repo: &Arc| { - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); write_random_commit(tx.repo_mut(), &settings); tx }; diff --git a/lib/tests/test_refs.rs b/lib/tests/test_refs.rs index 8e484c0940..07836e9e81 100644 --- a/lib/tests/test_refs.rs +++ b/lib/tests/test_refs.rs @@ -33,7 +33,7 @@ fn test_merge_ref_targets() { // | 2 // |/ // 1 - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut graph_builder = CommitGraphBuilder::new(&settings, tx.repo_mut()); let commit1 = graph_builder.initial_commit(); let commit2 = graph_builder.commit_with_parents(&[&commit1]); diff --git a/lib/tests/test_revset.rs b/lib/tests/test_revset.rs index b8f63eb265..758db1aa5b 100644 --- a/lib/tests/test_revset.rs +++ b/lib/tests/test_revset.rs @@ -117,7 +117,7 @@ fn test_resolve_symbol_commit_id() { let test_repo = TestRepo::init_with_backend(TestRepoBackend::Git); let repo = &test_repo.repo; - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut_repo = tx.repo_mut(); let signature = Signature { name: "test".to_string(), @@ -227,7 +227,6 @@ fn test_resolve_symbol_commit_id() { #[test_case(false ; "mutable")] #[test_case(true ; "readonly")] fn test_resolve_symbol_change_id(readonly: bool) { - let settings = testutils::user_settings(); let git_settings = GitSettings::default(); // Test only with git so we can get predictable change ids let test_repo = TestRepo::init_with_backend(TestRepoBackend::Git); @@ -270,7 +269,7 @@ fn test_resolve_symbol_change_id(readonly: bool) { git_commit_ids.push(git_commit_id); } - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); git::import_refs(tx.repo_mut(), &git_settings).unwrap(); // Test the test setup @@ -376,7 +375,7 @@ fn test_resolve_symbol_in_different_disambiguation_context() { let test_repo = TestRepo::init(); let repo0 = &test_repo.repo; - let mut tx = repo0.start_transaction(&settings); + let mut tx = repo0.start_transaction(); let commit1 = write_random_commit(tx.repo_mut(), &settings); // Create more commits that are likely to conflict with 1-char hex prefix. for _ in 0..50 { @@ -384,7 +383,7 @@ fn test_resolve_symbol_in_different_disambiguation_context() { } let repo1 = tx.commit("test").unwrap(); - let mut tx = repo1.start_transaction(&settings); + let mut tx = repo1.start_transaction(); let commit2 = tx .repo_mut() .rewrite_commit(&settings, &commit1) @@ -437,7 +436,7 @@ fn test_resolve_working_copy() { let test_repo = TestRepo::init(); let repo = &test_repo.repo; - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut_repo = tx.repo_mut(); let commit1 = write_random_commit(mut_repo, &settings); @@ -497,7 +496,7 @@ fn test_resolve_working_copies() { let test_repo = TestRepo::init(); let repo = &test_repo.repo; - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut_repo = tx.repo_mut(); let commit1 = write_random_commit(mut_repo, &settings); @@ -545,7 +544,7 @@ fn test_resolve_symbol_bookmarks() { let normal_tracking_remote_ref = |id: &CommitId| tracking_remote_ref(RefTarget::normal(id.clone())); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut_repo = tx.repo_mut(); let commit1 = write_random_commit(mut_repo, &settings); @@ -768,7 +767,7 @@ fn test_resolve_symbol_tags() { let test_repo = TestRepo::init(); let repo = &test_repo.repo; - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut_repo = tx.repo_mut(); let commit1 = write_random_commit(mut_repo, &settings); @@ -816,7 +815,7 @@ fn test_resolve_symbol_git_refs() { let test_repo = TestRepo::init(); let repo = &test_repo.repo; - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut_repo = tx.repo_mut(); // Create some commits and refs to work with and so the repo is not empty @@ -986,7 +985,7 @@ fn test_evaluate_expression_root_and_checkout() { let root_operation = repo.loader().root_operation(); let root_repo = repo.reload_at(&root_operation).unwrap(); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut_repo = tx.repo_mut(); let root_commit = repo.store().root_commit(); @@ -1027,7 +1026,7 @@ fn test_evaluate_expression_heads() { let repo = &test_repo.repo; let root_commit = repo.store().root_commit(); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut_repo = tx.repo_mut(); let mut graph_builder = CommitGraphBuilder::new(&settings, mut_repo); let commit1 = graph_builder.initial_commit(); @@ -1092,7 +1091,7 @@ fn test_evaluate_expression_roots() { let repo = &test_repo.repo; let root_commit = repo.store().root_commit(); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut_repo = tx.repo_mut(); let mut graph_builder = CommitGraphBuilder::new(&settings, mut_repo); let commit1 = graph_builder.initial_commit(); @@ -1147,7 +1146,7 @@ fn test_evaluate_expression_parents() { let repo = &test_workspace.repo; let root_commit = repo.store().root_commit(); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut_repo = tx.repo_mut(); let mut graph_builder = CommitGraphBuilder::new(&settings, mut_repo); let commit1 = graph_builder.initial_commit(); @@ -1219,7 +1218,7 @@ fn test_evaluate_expression_children() { let test_repo = TestRepo::init(); let repo = &test_repo.repo; - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut_repo = tx.repo_mut(); let commit1 = write_random_commit(mut_repo, &settings); @@ -1300,7 +1299,7 @@ fn test_evaluate_expression_ancestors() { let repo = &test_repo.repo; let root_commit = repo.store().root_commit(); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut_repo = tx.repo_mut(); let mut graph_builder = CommitGraphBuilder::new(&settings, mut_repo); let commit1 = graph_builder.initial_commit(); @@ -1386,7 +1385,7 @@ fn test_evaluate_expression_range() { let test_repo = TestRepo::init(); let repo = &test_repo.repo; - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut_repo = tx.repo_mut(); let mut graph_builder = CommitGraphBuilder::new(&settings, mut_repo); let commit1 = graph_builder.initial_commit(); @@ -1462,7 +1461,7 @@ fn test_evaluate_expression_dag_range() { let repo = &test_repo.repo; let root_commit_id = repo.store().root_commit_id().clone(); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut_repo = tx.repo_mut(); let mut graph_builder = CommitGraphBuilder::new(&settings, mut_repo); let commit1 = graph_builder.initial_commit(); @@ -1555,7 +1554,7 @@ fn test_evaluate_expression_connected() { let repo = &test_repo.repo; let root_commit_id = repo.store().root_commit_id().clone(); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut_repo = tx.repo_mut(); let mut graph_builder = CommitGraphBuilder::new(&settings, mut_repo); let commit1 = graph_builder.initial_commit(); @@ -1626,7 +1625,7 @@ fn test_evaluate_expression_reachable() { let test_repo = TestRepo::init(); let repo = &test_repo.repo; - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut_repo = tx.repo_mut(); // Construct 3 separate subgraphs off the root commit. @@ -1784,7 +1783,7 @@ fn test_evaluate_expression_descendants() { let test_repo = TestRepo::init(); let repo = &test_repo.repo; - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut_repo = tx.repo_mut(); let root_commit_id = repo.store().root_commit_id().clone(); @@ -1912,7 +1911,7 @@ fn test_evaluate_expression_all() { let test_repo = TestRepo::init(); let repo = &test_repo.repo; - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut_repo = tx.repo_mut(); let root_commit_id = repo.store().root_commit_id().clone(); let mut graph_builder = CommitGraphBuilder::new(&settings, mut_repo); @@ -1939,7 +1938,7 @@ fn test_evaluate_expression_visible_heads() { let test_repo = TestRepo::init(); let repo = &test_repo.repo; - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut_repo = tx.repo_mut(); let mut graph_builder = CommitGraphBuilder::new(&settings, mut_repo); let commit1 = graph_builder.initial_commit(); @@ -1958,7 +1957,7 @@ fn test_evaluate_expression_git_refs() { let test_repo = TestRepo::init(); let repo = &test_repo.repo; - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut_repo = tx.repo_mut(); let commit1 = write_random_commit(mut_repo, &settings); @@ -2017,7 +2016,7 @@ fn test_evaluate_expression_git_head() { let test_repo = TestRepo::init(); let repo = &test_repo.repo; - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut_repo = tx.repo_mut(); let commit1 = write_random_commit(mut_repo, &settings); @@ -2037,7 +2036,7 @@ fn test_evaluate_expression_bookmarks() { let test_repo = TestRepo::init(); let repo = &test_repo.repo; - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut_repo = tx.repo_mut(); let commit1 = write_random_commit(mut_repo, &settings); @@ -2134,7 +2133,7 @@ fn test_evaluate_expression_remote_bookmarks() { let normal_tracking_remote_ref = |id: &CommitId| tracking_remote_ref(RefTarget::normal(id.clone())); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut_repo = tx.repo_mut(); let commit1 = write_random_commit(mut_repo, &settings); @@ -2310,7 +2309,7 @@ fn test_evaluate_expression_tags() { let test_repo = TestRepo::init(); let repo = &test_repo.repo; - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut_repo = tx.repo_mut(); let commit1 = write_random_commit(mut_repo, &settings); @@ -2395,7 +2394,7 @@ fn test_evaluate_expression_latest() { let test_repo = TestRepo::init(); let repo = &test_repo.repo; - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut_repo = tx.repo_mut(); let mut write_commit_with_committer_timestamp = |sec: i64| { @@ -2486,7 +2485,7 @@ fn test_evaluate_expression_fork_point() { // | |/ // |/ // 0 - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut_repo = tx.repo_mut(); let mut graph_builder = CommitGraphBuilder::new(&settings, mut_repo); let root_commit = repo.store().root_commit(); @@ -2607,7 +2606,7 @@ fn test_evaluate_expression_fork_point_criss_cross() { // 1 2 // |/ // 0 - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut_repo = tx.repo_mut(); let mut graph_builder = CommitGraphBuilder::new(&settings, mut_repo); let commit1 = graph_builder.initial_commit(); @@ -2635,7 +2634,7 @@ fn test_evaluate_expression_fork_point_merge_with_ancestor() { // 1 2 3 // \|/ // 0 - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut_repo = tx.repo_mut(); let mut graph_builder = CommitGraphBuilder::new(&settings, mut_repo); let commit1 = graph_builder.initial_commit(); @@ -2659,7 +2658,7 @@ fn test_evaluate_expression_merges() { let test_repo = TestRepo::init(); let repo = &test_repo.repo; - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut_repo = tx.repo_mut(); let mut graph_builder = CommitGraphBuilder::new(&settings, mut_repo); let commit1 = graph_builder.initial_commit(); @@ -2686,7 +2685,7 @@ fn test_evaluate_expression_description() { let test_repo = TestRepo::init(); let repo = &test_repo.repo; - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut_repo = tx.repo_mut(); let commit1 = create_random_commit(mut_repo, &settings) @@ -2731,7 +2730,7 @@ fn test_evaluate_expression_author() { let test_repo = TestRepo::init(); let repo = &test_repo.repo; - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut_repo = tx.repo_mut(); let timestamp = Timestamp { @@ -2817,7 +2816,7 @@ fn test_evaluate_expression_author_date() { let test_repo = TestRepo::init(); let repo = &test_repo.repo; - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut_repo = tx.repo_mut(); let timestamp1 = parse_timestamp("2023-03-25T11:30:00Z"); @@ -2884,7 +2883,7 @@ fn test_evaluate_expression_committer_date() { let test_repo = TestRepo::init(); let repo = &test_repo.repo; - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut_repo = tx.repo_mut(); let timestamp1 = parse_timestamp("2023-03-25T11:30:00Z"); @@ -2951,7 +2950,7 @@ fn test_evaluate_expression_mine() { let test_repo = TestRepo::init(); let repo = &test_repo.repo; - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut_repo = tx.repo_mut(); let timestamp = Timestamp { @@ -3017,7 +3016,7 @@ fn test_evaluate_expression_committer() { let test_repo = TestRepo::init(); let repo = &test_repo.repo; - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut_repo = tx.repo_mut(); let timestamp = Timestamp { @@ -3092,7 +3091,7 @@ fn test_evaluate_expression_at_operation() { let repo0 = &test_repo.repo; let root_commit = repo0.store().root_commit(); - let mut tx = repo0.start_transaction(&settings); + let mut tx = repo0.start_transaction(); let commit1_op1 = create_random_commit(tx.repo_mut(), &settings) .set_description("commit1@op1") .write() @@ -3105,7 +3104,7 @@ fn test_evaluate_expression_at_operation() { .set_local_bookmark_target("commit1_ref", RefTarget::normal(commit1_op1.id().clone())); let repo1 = tx.commit("test").unwrap(); - let mut tx = repo1.start_transaction(&settings); + let mut tx = repo1.start_transaction(); let commit1_op2 = tx .repo_mut() .rewrite_commit(&settings, &commit1_op1) @@ -3119,7 +3118,7 @@ fn test_evaluate_expression_at_operation() { tx.repo_mut().rebase_descendants(&settings).unwrap(); let repo2 = tx.commit("test").unwrap(); - let mut tx = repo2.start_transaction(&settings); + let mut tx = repo2.start_transaction(); let _commit4_op3 = create_random_commit(tx.repo_mut(), &settings) .set_description("commit4@op3") .write() @@ -3226,7 +3225,7 @@ fn test_evaluate_expression_coalesce() { let repo = &test_repo.repo; let root_commit_id = repo.store().root_commit_id().clone(); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut_repo = tx.repo_mut(); let mut graph_builder = CommitGraphBuilder::new(&settings, mut_repo); let commit1 = graph_builder.initial_commit(); @@ -3304,7 +3303,7 @@ fn test_evaluate_expression_union() { let repo = &test_repo.repo; let root_commit = repo.store().root_commit(); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut_repo = tx.repo_mut(); let mut graph_builder = CommitGraphBuilder::new(&settings, mut_repo); let commit1 = graph_builder.initial_commit(); @@ -3375,7 +3374,7 @@ fn test_evaluate_expression_machine_generated_union() { let test_repo = TestRepo::init(); let repo = &test_repo.repo; - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut_repo = tx.repo_mut(); let mut graph_builder = CommitGraphBuilder::new(&settings, mut_repo); let commit1 = graph_builder.initial_commit(); @@ -3399,7 +3398,7 @@ fn test_evaluate_expression_intersection() { let repo = &test_repo.repo; let root_commit = repo.store().root_commit(); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut_repo = tx.repo_mut(); let mut graph_builder = CommitGraphBuilder::new(&settings, mut_repo); let commit1 = graph_builder.initial_commit(); @@ -3435,7 +3434,7 @@ fn test_evaluate_expression_difference() { let repo = &test_repo.repo; let root_commit = repo.store().root_commit(); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut_repo = tx.repo_mut(); let mut graph_builder = CommitGraphBuilder::new(&settings, mut_repo); let commit1 = graph_builder.initial_commit(); @@ -3515,7 +3514,7 @@ fn test_evaluate_expression_filter_combinator() { let test_repo = TestRepo::init(); let repo = &test_repo.repo; - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut_repo = tx.repo_mut(); let root_commit_id = repo.store().root_commit_id(); @@ -3575,7 +3574,7 @@ fn test_evaluate_expression_file() { let test_workspace = TestWorkspace::init(&settings); let repo = &test_workspace.repo; - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut_repo = tx.repo_mut(); let added_clean_clean = RepoPath::from_internal_string("added_clean_clean"); @@ -3691,7 +3690,7 @@ fn test_evaluate_expression_diff_contains() { let test_workspace = TestWorkspace::init(&settings); let repo = &test_workspace.repo; - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut_repo = tx.repo_mut(); let empty_clean_inserted_deleted = @@ -3837,7 +3836,7 @@ fn test_evaluate_expression_file_merged_parents() { let test_workspace = TestWorkspace::init(&settings); let repo = &test_workspace.repo; - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut_repo = tx.repo_mut(); // file2 can be merged automatically, file1 can't. @@ -3911,7 +3910,7 @@ fn test_evaluate_expression_conflict() { let test_workspace = TestWorkspace::init(&settings); let repo = &test_workspace.repo; - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut_repo = tx.repo_mut(); // Create a few trees, including one with a conflict in `file1` @@ -3962,7 +3961,7 @@ fn test_reverse_graph() { // A // | // root - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut graph_builder = CommitGraphBuilder::new(&settings, tx.repo_mut()); let commit_a = graph_builder.initial_commit(); let commit_b = graph_builder.commit_with_parents(&[&commit_a]); @@ -4005,7 +4004,7 @@ fn test_no_such_revision_suggestion() { let test_repo = TestRepo::init(); let repo = &test_repo.repo; - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut_repo = tx.repo_mut(); let commit = write_random_commit(mut_repo, &settings); @@ -4027,7 +4026,7 @@ fn test_revset_containing_fn() { let test_repo = TestRepo::init(); let repo = &test_repo.repo; - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut_repo = tx.repo_mut(); let commit_a = write_random_commit(mut_repo, &settings); let commit_b = write_random_commit(mut_repo, &settings); diff --git a/lib/tests/test_rewrite.rs b/lib/tests/test_rewrite.rs index 1b1feb9763..1c67465bdb 100644 --- a/lib/tests/test_rewrite.rs +++ b/lib/tests/test_rewrite.rs @@ -88,7 +88,7 @@ fn test_rebase_descendants_sideways() { // | B // |/ // A - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut graph_builder = CommitGraphBuilder::new(&settings, tx.repo_mut()); let commit_a = graph_builder.initial_commit(); let commit_b = graph_builder.commit_with_parents(&[&commit_a]); @@ -141,7 +141,7 @@ fn test_rebase_descendants_forward() { // |/ // B // A - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut graph_builder = CommitGraphBuilder::new(&settings, tx.repo_mut()); let commit_a = graph_builder.initial_commit(); let commit_b = graph_builder.commit_with_parents(&[&commit_a]); @@ -196,7 +196,7 @@ fn test_rebase_descendants_reorder() { // |/ // B // A - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut graph_builder = CommitGraphBuilder::new(&settings, tx.repo_mut()); let commit_a = graph_builder.initial_commit(); let commit_b = graph_builder.commit_with_parents(&[&commit_a]); @@ -241,7 +241,7 @@ fn test_rebase_descendants_backward() { // C // B // A - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut graph_builder = CommitGraphBuilder::new(&settings, tx.repo_mut()); let commit_a = graph_builder.initial_commit(); let commit_b = graph_builder.commit_with_parents(&[&commit_a]); @@ -279,7 +279,7 @@ fn test_rebase_descendants_chain_becomes_branchy() { // B E // |/ // A - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut graph_builder = CommitGraphBuilder::new(&settings, tx.repo_mut()); let commit_a = graph_builder.initial_commit(); let commit_b = graph_builder.commit_with_parents(&[&commit_a]); @@ -325,7 +325,7 @@ fn test_rebase_descendants_internal_merge() { // | B // |/ // A - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut graph_builder = CommitGraphBuilder::new(&settings, tx.repo_mut()); let commit_a = graph_builder.initial_commit(); let commit_b = graph_builder.commit_with_parents(&[&commit_a]); @@ -373,7 +373,7 @@ fn test_rebase_descendants_external_merge() { // | B // |/ // A - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut graph_builder = CommitGraphBuilder::new(&settings, tx.repo_mut()); let commit_a = graph_builder.initial_commit(); let commit_b = graph_builder.commit_with_parents(&[&commit_a]); @@ -417,7 +417,7 @@ fn test_rebase_descendants_abandon() { // |/ // B // A - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut graph_builder = CommitGraphBuilder::new(&settings, tx.repo_mut()); let commit_a = graph_builder.initial_commit(); let commit_b = graph_builder.commit_with_parents(&[&commit_a]); @@ -458,7 +458,7 @@ fn test_rebase_descendants_abandon_no_descendants() { // C // B // A - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut graph_builder = CommitGraphBuilder::new(&settings, tx.repo_mut()); let commit_a = graph_builder.initial_commit(); let commit_b = graph_builder.commit_with_parents(&[&commit_a]); @@ -494,7 +494,7 @@ fn test_rebase_descendants_abandon_and_replace() { // E B // |/ // A - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut graph_builder = CommitGraphBuilder::new(&settings, tx.repo_mut()); let commit_a = graph_builder.initial_commit(); let commit_b = graph_builder.commit_with_parents(&[&commit_a]); @@ -532,7 +532,7 @@ fn test_rebase_descendants_abandon_degenerate_merge_simplify() { // B C // |/ // A - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut graph_builder = CommitGraphBuilder::new(&settings, tx.repo_mut()); let commit_a = graph_builder.initial_commit(); let commit_b = graph_builder.commit_with_parents(&[&commit_a]); @@ -573,7 +573,7 @@ fn test_rebase_descendants_abandon_degenerate_merge_preserve() { // B C // |/ // A - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut graph_builder = CommitGraphBuilder::new(&settings, tx.repo_mut()); let commit_a = graph_builder.initial_commit(); let commit_b = graph_builder.commit_with_parents(&[&commit_a]); @@ -621,7 +621,7 @@ fn test_rebase_descendants_abandon_widen_merge() { // B C D // \|/ // A - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut graph_builder = CommitGraphBuilder::new(&settings, tx.repo_mut()); let commit_a = graph_builder.initial_commit(); let commit_b = graph_builder.commit_with_parents(&[&commit_a]); @@ -663,7 +663,7 @@ fn test_rebase_descendants_multiple_sideways() { // | |/ // |/ // A - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut graph_builder = CommitGraphBuilder::new(&settings, tx.repo_mut()); let commit_a = graph_builder.initial_commit(); let commit_b = graph_builder.commit_with_parents(&[&commit_a]); @@ -707,7 +707,7 @@ fn test_rebase_descendants_multiple_swap() { // B D // |/ // A - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut graph_builder = CommitGraphBuilder::new(&settings, tx.repo_mut()); let commit_a = graph_builder.initial_commit(); let commit_b = graph_builder.commit_with_parents(&[&commit_a]); @@ -735,7 +735,7 @@ fn test_rebase_descendants_multiple_no_descendants() { // B C // |/ // A - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut graph_builder = CommitGraphBuilder::new(&settings, tx.repo_mut()); let commit_a = graph_builder.initial_commit(); let commit_b = graph_builder.commit_with_parents(&[&commit_a]); @@ -775,7 +775,7 @@ fn test_rebase_descendants_divergent_rewrite() { // | B2 // |/ // A - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut graph_builder = CommitGraphBuilder::new(&settings, tx.repo_mut()); let commit_a = graph_builder.initial_commit(); let commit_b = graph_builder.commit_with_parents(&[&commit_a]); @@ -837,7 +837,7 @@ fn test_rebase_descendants_repeated() { // | B2 // |/ // A - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut graph_builder = CommitGraphBuilder::new(&settings, tx.repo_mut()); let commit_a = graph_builder.initial_commit(); let commit_b = graph_builder.commit_with_parents(&[&commit_a]); @@ -907,7 +907,7 @@ fn test_rebase_descendants_contents() { // | B // |/ // A - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let path1 = RepoPath::from_internal_string("file1"); let tree1 = create_tree(repo, &[(path1, "content")]); let commit_a = tx @@ -983,7 +983,7 @@ fn test_rebase_descendants_basic_bookmark_update() { // B main B2 main // | => | // A A - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut graph_builder = CommitGraphBuilder::new(&settings, tx.repo_mut()); let commit_a = graph_builder.initial_commit(); let commit_b = graph_builder.commit_with_parents(&[&commit_a]); @@ -991,7 +991,7 @@ fn test_rebase_descendants_basic_bookmark_update() { .set_local_bookmark_target("main", RefTarget::normal(commit_b.id().clone())); let repo = tx.commit("test").unwrap(); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let commit_b2 = tx .repo_mut() .rewrite_commit(&settings, &commit_b) @@ -1025,7 +1025,7 @@ fn test_rebase_descendants_bookmark_move_two_steps() { // B B2 B2 // |/ | // A A - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut graph_builder = CommitGraphBuilder::new(&settings, tx.repo_mut()); let commit_a = graph_builder.initial_commit(); let commit_b = graph_builder.commit_with_parents(&[&commit_a]); @@ -1034,7 +1034,7 @@ fn test_rebase_descendants_bookmark_move_two_steps() { .set_local_bookmark_target("main", RefTarget::normal(commit_c.id().clone())); let repo = tx.commit("test").unwrap(); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let commit_b2 = tx .repo_mut() .rewrite_commit(&settings, &commit_b) @@ -1074,7 +1074,7 @@ fn test_rebase_descendants_basic_bookmark_update_with_non_local_bookmark() { // B main main@origin v1 | B main@origin v1 // | => |/ // A A - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut graph_builder = CommitGraphBuilder::new(&settings, tx.repo_mut()); let commit_a = graph_builder.initial_commit(); let commit_b = graph_builder.commit_with_parents(&[&commit_a]); @@ -1090,7 +1090,7 @@ fn test_rebase_descendants_basic_bookmark_update_with_non_local_bookmark() { .set_tag_target("v1", RefTarget::normal(commit_b.id().clone())); let repo = tx.commit("test").unwrap(); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let commit_b2 = tx .repo_mut() .rewrite_commit(&settings, &commit_b) @@ -1131,7 +1131,7 @@ fn test_rebase_descendants_update_bookmark_after_abandon() { // B main // | => A main // A - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut graph_builder = CommitGraphBuilder::new(&settings, tx.repo_mut()); let commit_a = graph_builder.initial_commit(); let commit_b = graph_builder.commit_with_parents(&[&commit_a]); @@ -1139,7 +1139,7 @@ fn test_rebase_descendants_update_bookmark_after_abandon() { .set_local_bookmark_target("main", RefTarget::normal(commit_b.id().clone())); let repo = tx.commit("test").unwrap(); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); tx.repo_mut().record_abandoned_commit(commit_b.id().clone()); tx.repo_mut().rebase_descendants(&settings).unwrap(); assert_eq!( @@ -1170,7 +1170,7 @@ fn test_rebase_descendants_update_bookmarks_after_divergent_rewrite() { // B main |/B2 main? |/B2 main? // | => |/ => |/ // A A A - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut graph_builder = CommitGraphBuilder::new(&settings, tx.repo_mut()); let commit_a = graph_builder.initial_commit(); let commit_b = graph_builder.commit_with_parents(&[&commit_a]); @@ -1181,7 +1181,7 @@ fn test_rebase_descendants_update_bookmarks_after_divergent_rewrite() { .set_local_bookmark_target("other", RefTarget::normal(commit_c.id().clone())); let repo = tx.commit("test").unwrap(); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let commit_b2 = tx .repo_mut() .rewrite_commit(&settings, &commit_b) @@ -1269,7 +1269,7 @@ fn test_rebase_descendants_rewrite_updates_bookmark_conflict() { // Bookmark "main" is a conflict removing commit A and adding commits B and C. // A gets rewritten as A2 and A3. B gets rewritten as B2 and B2. The bookmark // should become a conflict removing A and B, and adding B2, B3, C. - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut graph_builder = CommitGraphBuilder::new(&settings, tx.repo_mut()); let commit_a = graph_builder.initial_commit(); let commit_b = graph_builder.initial_commit(); @@ -1283,7 +1283,7 @@ fn test_rebase_descendants_rewrite_updates_bookmark_conflict() { ); let repo = tx.commit("test").unwrap(); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let commit_a2 = tx .repo_mut() .rewrite_commit(&settings, &commit_a) @@ -1358,7 +1358,7 @@ fn test_rebase_descendants_rewrite_resolves_bookmark_conflict() { // would result in a conflict removing A and adding B2 and C. However, since C // is a descendant of A, and B2 is a descendant of C, the conflict gets // resolved to B2. - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut graph_builder = CommitGraphBuilder::new(&settings, tx.repo_mut()); let commit_a = graph_builder.initial_commit(); let commit_b = graph_builder.commit_with_parents(&[&commit_a]); @@ -1372,7 +1372,7 @@ fn test_rebase_descendants_rewrite_resolves_bookmark_conflict() { ); let repo = tx.commit("test").unwrap(); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let commit_b2 = tx .repo_mut() .rewrite_commit(&settings, &commit_b) @@ -1402,7 +1402,7 @@ fn test_rebase_descendants_bookmark_delete_modify_abandon() { // leaves the bookmark pointing to "-A+B". We now abandon B. That should // result in the bookmark pointing to "-A+A=0", so the bookmark should // be deleted. - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut graph_builder = CommitGraphBuilder::new(&settings, tx.repo_mut()); let commit_a = graph_builder.initial_commit(); let commit_b = graph_builder.commit_with_parents(&[&commit_a]); @@ -1412,7 +1412,7 @@ fn test_rebase_descendants_bookmark_delete_modify_abandon() { ); let repo = tx.commit("test").unwrap(); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); tx.repo_mut().record_abandoned_commit(commit_b.id().clone()); tx.repo_mut().rebase_descendants(&settings).unwrap(); assert_eq!( @@ -1437,7 +1437,7 @@ fn test_rebase_descendants_update_checkout() { // C B // |/ // A - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let commit_a = write_random_commit(tx.repo_mut(), &settings); let commit_b = create_random_commit(tx.repo_mut(), &settings) .set_parents(vec![commit_a.id().clone()]) @@ -1457,7 +1457,7 @@ fn test_rebase_descendants_update_checkout() { .unwrap(); let repo = tx.commit("test").unwrap(); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let commit_c = tx .repo_mut() .rewrite_commit(&settings, &commit_b) @@ -1486,7 +1486,7 @@ fn test_rebase_descendants_update_checkout_abandoned() { // B // | // A - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let commit_a = write_random_commit(tx.repo_mut(), &settings); let commit_b = create_random_commit(tx.repo_mut(), &settings) .set_parents(vec![commit_a.id().clone()]) @@ -1506,7 +1506,7 @@ fn test_rebase_descendants_update_checkout_abandoned() { .unwrap(); let repo = tx.commit("test").unwrap(); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); tx.repo_mut().record_abandoned_commit(commit_b.id().clone()); tx.repo_mut().rebase_descendants(&settings).unwrap(); let repo = tx.commit("test").unwrap(); @@ -1539,7 +1539,7 @@ fn test_rebase_descendants_update_checkout_abandoned_merge() { // B C // |/ // A - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let commit_a = write_random_commit(tx.repo_mut(), &settings); let commit_b = create_random_commit(tx.repo_mut(), &settings) .set_parents(vec![commit_a.id().clone()]) @@ -1559,7 +1559,7 @@ fn test_rebase_descendants_update_checkout_abandoned_merge() { .unwrap(); let repo = tx.commit("test").unwrap(); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); tx.repo_mut().record_abandoned_commit(commit_d.id().clone()); tx.repo_mut().rebase_descendants(&settings).unwrap(); let repo = tx.commit("test").unwrap(); @@ -1594,7 +1594,7 @@ fn test_empty_commit_option(empty_behavior: EmptyBehaviour) { // | \|/ // | B // A__/ - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut_repo = tx.repo_mut(); let create_fixed_tree = |paths: &[&str]| { let content_map = paths @@ -1735,7 +1735,7 @@ fn test_rebase_abandoning_empty() { // |/ | // A A - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let commit_a = write_random_commit(tx.repo_mut(), &settings); let commit_b = create_random_commit(tx.repo_mut(), &settings) .set_parents(vec![commit_a.id().clone()]) diff --git a/lib/tests/test_rewrite_duplicate.rs b/lib/tests/test_rewrite_duplicate.rs index 2900e20301..d3a6680a1c 100644 --- a/lib/tests/test_rewrite_duplicate.rs +++ b/lib/tests/test_rewrite_duplicate.rs @@ -39,7 +39,7 @@ fn test_duplicate_linear_contents() { // C [=file1, +file2] // B [+file1] // A [] - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let commit_a = tx .repo_mut() .new_commit( @@ -90,7 +90,7 @@ fn test_duplicate_linear_contents() { }; // Duplicate empty commit onto empty ancestor tree - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let stats = duplicate_onto(&mut tx, &[commit_e.id()], &[commit_a.id()]); assert_eq!( stats.duplicated_commits[commit_e.id()].tree_id(), @@ -98,7 +98,7 @@ fn test_duplicate_linear_contents() { ); // Duplicate empty commit onto non-empty ancestor tree - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let stats = duplicate_onto(&mut tx, &[commit_e.id()], &[commit_b.id()]); assert_eq!( stats.duplicated_commits[commit_e.id()].tree_id(), @@ -106,7 +106,7 @@ fn test_duplicate_linear_contents() { ); // Duplicate non-empty commit onto empty ancestor tree - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let stats = duplicate_onto(&mut tx, &[commit_c.id()], &[commit_a.id()]); assert_eq!( stats.duplicated_commits[commit_c.id()].tree_id(), @@ -114,7 +114,7 @@ fn test_duplicate_linear_contents() { ); // Duplicate non-empty commit onto non-empty ancestor tree - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let stats = duplicate_onto(&mut tx, &[commit_d.id()], &[commit_b.id()]); assert_eq!( stats.duplicated_commits[commit_d.id()].tree_id(), @@ -122,7 +122,7 @@ fn test_duplicate_linear_contents() { ); // Duplicate non-empty commit onto non-empty descendant tree - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let stats = duplicate_onto(&mut tx, &[commit_b.id()], &[commit_d.id()]); assert_eq!( stats.duplicated_commits[commit_b.id()].tree_id(), @@ -130,7 +130,7 @@ fn test_duplicate_linear_contents() { ); // Duplicate multiple contiguous commits - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let stats = duplicate_onto(&mut tx, &[commit_e.id(), commit_d.id()], &[commit_b.id()]); assert_eq!( stats.duplicated_commits[commit_d.id()].tree_id(), @@ -142,7 +142,7 @@ fn test_duplicate_linear_contents() { ); // Duplicate multiple non-contiguous commits - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let stats = duplicate_onto(&mut tx, &[commit_e.id(), commit_c.id()], &[commit_a.id()]); assert_eq!( stats.duplicated_commits[commit_c.id()].tree_id(), @@ -154,7 +154,7 @@ fn test_duplicate_linear_contents() { ); // Duplicate onto multiple parents - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let stats = duplicate_onto(&mut tx, &[commit_d.id()], &[commit_c.id(), commit_b.id()]); assert_eq!( stats.duplicated_commits[commit_d.id()].tree_id(), @@ -162,7 +162,7 @@ fn test_duplicate_linear_contents() { ); // Insert duplicated commit - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let stats = duplicate_in_between( &mut tx, &[commit_b.id()], diff --git a/lib/tests/test_rewrite_transform.rs b/lib/tests/test_rewrite_transform.rs index f5fb7e807c..cb1074f4d1 100644 --- a/lib/tests/test_rewrite_transform.rs +++ b/lib/tests/test_rewrite_transform.rs @@ -36,7 +36,7 @@ fn test_transform_descendants_sync() { let test_repo = TestRepo::init(); let repo = &test_repo.repo; - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut graph_builder = CommitGraphBuilder::new(&settings, tx.repo_mut()); let commit_a = graph_builder.initial_commit(); let commit_b = graph_builder.commit_with_parents(&[&commit_a]); @@ -94,7 +94,7 @@ fn test_transform_descendants_sync_linearize_merge() { let test_repo = TestRepo::init(); let repo = &test_repo.repo; - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut graph_builder = CommitGraphBuilder::new(&settings, tx.repo_mut()); let commit_a = graph_builder.initial_commit(); let commit_b = graph_builder.commit_with_parents(&[&commit_a]); diff --git a/lib/tests/test_signing.rs b/lib/tests/test_signing.rs index e9a6021347..23105c0c05 100644 --- a/lib/tests/test_signing.rs +++ b/lib/tests/test_signing.rs @@ -64,7 +64,7 @@ fn manual(backend: TestRepoBackend) { let settings = settings.clone(); let repo = repo.clone(); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let commit1 = create_random_commit(tx.repo_mut(), &settings) .set_sign_behavior(SignBehavior::Own) .write() @@ -94,14 +94,14 @@ fn keep_on_rewrite(backend: TestRepoBackend) { let settings = settings.clone(); let repo = repo.clone(); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let commit = create_random_commit(tx.repo_mut(), &settings) .set_sign_behavior(SignBehavior::Own) .write() .unwrap(); tx.commit("test").unwrap(); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut_repo = tx.repo_mut(); let rewritten = mut_repo.rewrite_commit(&settings, &commit).write().unwrap(); @@ -120,14 +120,14 @@ fn manual_drop_on_rewrite(backend: TestRepoBackend) { let settings = settings.clone(); let repo = repo.clone(); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let commit = create_random_commit(tx.repo_mut(), &settings) .set_sign_behavior(SignBehavior::Own) .write() .unwrap(); tx.commit("test").unwrap(); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut_repo = tx.repo_mut(); let rewritten = mut_repo .rewrite_commit(&settings, &commit) @@ -150,7 +150,7 @@ fn forced(backend: TestRepoBackend) { let settings = settings.clone(); let repo = repo.clone(); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let commit = create_random_commit(tx.repo_mut(), &settings) .set_sign_behavior(SignBehavior::Force) .set_author(someone_else()) @@ -173,7 +173,7 @@ fn configured(backend: TestRepoBackend) { let settings = settings.clone(); let repo = repo.clone(); - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let commit = write_random_commit(tx.repo_mut(), &settings); tx.commit("test").unwrap(); diff --git a/lib/tests/test_view.rs b/lib/tests/test_view.rs index 35501a9ffa..d2211e926e 100644 --- a/lib/tests/test_view.rs +++ b/lib/tests/test_view.rs @@ -45,7 +45,7 @@ fn test_heads_fork() { let settings = testutils::user_settings(); let test_repo = TestRepo::init(); let repo = &test_repo.repo; - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut graph_builder = CommitGraphBuilder::new(&settings, tx.repo_mut()); let initial = graph_builder.initial_commit(); @@ -67,7 +67,7 @@ fn test_heads_merge() { let settings = testutils::user_settings(); let test_repo = TestRepo::init(); let repo = &test_repo.repo; - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut graph_builder = CommitGraphBuilder::new(&settings, tx.repo_mut()); let initial = graph_builder.initial_commit(); @@ -86,18 +86,18 @@ fn test_merge_views_heads() { let test_repo = TestRepo::init(); let repo = &test_repo.repo; - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut_repo = tx.repo_mut(); let head_unchanged = write_random_commit(mut_repo, &settings); let head_remove_tx1 = write_random_commit(mut_repo, &settings); let head_remove_tx2 = write_random_commit(mut_repo, &settings); let repo = tx.commit("test").unwrap(); - let mut tx1 = repo.start_transaction(&settings); + let mut tx1 = repo.start_transaction(); tx1.repo_mut().remove_head(head_remove_tx1.id()); let head_add_tx1 = write_random_commit(tx1.repo_mut(), &settings); - let mut tx2 = repo.start_transaction(&settings); + let mut tx2 = repo.start_transaction(); tx2.repo_mut().remove_head(head_remove_tx2.id()); let head_add_tx2 = write_random_commit(tx2.repo_mut(), &settings); @@ -125,7 +125,7 @@ fn test_merge_views_checkout() { // Workspace 5 gets deleted in tx2 and modified in tx1. // Workspace 6 gets added in tx1. // Workspace 7 gets added in tx2. - let mut initial_tx = repo.start_transaction(&settings); + let mut initial_tx = repo.start_transaction(); let commit1 = write_random_commit(initial_tx.repo_mut(), &settings); let commit2 = write_random_commit(initial_tx.repo_mut(), &settings); let commit3 = write_random_commit(initial_tx.repo_mut(), &settings); @@ -158,7 +158,7 @@ fn test_merge_views_checkout() { .unwrap(); let repo = initial_tx.commit("test").unwrap(); - let mut tx1 = repo.start_transaction(&settings); + let mut tx1 = repo.start_transaction(); tx1.repo_mut() .set_wc_commit(ws1_id.clone(), commit2.id().clone()) .unwrap(); @@ -173,7 +173,7 @@ fn test_merge_views_checkout() { .set_wc_commit(ws6_id.clone(), commit2.id().clone()) .unwrap(); - let mut tx2 = repo.start_transaction(&settings); + let mut tx2 = repo.start_transaction(); tx2.repo_mut() .set_wc_commit(ws1_id.clone(), commit3.id().clone()) .unwrap(); @@ -209,7 +209,7 @@ fn test_merge_views_bookmarks() { let test_repo = TestRepo::init(); let repo = &test_repo.repo; - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut_repo = tx.repo_mut(); let main_bookmark_local_tx0 = write_random_commit(mut_repo, &settings); let main_bookmark_origin_tx0 = write_random_commit(mut_repo, &settings); @@ -239,7 +239,7 @@ fn test_merge_views_bookmarks() { ); let repo = tx.commit("test").unwrap(); - let mut tx1 = repo.start_transaction(&settings); + let mut tx1 = repo.start_transaction(); let main_bookmark_local_tx1 = write_random_commit(tx1.repo_mut(), &settings); tx1.repo_mut().set_local_bookmark_target( "main", @@ -251,7 +251,7 @@ fn test_merge_views_bookmarks() { RefTarget::normal(feature_bookmark_tx1.id().clone()), ); - let mut tx2 = repo.start_transaction(&settings); + let mut tx2 = repo.start_transaction(); let main_bookmark_local_tx2 = write_random_commit(tx2.repo_mut(), &settings); let main_bookmark_origin_tx2 = write_random_commit(tx2.repo_mut(), &settings); let main_bookmark_origin_tx2_remote_ref = RemoteRef { @@ -304,7 +304,7 @@ fn test_merge_views_tags() { let test_repo = TestRepo::init(); let repo = &test_repo.repo; - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut_repo = tx.repo_mut(); let v1_tx0 = write_random_commit(mut_repo, &settings); mut_repo.set_tag_target("v1.0", RefTarget::normal(v1_tx0.id().clone())); @@ -312,7 +312,7 @@ fn test_merge_views_tags() { mut_repo.set_tag_target("v2.0", RefTarget::normal(v2_tx0.id().clone())); let repo = tx.commit("test").unwrap(); - let mut tx1 = repo.start_transaction(&settings); + let mut tx1 = repo.start_transaction(); let v1_tx1 = write_random_commit(tx1.repo_mut(), &settings); tx1.repo_mut() .set_tag_target("v1.0", RefTarget::normal(v1_tx1.id().clone())); @@ -320,7 +320,7 @@ fn test_merge_views_tags() { tx1.repo_mut() .set_tag_target("v2.0", RefTarget::normal(v2_tx1.id().clone())); - let mut tx2 = repo.start_transaction(&settings); + let mut tx2 = repo.start_transaction(); let v1_tx2 = write_random_commit(tx2.repo_mut(), &settings); tx2.repo_mut() .set_tag_target("v1.0", RefTarget::normal(v1_tx2.id().clone())); @@ -348,7 +348,7 @@ fn test_merge_views_git_refs() { let test_repo = TestRepo::init(); let repo = &test_repo.repo; - let mut tx = repo.start_transaction(&settings); + let mut tx = repo.start_transaction(); let mut_repo = tx.repo_mut(); let main_bookmark_tx0 = write_random_commit(mut_repo, &settings); mut_repo.set_git_ref_target( @@ -362,7 +362,7 @@ fn test_merge_views_git_refs() { ); let repo = tx.commit("test").unwrap(); - let mut tx1 = repo.start_transaction(&settings); + let mut tx1 = repo.start_transaction(); let main_bookmark_tx1 = write_random_commit(tx1.repo_mut(), &settings); tx1.repo_mut().set_git_ref_target( "refs/heads/main", @@ -374,7 +374,7 @@ fn test_merge_views_git_refs() { RefTarget::normal(feature_bookmark_tx1.id().clone()), ); - let mut tx2 = repo.start_transaction(&settings); + let mut tx2 = repo.start_transaction(); let main_bookmark_tx2 = write_random_commit(tx2.repo_mut(), &settings); tx2.repo_mut().set_git_ref_target( "refs/heads/main", @@ -407,18 +407,18 @@ fn test_merge_views_git_heads() { let test_repo = TestRepo::init(); let repo = &test_repo.repo; - let mut tx0 = repo.start_transaction(&settings); + let mut tx0 = repo.start_transaction(); let tx0_head = write_random_commit(tx0.repo_mut(), &settings); tx0.repo_mut() .set_git_head_target(RefTarget::normal(tx0_head.id().clone())); let repo = tx0.commit("test").unwrap(); - let mut tx1 = repo.start_transaction(&settings); + let mut tx1 = repo.start_transaction(); let tx1_head = write_random_commit(tx1.repo_mut(), &settings); tx1.repo_mut() .set_git_head_target(RefTarget::normal(tx1_head.id().clone())); - let mut tx2 = repo.start_transaction(&settings); + let mut tx2 = repo.start_transaction(); let tx2_head = write_random_commit(tx2.repo_mut(), &settings); tx2.repo_mut() .set_git_head_target(RefTarget::normal(tx2_head.id().clone())); @@ -438,11 +438,11 @@ fn test_merge_views_divergent() { let settings = testutils::user_settings(); let test_repo = TestRepo::init(); - let mut tx = test_repo.repo.start_transaction(&settings); + let mut tx = test_repo.repo.start_transaction(); let commit_a = write_random_commit(tx.repo_mut(), &settings); let repo = tx.commit("test").unwrap(); - let mut tx1 = repo.start_transaction(&settings); + let mut tx1 = repo.start_transaction(); let commit_a2 = tx1 .repo_mut() .rewrite_commit(&settings, &commit_a) @@ -451,7 +451,7 @@ fn test_merge_views_divergent() { .unwrap(); tx1.repo_mut().rebase_descendants(&settings).unwrap(); - let mut tx2 = repo.start_transaction(&settings); + let mut tx2 = repo.start_transaction(); let commit_a3 = tx2 .repo_mut() .rewrite_commit(&settings, &commit_a) @@ -477,17 +477,17 @@ fn test_merge_views_child_on_rewritten(child_first: bool) { let settings = testutils::user_settings(); let test_repo = TestRepo::init(); - let mut tx = test_repo.repo.start_transaction(&settings); + let mut tx = test_repo.repo.start_transaction(); let commit_a = write_random_commit(tx.repo_mut(), &settings); let repo = tx.commit("test").unwrap(); - let mut tx1 = repo.start_transaction(&settings); + let mut tx1 = repo.start_transaction(); let commit_b = create_random_commit(tx1.repo_mut(), &settings) .set_parents(vec![commit_a.id().clone()]) .write() .unwrap(); - let mut tx2 = repo.start_transaction(&settings); + let mut tx2 = repo.start_transaction(); let commit_a2 = tx2 .repo_mut() .rewrite_commit(&settings, &commit_a) @@ -523,7 +523,7 @@ fn test_merge_views_child_on_rewritten_divergent(on_rewritten: bool, child_first let settings = testutils::user_settings(); let test_repo = TestRepo::init(); - let mut tx = test_repo.repo.start_transaction(&settings); + let mut tx = test_repo.repo.start_transaction(); let commit_a2 = write_random_commit(tx.repo_mut(), &settings); let commit_a3 = create_random_commit(tx.repo_mut(), &settings) .set_change_id(commit_a2.change_id().clone()) @@ -531,14 +531,14 @@ fn test_merge_views_child_on_rewritten_divergent(on_rewritten: bool, child_first .unwrap(); let repo = tx.commit("test").unwrap(); - let mut tx1 = repo.start_transaction(&settings); + let mut tx1 = repo.start_transaction(); let parent = if on_rewritten { &commit_a2 } else { &commit_a3 }; let commit_b = create_random_commit(tx1.repo_mut(), &settings) .set_parents(vec![parent.id().clone()]) .write() .unwrap(); - let mut tx2 = repo.start_transaction(&settings); + let mut tx2 = repo.start_transaction(); let commit_a4 = tx2 .repo_mut() .rewrite_commit(&settings, &commit_a2) @@ -579,7 +579,7 @@ fn test_merge_views_child_on_abandoned(child_first: bool) { let settings = testutils::user_settings(); let test_repo = TestRepo::init(); - let mut tx = test_repo.repo.start_transaction(&settings); + let mut tx = test_repo.repo.start_transaction(); let commit_a = write_random_commit(tx.repo_mut(), &settings); let commit_b = create_random_commit(tx.repo_mut(), &settings) .set_parents(vec![commit_a.id().clone()]) @@ -587,13 +587,13 @@ fn test_merge_views_child_on_abandoned(child_first: bool) { .unwrap(); let repo = tx.commit("test").unwrap(); - let mut tx1 = repo.start_transaction(&settings); + let mut tx1 = repo.start_transaction(); let commit_c = create_random_commit(tx1.repo_mut(), &settings) .set_parents(vec![commit_b.id().clone()]) .write() .unwrap(); - let mut tx2 = repo.start_transaction(&settings); + let mut tx2 = repo.start_transaction(); tx2.repo_mut() .record_abandoned_commit(commit_b.id().clone()); tx2.repo_mut().rebase_descendants(&settings).unwrap();