Файли
openidea/src/features/vcs/vcsToolWindow.ts
T
LU XIANGRUIтаwildcatDownstairs 65545d3563 feat(svn): rework the Subversion tool window tabs: Incoming, Update Info and Working Copies (#8212)
Reworks the Subversion tabs of the bottom version control tool window:

- Incoming lists the revisions committed after the working copy's BASE (new svn_incoming_revisions command, svn log -v BASE+1:HEAD per working copy) in one tree grouped by date or user, with the selected revisions' files beside it, an icon toolbar (Refresh, Show Details, Update Project, Filter by, Group by, Expand/Collapse All, Copy Revision Number), a context menu and per-file diffs between N-1 and N. It is now the first tab.
- After an SVN update, a "{n} Files Updated" balloon with View opens an "Update Info: {time}" tab: Update Project > Updated from server > Updated / Created / Deleted / Restored, then Skipped, conflicts, Merged, Not in repository, Replaced, parsed from svn update's file lines, with group-by-package and by-changelist, Jump to Source, Delete and before/after-update diffs.
- Subversion Working Copies Information: vertical Refresh toolbar, copies sorted by path, decoded URLs, the format shown as its release with Change running svn upgrade --compatible-version (new svn_upgrade command), Depth Fix running svn update --set-depth infinity, External/Switched/Working copy root markers, Cleanup / Configure Branches / Merge From... links, and a detection-error balloon with Fix it. A new Show Working Copies action selects the tab.
- The console's empty state names Subversion in an SVN-only project, the stripe uses the version control icon for every VCS, and new strings are in en and zh.

Refs #7433

Co-authored-by: wildcatDownstairs <[email protected]>
2026-12-05 19:08:39 +08:00

46 рядки
1.5 KiB
TypeScript

/**
* The version control tool window (Log, Console…). Its title names the selected root's
* system, "Git" or "SVN", under the version control icon. In a project with both, it
* follows the selected root, as the actions do.
*/
import { lazyComponent } from "@/ui";
import { registerToolWindow } from "@/workbench/contributions";
import { useVcs, vcsKindOf } from "./store";
import { vcsToolWindowIcon, vcsToolWindowTitle } from "./vcsKind";
// One component for every registration: a new title must not remount the window's content.
const component = lazyComponent<{ id: string }>(() => import("./GitLog").then((m) => m.GitToolWindow), {
prefetch: true,
});
const headerContent = lazyComponent<{ id: string }>(() => import("./GitLog").then((m) => m.GitTabs));
/** Registers the tool window and keeps its title and icon on the selected root's system. */
export function registerVcsToolWindow(): () => void {
let kind = vcsKindOf();
let unregister = register(kind);
const off = useVcs.subscribe(() => {
const next = vcsKindOf();
if (next === kind) return;
kind = next;
// The same id replaces the registration in place.
unregister = register(kind);
});
return () => {
off();
unregister();
};
}
function register(kind: ReturnType<typeof vcsKindOf>) {
return registerToolWindow({
id: "git",
title: vcsToolWindowTitle(kind),
icon: vcsToolWindowIcon(kind),
anchor: "bottom",
// Last of the bottom group, below Terminal and Problems, as in IDEA's stripe.
order: 50,
component,
headerContent,
});
}