mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-26 03:29:00 +01:00
SCM - Add scm.showChangesSummary setting (#202256)
* SCM - make "All Changes" node part of the API and add setting * Cleanup configuration change listeners * More settings cleanup
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
import { Disposable, Event, EventEmitter, FileDecoration, FileDecorationProvider, SourceControlHistoryItem, SourceControlHistoryItemChange, SourceControlHistoryItemGroup, SourceControlHistoryOptions, SourceControlHistoryProvider, ThemeIcon, Uri, window, l10n, LogOutputChannel } from 'vscode';
|
||||
import { Disposable, Event, EventEmitter, FileDecoration, FileDecorationProvider, SourceControlHistoryItem, SourceControlHistoryItemChange, SourceControlHistoryItemGroup, SourceControlHistoryOptions, SourceControlHistoryProvider, ThemeIcon, Uri, window, LogOutputChannel } from 'vscode';
|
||||
import { Repository, Resource } from './repository';
|
||||
import { IDisposable, filterEvent } from './util';
|
||||
import { toGitUri } from './uri';
|
||||
@@ -84,11 +84,6 @@ export class GitHistoryProvider implements SourceControlHistoryProvider, FileDec
|
||||
const historyItems: SourceControlHistoryItem[] = [];
|
||||
const commits = await this.repository.log({ range: `${refParentId}..${refId}`, shortStats: true, sortByAuthorDate: true });
|
||||
|
||||
if (commits.length >= 2) {
|
||||
const allChanges = await this.repository.diffBetweenShortStat(refParentId, refId);
|
||||
historyItems.push({ id: refId, parentIds: [refParentId], icon: new ThemeIcon('files'), label: l10n.t('All Changes'), statistics: allChanges });
|
||||
}
|
||||
|
||||
await ensureEmojis();
|
||||
|
||||
historyItems.push(...commits.map(commit => {
|
||||
@@ -109,6 +104,16 @@ export class GitHistoryProvider implements SourceControlHistoryProvider, FileDec
|
||||
return historyItems;
|
||||
}
|
||||
|
||||
async provideHistoryItemSummary(historyItemId: string, historyItemParentId: string | undefined): Promise<SourceControlHistoryItem> {
|
||||
if (!historyItemParentId) {
|
||||
const commit = await this.repository.getCommit(historyItemId);
|
||||
historyItemParentId = commit.parents.length > 0 ? commit.parents[0] : `${historyItemId}^`;
|
||||
}
|
||||
|
||||
const allChanges = await this.repository.diffBetweenShortStat(historyItemParentId, historyItemId);
|
||||
return { id: historyItemId, parentIds: [historyItemParentId], label: '', statistics: allChanges };
|
||||
}
|
||||
|
||||
async provideHistoryItemChanges(historyItemId: string, historyItemParentId: string | undefined): Promise<SourceControlHistoryItemChange[]> {
|
||||
if (!historyItemParentId) {
|
||||
const commit = await this.repository.getCommit(historyItemId);
|
||||
|
||||
Reference in New Issue
Block a user