diff --git a/CHANGELOG.md b/CHANGELOG.md index cb5543c..aa8bcf3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,9 @@ ## [0.23.0](releases/tag/v0.23.0) This version is based on Jujutsu 0.23 and the recently-released Tauri 2.0. +### Changed +- Branches have been renamed to bookmarks. The setting `gg.ui.mark-unpushed-branches` has changed to `mark-unpushed-bookmarks`, but the old one will still work as well. + ## [0.20.0](releases/tag/v0.20.0) This version is based on Jujutsu 0.20. diff --git a/README.md b/README.md index acb83b3..70c7e1d 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ GG doesn't require [JJ](https://martinvonz.github.io/jj/latest/install-and-setup - Use the right pane to inspect and edit revisions - set descriptions, issue commands, view their parents and changes. - Drag revisions around to rebase them; move them into or out of a revision's parents to add merges and move entire subtrees. Or just abandon them entirely. - Drag files around to squash them into new revisions or throw away changes (restoring from parents). -- Drag branches around to set or delete them. +- Drag bookmarks around to set or delete them. - Right click on any of the above for more actions. - Push and fetch git changes using the bottom bar. - Undo anything with ⟲ in the bottom right corner. diff --git a/src-tauri/src/config/gg.toml b/src-tauri/src/config/gg.toml index 233d86e..ce79df4 100644 --- a/src-tauri/src/config/gg.toml +++ b/src-tauri/src/config/gg.toml @@ -13,8 +13,8 @@ large-repo-heuristic = 100000 # Stores a list of recently opened directories for shell integration recent-workspaces = [] -# When set, branches that are local-only or remote-only will be visually indicated. -mark-unpushed-branches = true +# When set, bookmarks that are local-only or remote-only will be visually indicated. +mark-unpushed-bookmarks = true # "light" or "dark". If not set, your OS settings will be used. # theme-override = diff --git a/src-tauri/src/config/mod.rs b/src-tauri/src/config/mod.rs index 612c3eb..151aeb3 100644 --- a/src-tauri/src/config/mod.rs +++ b/src-tauri/src/config/mod.rs @@ -14,7 +14,7 @@ pub trait GGSettings { fn query_large_repo_heuristic(&self) -> i64; fn query_auto_snapshot(&self) -> Option; fn ui_theme_override(&self) -> Option; - fn ui_mark_unpushed_branches(&self) -> bool; + fn ui_mark_unpushed_bookmarks(&self) -> bool; #[allow(dead_code)] fn ui_recent_workspaces(&self) -> Vec; } @@ -40,10 +40,14 @@ impl GGSettings for UserSettings { self.config().get_string("gg.ui.theme-override").ok() } - fn ui_mark_unpushed_branches(&self) -> bool { + fn ui_mark_unpushed_bookmarks(&self) -> bool { self.config() - .get_bool("gg.ui.mark-unpushed-branches") - .unwrap_or(true) + .get_bool("gg.ui.mark-unpushed-bookmarks") + .unwrap_or( + self.config() + .get_bool("gg.ui.mark-unpushed-branches") + .unwrap_or(true), + ) } fn ui_recent_workspaces(&self) -> Vec { diff --git a/src-tauri/src/menu.rs b/src-tauri/src/menu.rs index c8c19ca..928ace6 100644 --- a/src-tauri/src/menu.rs +++ b/src-tauri/src/menu.rs @@ -104,7 +104,7 @@ pub fn build_main(app_handle: &AppHandle) -> tauri::Result> { &MenuItem::with_id( app_handle, "menu_revision_branch", - "Create branch", + "Create bookmark", true, None::<&str>, )?, @@ -208,7 +208,7 @@ pub fn build_context( &MenuItem::with_id( app_handle, "revision_branch", - "Create branch", + "Create bookmark", true, None::<&str>, )?, @@ -368,7 +368,7 @@ pub fn handle_context(window: Window, ctx: Operand) -> Result<()> { "branch_track", matches!( r#ref, - StoreRef::RemoteBranch { + StoreRef::RemoteBookmark { is_tracked: false, .. } @@ -380,13 +380,13 @@ pub fn handle_context(window: Window, ctx: Operand) -> Result<()> { "branch_untrack", matches!( r#ref, - StoreRef::LocalBranch { + StoreRef::LocalBookmark { ref tracking_remotes, .. } if !tracking_remotes.is_empty() ) || matches!( r#ref, - StoreRef::RemoteBranch { + StoreRef::RemoteBookmark { is_synced: false, // we can *see* the remote ref, and is_tracked: true, // it has a local, and is_absent: false, // that local is somewhere else @@ -397,26 +397,26 @@ pub fn handle_context(window: Window, ctx: Operand) -> Result<()> { // push a local to its remotes, or finish a CLI delete context_menu.enable("branch_push_all", - matches!(r#ref, StoreRef::LocalBranch { ref tracking_remotes, .. } if !tracking_remotes.is_empty()) || - matches!(r#ref, StoreRef::RemoteBranch { is_tracked: true, is_absent: true, .. }))?; + matches!(r#ref, StoreRef::LocalBookmark { ref tracking_remotes, .. } if !tracking_remotes.is_empty()) || + matches!(r#ref, StoreRef::RemoteBookmark { is_tracked: true, is_absent: true, .. }))?; // push a local to a selected remote, tracking first if necessary context_menu.enable("branch_push_single", - matches!(r#ref, StoreRef::LocalBranch { potential_remotes, .. } if potential_remotes > 0))?; + matches!(r#ref, StoreRef::LocalBookmark { potential_remotes, .. } if potential_remotes > 0))?; // fetch a local's remotes, or just a remote (unless we're deleting it; that would be silly) context_menu.enable("branch_fetch_all", - matches!(r#ref, StoreRef::LocalBranch { ref tracking_remotes, .. } if !tracking_remotes.is_empty()) || - matches!(r#ref, StoreRef::RemoteBranch { is_tracked, is_absent, .. } if (!is_tracked || !is_absent)))?; + matches!(r#ref, StoreRef::LocalBookmark { ref tracking_remotes, .. } if !tracking_remotes.is_empty()) || + matches!(r#ref, StoreRef::RemoteBookmark { is_tracked, is_absent, .. } if (!is_tracked || !is_absent)))?; // fetch a local, tracking first if necessary context_menu.enable("branch_fetch_single", - matches!(r#ref, StoreRef::LocalBranch { available_remotes, .. } if available_remotes > 0))?; + matches!(r#ref, StoreRef::LocalBookmark { available_remotes, .. } if available_remotes > 0))?; // rename a local, which also untracks remotes context_menu.enable( "branch_rename", - matches!(r#ref, StoreRef::LocalBranch { .. }), + matches!(r#ref, StoreRef::LocalBookmark { .. }), )?; // remove a local, or make a remote absent @@ -424,7 +424,7 @@ pub fn handle_context(window: Window, ctx: Operand) -> Result<()> { "branch_delete", !matches!( r#ref, - StoreRef::RemoteBranch { + StoreRef::RemoteBookmark { is_absent: true, is_tracked: true, .. diff --git a/src-tauri/src/messages/mod.rs b/src-tauri/src/messages/mod.rs index b386bc9..379d8d3 100644 --- a/src-tauri/src/messages/mod.rs +++ b/src-tauri/src/messages/mod.rs @@ -108,7 +108,7 @@ pub struct RepoStatus { pub working_copy: CommitId, } -/// Branch or tag name with metadata. +/// Bookmark or tag name with metadata. #[derive(Serialize, Deserialize, Clone, Debug)] #[serde(tag = "type")] #[cfg_attr( @@ -117,7 +117,7 @@ pub struct RepoStatus { ts(export, export_to = "../src/messages/") )] pub enum StoreRef { - LocalBranch { + LocalBookmark { branch_name: String, has_conflict: bool, /// Synchronized with all tracking remotes @@ -127,7 +127,7 @@ pub enum StoreRef { available_remotes: usize, potential_remotes: usize, }, - RemoteBranch { + RemoteBookmark { branch_name: String, remote_name: String, has_conflict: bool, @@ -146,9 +146,9 @@ pub enum StoreRef { impl StoreRef { pub fn as_branch(&self) -> Result<&str> { match self { - StoreRef::LocalBranch { branch_name, .. } => Ok(&branch_name), - StoreRef::RemoteBranch { branch_name, .. } => Ok(&branch_name), - _ => Err(anyhow!("not a local branch")), + StoreRef::LocalBookmark { branch_name, .. } => Ok(&branch_name), + StoreRef::RemoteBookmark { branch_name, .. } => Ok(&branch_name), + _ => Err(anyhow!("not a local bookmark")), } } } diff --git a/src-tauri/src/messages/mutations.rs b/src-tauri/src/messages/mutations.rs index 0717766..bdb4106 100644 --- a/src-tauri/src/messages/mutations.rs +++ b/src-tauri/src/messages/mutations.rs @@ -213,7 +213,6 @@ pub struct MoveRef { pub to_id: RevId, } -/// XXX pushes all branches of a remote, all remotes of a branch, or one remotes of a branch - split up? #[derive(Deserialize, Debug)] #[serde(tag = "type")] #[cfg_attr( @@ -222,13 +221,13 @@ pub struct MoveRef { ts(export, export_to = "../src/messages/") )] pub enum GitPush { - AllBranches { + AllBookmarks { remote_name: String, }, AllRemotes { branch_ref: StoreRef, }, - RemoteBranch { + RemoteBookmark { remote_name: String, branch_ref: StoreRef, }, @@ -242,13 +241,13 @@ pub enum GitPush { ts(export, export_to = "../src/messages/") )] pub enum GitFetch { - AllBranches { + AllBookmarks { remote_name: String, }, AllRemotes { branch_ref: StoreRef, }, - RemoteBranch { + RemoteBookmark { remote_name: String, branch_ref: StoreRef, }, diff --git a/src-tauri/src/worker/gui_util.rs b/src-tauri/src/worker/gui_util.rs index 4a48977..db03c4e 100644 --- a/src-tauri/src/worker/gui_util.rs +++ b/src-tauri/src/worker/gui_util.rs @@ -447,7 +447,7 @@ impl WorkspaceSession<'_> { latest_query, status: self.format_status(), theme_override: self.data.settings.ui_theme_override(), - mark_unpushed_branches: self.data.settings.ui_mark_unpushed_branches(), + mark_unpushed_branches: self.data.settings.ui_mark_unpushed_bookmarks(), }) } @@ -1027,7 +1027,7 @@ fn build_ref_index(repo: &ReadonlyRepo) -> RefIndex { if local_target.is_present() { index.insert( local_target.added_ids(), - messages::StoreRef::LocalBranch { + messages::StoreRef::LocalBookmark { branch_name: branch_name.to_owned(), has_conflict: local_target.has_conflict(), is_synced: remote_refs.iter().all(|&(_, remote_ref)| { @@ -1046,7 +1046,7 @@ fn build_ref_index(repo: &ReadonlyRepo) -> RefIndex { for &(remote_name, remote_ref) in &remote_refs { index.insert( remote_ref.target.added_ids(), - messages::StoreRef::RemoteBranch { + messages::StoreRef::RemoteBookmark { branch_name: branch_name.to_owned(), remote_name: remote_name.to_owned(), has_conflict: remote_ref.target.has_conflict(), diff --git a/src-tauri/src/worker/mutations.rs b/src-tauri/src/worker/mutations.rs index ab86252..353f482 100644 --- a/src-tauri/src/worker/mutations.rs +++ b/src-tauri/src/worker/mutations.rs @@ -459,10 +459,10 @@ impl Mutation for TrackBranch { StoreRef::Tag { tag_name } => { precondition!("{} is a tag and cannot be tracked", tag_name); } - StoreRef::LocalBranch { branch_name, .. } => { - precondition!("{} is a local branch and cannot be tracked", branch_name); + StoreRef::LocalBookmark { branch_name, .. } => { + precondition!("{} is a local bookmark and cannot be tracked", branch_name); } - StoreRef::RemoteBranch { + StoreRef::RemoteBookmark { branch_name, remote_name, .. @@ -479,7 +479,7 @@ impl Mutation for TrackBranch { tx.repo_mut() .track_remote_bookmark(&branch_name, &remote_name); - match ws.finish_transaction(tx, format!("track remote branch {}", branch_name))? { + match ws.finish_transaction(tx, format!("track remote bookmark {}", branch_name))? { Some(new_status) => Ok(MutationResult::Updated { new_status }), None => Ok(MutationResult::Unchanged), } @@ -497,7 +497,7 @@ impl Mutation for UntrackBranch { StoreRef::Tag { tag_name } => { precondition!("{} is a tag and cannot be untracked", tag_name); } - StoreRef::LocalBranch { branch_name, .. } => { + StoreRef::LocalBookmark { branch_name, .. } => { // untrack all remotes for ((name, remote), remote_ref) in ws.view().remote_bookmarks_matching( &StringPattern::exact(branch_name), @@ -509,7 +509,7 @@ impl Mutation for UntrackBranch { } } } - StoreRef::RemoteBranch { + StoreRef::RemoteBookmark { branch_name, remote_name, .. @@ -529,7 +529,7 @@ impl Mutation for UntrackBranch { match ws.finish_transaction( tx, - format!("untrack remote {}", combine_branches(&untracked)), + format!("untrack remote {}", combine_bookmarks(&untracked)), )? { Some(new_status) => Ok(MutationResult::Updated { new_status }), None => Ok(MutationResult::Unchanged), @@ -543,11 +543,11 @@ impl Mutation for RenameBranch { let ref_target = ws.view().get_local_bookmark(old_name).clone(); if ref_target.is_absent() { - precondition!("No such branch: {}", old_name); + precondition!("No such bookmark: {}", old_name); } if ws.view().get_local_bookmark(&self.new_name).is_present() { - precondition!("Branch already exists: {}", &self.new_name); + precondition!("Bookmark already exists: {}", &self.new_name); } let mut tx = ws.start_transaction()?; @@ -571,18 +571,18 @@ impl Mutation for CreateRef { let commit = ws.resolve_single_change(&self.id)?; match self.r#ref { - StoreRef::RemoteBranch { + StoreRef::RemoteBookmark { branch_name, remote_name, .. } => { precondition!( - "{}@{} is a remote branch and cannot be created", + "{}@{} is a remote bookmark and cannot be created", branch_name, remote_name ); } - StoreRef::LocalBranch { branch_name, .. } => { + StoreRef::LocalBookmark { branch_name, .. } => { let existing_branch = ws.view().get_local_bookmark(&branch_name); if existing_branch.is_present() { precondition!("{} already exists", branch_name); @@ -633,14 +633,14 @@ impl Mutation for CreateRef { impl Mutation for DeleteRef { fn execute(self: Box, ws: &mut WorkspaceSession) -> Result { match self.r#ref { - StoreRef::RemoteBranch { + StoreRef::RemoteBookmark { branch_name, remote_name, .. } => { let mut tx = ws.start_transaction()?; - // forget the branch entirely - when target is absent, it's removed from the view + // forget the bookmark entirely - when target is absent, it's removed from the view let remote_ref = RemoteRef { target: RefTarget::absent(), state: RemoteRefState::New, @@ -656,7 +656,7 @@ impl Mutation for DeleteRef { None => Ok(MutationResult::Unchanged), } } - StoreRef::LocalBranch { branch_name, .. } => { + StoreRef::LocalBookmark { branch_name, .. } => { let mut tx = ws.start_transaction()?; tx.repo_mut() @@ -689,17 +689,17 @@ impl Mutation for MoveRef { let commit = ws.resolve_single_change(&self.to_id)?; match self.r#ref { - StoreRef::RemoteBranch { + StoreRef::RemoteBookmark { branch_name, remote_name, .. } => { - precondition!("Branch is remote: {branch_name}@{remote_name}") + precondition!("Bookmark is remote: {branch_name}@{remote_name}") } - StoreRef::LocalBranch { branch_name, .. } => { + StoreRef::LocalBookmark { branch_name, .. } => { let old_target = ws.view().get_local_bookmark(&branch_name); if old_target.is_absent() { - precondition!("No such branch: {branch_name}"); + precondition!("No such bookmark: {branch_name}"); } tx.repo_mut().set_local_bookmark_target( @@ -745,11 +745,11 @@ impl Mutation for GitPush { None => precondition!("No git backend"), }; - // determine branches to push, recording the old and new commits + // determine bookmarks to push, recording the old and new commits let mut remote_branch_updates: Vec<(&str, Vec<(String, refs::BookmarkPushUpdate)>)> = Vec::new(); let remote_branch_refs: Vec<_> = match &*self { - GitPush::AllBranches { ref remote_name } => { + GitPush::AllBookmarks { ref remote_name } => { let mut branch_updates = Vec::new(); for (branch_name, targets) in ws.view().local_remote_bookmarks(&remote_name) { if !targets.remote_ref.is_tracking() { @@ -805,7 +805,7 @@ impl Mutation for GitPush { remote_branch_refs } - GitPush::RemoteBranch { + GitPush::RemoteBookmark { ref remote_name, ref branch_ref, } => { @@ -905,7 +905,7 @@ impl Mutation for GitPush { match ws.finish_transaction( tx, match *self { - GitPush::AllBranches { remote_name } => { + GitPush::AllBookmarks { remote_name } => { format!("push all tracked branches to git remote {}", remote_name) } GitPush::AllRemotes { branch_ref } => { @@ -914,7 +914,7 @@ impl Mutation for GitPush { branch_ref.as_branch()? ) } - GitPush::RemoteBranch { + GitPush::RemoteBookmark { remote_name, branch_ref, } => { @@ -943,7 +943,7 @@ impl Mutation for GitFetch { let mut remote_patterns = Vec::new(); match *self { - GitFetch::AllBranches { remote_name } => { + GitFetch::AllBookmarks { remote_name } => { remote_patterns.push((remote_name, None)); } GitFetch::AllRemotes { branch_ref } => { @@ -956,7 +956,7 @@ impl Mutation for GitFetch { remote_patterns.push((remote_name, Some(branch_name.to_owned()))); } } - GitFetch::RemoteBranch { + GitFetch::RemoteBookmark { remote_name, branch_ref, } => { @@ -1040,10 +1040,10 @@ fn combine_messages(source: &Commit, destination: &Commit, abandon_source: bool) } } -fn combine_branches(branch_names: &[impl Display]) -> String { +fn combine_bookmarks(branch_names: &[impl Display]) -> String { match branch_names { - [branch_name] => format!("branch {}", branch_name), - branch_names => format!("branches {}", branch_names.iter().join(", ")), + [branch_name] => format!("bookmark {}", branch_name), + branch_names => format!("bookmarks {}", branch_names.iter().join(", ")), } } @@ -1069,14 +1069,14 @@ fn classify_branch_push( BookmarkPushAction::AlreadyMatches => Ok(None), BookmarkPushAction::Update(update) => Ok(Some(update)), BookmarkPushAction::LocalConflicted => { - Err(format!("Branch {} is conflicted.", branch_name)) + Err(format!("Bookmark {} is conflicted.", branch_name)) } BookmarkPushAction::RemoteConflicted => Err(format!( - "Branch {}@{} is conflicted. Try fetching first.", + "Bookmark {}@{} is conflicted. Try fetching first.", branch_name, remote_name )), BookmarkPushAction::RemoteUntracked => Err(format!( - "Non-tracking remote branch {}@{} exists. Try tracking it first.", + "Non-tracking remote bookmark {}@{} exists. Try tracking it first.", branch_name, remote_name )), } diff --git a/src-tauri/src/worker/tests/mod.rs b/src-tauri/src/worker/tests/mod.rs index b6ee05b..a9721ff 100644 --- a/src-tauri/src/worker/tests/mod.rs +++ b/src-tauri/src/worker/tests/mod.rs @@ -51,11 +51,11 @@ mod revs { mkid("nnloouly", "56018b94eb61a9acddc58ad7974aa51c3368eadd") } - pub fn main_branch() -> RevId { + pub fn main_bookmark() -> RevId { mkid("mnkoropy", "87e9c6c03e1b727ff712d962c03b32fffb704bc0") } - pub fn conflict_branch() -> RevId { + pub fn conflict_bookmark() -> RevId { mkid("nwrnuwyp", "880abeefdd3ac344e2a0901c5f486d02d34053da") } diff --git a/src-tauri/src/worker/tests/mutations.rs b/src-tauri/src/worker/tests/mutations.rs index d08777a..ee171f4 100644 --- a/src-tauri/src/worker/tests/mutations.rs +++ b/src-tauri/src/worker/tests/mutations.rs @@ -40,18 +40,18 @@ fn checkout_revision() -> Result<()> { let mut ws = session.load_directory(repo.path())?; let head_rev = queries::query_revision(&ws, revs::working_copy())?; - let conflict_rev = queries::query_revision(&ws, revs::conflict_branch())?; + let conflict_rev = queries::query_revision(&ws, revs::conflict_bookmark())?; assert_matches!(head_rev, RevResult::Detail { header, .. } if header.is_working_copy); assert_matches!(conflict_rev, RevResult::Detail { header, .. } if !header.is_working_copy); let result = CheckoutRevision { - id: revs::conflict_branch(), + id: revs::conflict_bookmark(), } .execute_unboxed(&mut ws)?; assert_matches!(result, MutationResult::UpdatedSelection { .. }); let head_rev = queries::query_revision(&ws, revs::working_copy())?; - let conflict_rev = queries::query_revision(&ws, revs::conflict_branch())?; + let conflict_rev = queries::query_revision(&ws, revs::conflict_bookmark())?; assert_matches!(head_rev, RevResult::NotFound { .. }); assert_matches!(conflict_rev, RevResult::Detail { header, .. } if header.is_working_copy); @@ -132,7 +132,7 @@ fn create_revision_multi_parent() -> Result<()> { assert_matches!(parent_rev, RevResult::Detail { header, .. } if header.is_working_copy); let result = CreateRevision { - parent_ids: vec![revs::working_copy(), revs::conflict_branch()], + parent_ids: vec![revs::working_copy(), revs::conflict_bookmark()], } .execute_unboxed(&mut ws)?; @@ -213,7 +213,7 @@ fn duplicate_revisions() -> Result<()> { assert_matches!(rev, RevResult::Detail { header, .. } if header.description.lines[0] == ""); let result = DuplicateRevisions { - ids: vec![revs::main_branch()], + ids: vec![revs::main_bookmark()], } .execute_unboxed(&mut ws)?; assert_matches!(result, MutationResult::UpdatedSelection { .. }); @@ -235,7 +235,7 @@ fn insert_revision() -> Result<()> { assert_eq!(2, page.rows.len()); InsertRevision { - after_id: revs::main_branch(), + after_id: revs::main_bookmark(), before_id: revs::working_copy(), id: revs::resolve_conflict(), } @@ -254,18 +254,18 @@ fn move_changes_all_paths() -> Result<()> { let mut session = WorkerSession::default(); let mut ws = session.load_directory(repo.path())?; - let parent_rev = queries::query_revision(&ws, revs::conflict_branch())?; + let parent_rev = queries::query_revision(&ws, revs::conflict_bookmark())?; assert_matches!(parent_rev, RevResult::Detail { header, .. } if header.has_conflict); let result = MoveChanges { from_id: revs::resolve_conflict(), - to_id: revs::conflict_branch().commit, + to_id: revs::conflict_bookmark().commit, paths: vec![], } .execute_unboxed(&mut ws)?; assert_matches!(result, MutationResult::Updated { .. }); - let parent_rev = queries::query_revision(&ws, revs::conflict_branch())?; + let parent_rev = queries::query_revision(&ws, revs::conflict_bookmark())?; assert_matches!(parent_rev, RevResult::Detail { header, .. } if !header.has_conflict); Ok(()) @@ -278,13 +278,13 @@ fn move_changes_single_path() -> Result<()> { let mut session = WorkerSession::default(); let mut ws = session.load_directory(repo.path())?; - let from_rev = queries::query_revision(&ws, revs::main_branch())?; + let from_rev = queries::query_revision(&ws, revs::main_bookmark())?; let to_rev = queries::query_revision(&ws, revs::working_copy())?; assert_matches!(from_rev, RevResult::Detail { changes, .. } if changes.len() == 2); assert_matches!(to_rev, RevResult::Detail { changes, .. } if changes.len() == 0); let result = MoveChanges { - from_id: revs::main_branch(), + from_id: revs::main_bookmark(), to_id: revs::working_copy().commit, paths: vec![TreePath { repo_path: "c.txt".to_owned(), @@ -294,7 +294,7 @@ fn move_changes_single_path() -> Result<()> { .execute_unboxed(&mut ws)?; assert_matches!(result, MutationResult::Updated { .. }); - let from_rev = queries::query_revision(&ws, revs::main_branch())?; + let from_rev = queries::query_revision(&ws, revs::main_bookmark())?; let to_rev = queries::query_revision(&ws, revs::working_copy())?; assert_matches!(from_rev, RevResult::Detail { changes, .. } if changes.len() == 1); assert_matches!(to_rev, RevResult::Detail { changes, .. } if changes.len() == 1); diff --git a/src-tauri/src/worker/tests/queries.rs b/src-tauri/src/worker/tests/queries.rs index 9f4e630..ffc3c4c 100644 --- a/src-tauri/src/worker/tests/queries.rs +++ b/src-tauri/src/worker/tests/queries.rs @@ -41,7 +41,7 @@ fn log_subset() -> Result<()> { let mut session = WorkerSession::default(); let ws = session.load_directory(repo.path())?; - let several_rows = queries::query_log(&ws, "branches()", 100)?; + let several_rows = queries::query_log(&ws, "bookmarks()", 100)?; assert_eq!(3, several_rows.rows.len()); @@ -89,14 +89,14 @@ fn revision() -> Result<()> { let mut session = WorkerSession::default(); let ws = session.load_directory(repo.path())?; - let rev = queries::query_revision(&ws, revs::main_branch())?; + let rev = queries::query_revision(&ws, revs::main_bookmark())?; assert_matches!( rev, RevResult::Detail { header: RevHeader { refs, .. }, .. - } if matches!(refs.as_slice(), [StoreRef::LocalBranch { branch_name, .. }] if branch_name == "main") + } if matches!(refs.as_slice(), [StoreRef::LocalBookmark { branch_name, .. }] if branch_name == "main") ); Ok(()) @@ -119,7 +119,7 @@ fn remotes_all() -> Result<()> { } #[test] -fn remotes_tracking_branch() -> Result<()> { +fn remotes_tracking_bookmark() -> Result<()> { let repo = mkrepo(); let mut session = WorkerSession::default(); diff --git a/src/LogPane.svelte b/src/LogPane.svelte index 8d50ba1..91a663b 100644 --- a/src/LogPane.svelte +++ b/src/LogPane.svelte @@ -16,10 +16,10 @@ const presets = [ { label: "Default", value: default_query }, - { label: "Tracked Branches", value: "@ | ancestors(branches(), 5)" }, + { label: "Tracked Bookmarks", value: "@ | ancestors(bookmarks(), 5)" }, { - label: "Remote Branches", - value: "@ | ancestors(remote_branches(), 5)", + label: "Remote Bookmarks", + value: "@ | ancestors(remote_bookmarks(), 5)", }, { label: "All Revisions", value: "all()" }, ]; diff --git a/src/controls/BranchSpan.svelte b/src/controls/BranchSpan.svelte index c85a79e..604093d 100644 --- a/src/controls/BranchSpan.svelte +++ b/src/controls/BranchSpan.svelte @@ -1,11 +1,11 @@ - {ref.branch_name}{#if ref.type == "RemoteBranch"}@{ref.remote_name}{/if} + {ref.branch_name}{#if ref.type == "RemoteBookmark"}@{ref.remote_name}{/if}