feat(vcs): compare folder selections with revisions across repositories (#602)

Compare with Branch or Revision only handled one file, so reviewing a folder meant opening each file. Folders, the project root and multiple selections now open a changes tree against the chosen revision, with per-file diffs on demand. A single file keeps its direct diff.

Each path resolves against its own repository through the root registry. In a multi-repo workspace the picker offers shared revisions such as "main in 3 repositories" as well as per-repository ones, results are grouped by repository, and content outside any repository or a repository missing the revision is stated in the result. Listing is cancellable and off the UI thread, includes worktree and untracked changes, and a rename leaving the selection shows as a delete. Show Diff on folders reuses the same tree.

Verified on macOS, and against a remote host over the server protocol. A remote window, Windows and Linux were not run.

Fixes #567
Цей коміт міститься в:
l0ng-ai authored and GitHub committed 2026-11-01 01:43:15 +08:00
1 джерело 0a71f6be88
коміт 9e35cfc064
20 files changed
+1404 -121

No files matched your search

+2
Переглянути файл
@@ -271,6 +271,8 @@ pub fn builder() -> tauri_specta::Builder<tauri::Wry> {
vcs::vcs_add_worktree,
vcs::vcs_remove_worktree,
vcs::vcs_diff_with_worktree,
vcs::vcs_compare_scope,
vcs::vcs_compare_paths,
vcs::vcs_diff_revisions,
vcs::vcs_merge_base,
vcs::vcs_create_patch,
+23
Переглянути файл
@@ -680,3 +680,26 @@ pub async fn vcs_shelf_import(
) -> IdeResult<()> {
ide_host::ops::vcs::vcs_shelf_import(&state.host, window.label(), name, patch).await
}
#[tauri::command]
#[specta::specta]
pub async fn vcs_compare_scope(
window: Window,
state: State<'_, AppState>,
paths: Vec<PathBuf>,
) -> IdeResult<ide_vcs::CompareScope> {
ide_host::ops::vcs::vcs_compare_scope(&state.host, window.label(), paths).await
}
#[tauri::command]
#[specta::specta]
pub async fn vcs_compare_paths(
window: Window,
state: State<'_, AppState>,
paths: Vec<PathBuf>,
revision: String,
repositories: Option<Vec<PathBuf>>,
request: RequestId,
) -> IdeResult<ide_vcs::CompareResult> {
ide_host::ops::vcs::vcs_compare_paths(&state.host, window.label(), paths, revision, repositories, request).await
}