@codingame/monaco-vscode-scm-service-override 22.1.8 → 23.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +13 -15
- package/vscode/src/vs/workbench/contrib/scm/browser/activity.js +31 -45
- package/vscode/src/vs/workbench/contrib/scm/browser/media/dirtydiffDecorator.css +6 -6
- package/vscode/src/vs/workbench/contrib/scm/browser/media/scm.css +103 -18
- package/vscode/src/vs/workbench/contrib/scm/browser/menus.d.ts +7 -4
- package/vscode/src/vs/workbench/contrib/scm/browser/menus.js +39 -12
- package/vscode/src/vs/workbench/contrib/scm/browser/quickDiffDecorator.js +10 -10
- package/vscode/src/vs/workbench/contrib/scm/browser/quickDiffModel.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/scm/browser/quickDiffModel.js +5 -5
- package/vscode/src/vs/workbench/contrib/scm/browser/quickDiffWidget.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/scm/browser/quickDiffWidget.js +14 -14
- package/vscode/src/vs/workbench/contrib/scm/browser/scm.contribution.js +126 -89
- package/vscode/src/vs/workbench/contrib/scm/browser/scmAccessibilityHelp.js +24 -24
- package/vscode/src/vs/workbench/contrib/scm/browser/scmHistoryViewPane.d.ts +7 -2
- package/vscode/src/vs/workbench/contrib/scm/browser/scmHistoryViewPane.js +180 -115
- package/vscode/src/vs/workbench/contrib/scm/browser/scmRepositoriesViewPane.d.ts +5 -0
- package/vscode/src/vs/workbench/contrib/scm/browser/scmRepositoriesViewPane.js +457 -79
- package/vscode/src/vs/workbench/contrib/scm/browser/scmRepositoryRenderer.d.ts +8 -2
- package/vscode/src/vs/workbench/contrib/scm/browser/scmRepositoryRenderer.js +66 -20
- package/vscode/src/vs/workbench/contrib/scm/browser/scmViewPane.d.ts +3 -2
- package/vscode/src/vs/workbench/contrib/scm/browser/scmViewPane.js +93 -74
- package/vscode/src/vs/workbench/contrib/scm/browser/scmViewPaneContainer.js +1 -1
- package/vscode/src/vs/workbench/contrib/scm/browser/scmViewService.d.ts +15 -5
- package/vscode/src/vs/workbench/contrib/scm/browser/scmViewService.js +88 -32
- package/vscode/src/vs/workbench/contrib/scm/browser/workingSet.js +5 -5
- package/vscode/src/vs/workbench/contrib/scm/common/scmService.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/scm/common/scmService.js +1 -1
|
@@ -34,9 +34,10 @@ import { IThemeService } from '@codingame/monaco-vscode-api/vscode/vs/platform/t
|
|
|
34
34
|
import { ViewAction, ViewPane, ViewPaneShowActions } from '@codingame/monaco-vscode-501b06ab-3f58-516b-8a1a-c29d375d3da4-common/vscode/vs/workbench/browser/parts/views/viewPane';
|
|
35
35
|
import { ViewContainerLocation } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/views';
|
|
36
36
|
import { IViewDescriptorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/views.service';
|
|
37
|
-
import { renderSCMHistoryItemGraph, historyItemHoverDefaultLabelBackground, historyItemHoverLabelForeground, SWIMLANE_WIDTH, renderSCMHistoryGraphPlaceholder, getHistoryItemIndex, toISCMHistoryItemViewModelArray } from '@codingame/monaco-vscode-
|
|
38
|
-
import { getHistoryItemEditorTitle, isSCMHistoryItemViewModelTreeElement, isSCMHistoryItemChangeViewModelTreeElement, isSCMHistoryItemChangeNode, isSCMHistoryItemLoadMoreTreeElement,
|
|
39
|
-
import {
|
|
37
|
+
import { renderSCMHistoryItemGraph, historyItemHoverDefaultLabelBackground, historyItemHoverLabelForeground, SWIMLANE_WIDTH, renderSCMHistoryGraphPlaceholder, getHistoryItemIndex, toISCMHistoryItemViewModelArray } from '@codingame/monaco-vscode-be8ddbb5-094a-5657-b1cc-fe106c94c632-common/vscode/vs/workbench/contrib/scm/browser/scmHistory';
|
|
38
|
+
import { getHistoryItemEditorTitle, isSCMHistoryItemViewModelTreeElement, isSCMHistoryItemChangeViewModelTreeElement, isSCMHistoryItemChangeNode, isSCMHistoryItemLoadMoreTreeElement, isSCMRepository, getProviderKey } from '@codingame/monaco-vscode-bc6f260d-ec63-5c95-9446-1ca7d0872719-common/vscode/vs/workbench/contrib/scm/browser/util';
|
|
39
|
+
import { SCMIncomingHistoryItemId, SCMOutgoingHistoryItemId } from '@codingame/monaco-vscode-be8ddbb5-094a-5657-b1cc-fe106c94c632-common/vscode/vs/workbench/contrib/scm/common/history';
|
|
40
|
+
import { HISTORY_VIEW_PANE_ID, ViewMode } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/scm/common/scm';
|
|
40
41
|
import { ISCMService, ISCMViewService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/scm/common/scm.service';
|
|
41
42
|
import { stripIcons } from '@codingame/monaco-vscode-api/vscode/vs/base/common/iconLabels';
|
|
42
43
|
import { Position } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/layout/browser/layoutService';
|
|
@@ -58,25 +59,24 @@ import { Iterable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/ite
|
|
|
58
59
|
import { clamp } from '@codingame/monaco-vscode-api/vscode/vs/base/common/numbers';
|
|
59
60
|
import { observableConfigValue } from '@codingame/monaco-vscode-api/vscode/vs/platform/observable/common/platformObservableUtils';
|
|
60
61
|
import { compare } from '@codingame/monaco-vscode-api/vscode/vs/base/common/strings';
|
|
61
|
-
import { IClipboardService } from '@codingame/monaco-vscode-api/vscode/vs/platform/clipboard/common/clipboardService.service';
|
|
62
62
|
import { getDefaultHoverDelegate } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/hover/hoverDelegateFactory';
|
|
63
63
|
import { StorageScope, StorageTarget } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage';
|
|
64
64
|
import { IStorageService } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service';
|
|
65
65
|
import { IExtensionService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensions/common/extensions.service';
|
|
66
66
|
import { groupBy } from '@codingame/monaco-vscode-api/vscode/vs/base/common/collections';
|
|
67
67
|
import { getActionBarActions, getFlatContextMenuActions } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/browser/menuEntryActionViewItem';
|
|
68
|
-
import { ResourceLabels } from '@codingame/monaco-vscode-
|
|
68
|
+
import { ResourceLabels } from '@codingame/monaco-vscode-3b5a5cd1-d4ff-500a-b609-57e0cd4afa0a-common/vscode/vs/workbench/browser/labels';
|
|
69
69
|
import { FileKind } from '@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files';
|
|
70
70
|
import { WorkbenchToolBar } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/browser/toolbar';
|
|
71
71
|
import { ITelemetryService } from '@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetry.service';
|
|
72
72
|
import { basename } from '@codingame/monaco-vscode-api/vscode/vs/base/common/path';
|
|
73
73
|
import { IEditorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
74
|
-
import { ScmHistoryItemResolver } from '@codingame/monaco-vscode-
|
|
75
|
-
import { ResourceTree } from '@codingame/monaco-vscode-
|
|
74
|
+
import { ScmHistoryItemResolver } from '@codingame/monaco-vscode-aac7027b-326c-513a-95a9-e4eedd151b38-common/vscode/vs/workbench/contrib/multiDiffEditor/browser/scmMultiDiffSourceResolver';
|
|
75
|
+
import { ResourceTree } from '@codingame/monaco-vscode-bc6f260d-ec63-5c95-9446-1ca7d0872719-common/vscode/vs/base/common/resourceTree';
|
|
76
76
|
import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
|
|
77
77
|
import { ILabelService } from '@codingame/monaco-vscode-api/vscode/vs/platform/label/common/label.service';
|
|
78
78
|
import { CodeDataTransfers } from '@codingame/monaco-vscode-api/vscode/vs/platform/dnd/browser/dnd';
|
|
79
|
-
import { autorun
|
|
79
|
+
import { autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/reactions/autorun';
|
|
80
80
|
import { observableValue } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/observableValue';
|
|
81
81
|
import { derived } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/derived';
|
|
82
82
|
import { waitForState } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/utils/utilsCancellation';
|
|
@@ -125,23 +125,23 @@ class SCMHistoryItemRefsActionViewItem extends ActionViewItem {
|
|
|
125
125
|
icon.classList.add(...ThemeIcon.asClassNameArray(Codicon.gitBranch));
|
|
126
126
|
const name = $('.name');
|
|
127
127
|
if (this._historyItemsFilter === 'all') {
|
|
128
|
-
name.textContent = ( localize(
|
|
128
|
+
name.textContent = ( localize(10402, "All"));
|
|
129
129
|
}
|
|
130
130
|
else if (this._historyItemsFilter === 'auto') {
|
|
131
|
-
name.textContent = ( localize(
|
|
131
|
+
name.textContent = ( localize(10403, "Auto"));
|
|
132
132
|
}
|
|
133
133
|
else if (this._historyItemsFilter.length === 1) {
|
|
134
134
|
name.textContent = this._historyItemsFilter[0].name;
|
|
135
135
|
}
|
|
136
136
|
else {
|
|
137
|
-
name.textContent = ( localize(
|
|
137
|
+
name.textContent = ( localize(10404, "{0} Items", this._historyItemsFilter.length));
|
|
138
138
|
}
|
|
139
139
|
reset(this.label, icon, name);
|
|
140
140
|
}
|
|
141
141
|
}
|
|
142
142
|
getTooltip() {
|
|
143
143
|
if (this._historyItemsFilter === 'all') {
|
|
144
|
-
return localize(
|
|
144
|
+
return localize(10405, "All history item references");
|
|
145
145
|
}
|
|
146
146
|
else if (this._historyItemsFilter === 'auto') {
|
|
147
147
|
const historyProvider = this._repository.provider.historyProvider.get();
|
|
@@ -163,12 +163,12 @@ registerAction2(class extends ViewAction {
|
|
|
163
163
|
constructor() {
|
|
164
164
|
super({
|
|
165
165
|
id: PICK_REPOSITORY_ACTION_ID,
|
|
166
|
-
title: ( localize(
|
|
166
|
+
title: ( localize(10406, "Repository Picker")),
|
|
167
167
|
viewId: HISTORY_VIEW_PANE_ID,
|
|
168
168
|
f1: false,
|
|
169
169
|
menu: {
|
|
170
170
|
id: MenuId.SCMHistoryTitle,
|
|
171
|
-
when: ( ContextKeyExpr.and(( ContextKeyExpr.has('scm.providerCount')), ContextKeyExpr.greater('scm.providerCount', 1))),
|
|
171
|
+
when: ( ContextKeyExpr.and(( ContextKeyExpr.has('scm.providerCount')), ContextKeyExpr.greater('scm.providerCount', 1), ( ContextKeyExpr.equals('config.scm.repositories.selectionMode', 'multiple')))),
|
|
172
172
|
group: 'navigation',
|
|
173
173
|
order: 0
|
|
174
174
|
}
|
|
@@ -182,7 +182,7 @@ registerAction2(class extends ViewAction {
|
|
|
182
182
|
constructor() {
|
|
183
183
|
super({
|
|
184
184
|
id: PICK_HISTORY_ITEM_REFS_ACTION_ID,
|
|
185
|
-
title: ( localize(
|
|
185
|
+
title: ( localize(10407, "History Item Reference Picker")),
|
|
186
186
|
icon: Codicon.gitBranch,
|
|
187
187
|
viewId: HISTORY_VIEW_PANE_ID,
|
|
188
188
|
precondition: ( ContextKeys.SCMHistoryItemCount.notEqualsTo(0)),
|
|
@@ -202,7 +202,7 @@ registerAction2(class extends ViewAction {
|
|
|
202
202
|
constructor() {
|
|
203
203
|
super({
|
|
204
204
|
id: 'workbench.scm.action.graph.revealCurrentHistoryItem',
|
|
205
|
-
title: ( localize(
|
|
205
|
+
title: ( localize(10408, "Go to Current History Item")),
|
|
206
206
|
icon: Codicon.target,
|
|
207
207
|
viewId: HISTORY_VIEW_PANE_ID,
|
|
208
208
|
precondition: ( ContextKeyExpr.and(( ContextKeys.SCMHistoryItemCount.notEqualsTo(0)), ( ContextKeys.SCMCurrentHistoryItemRefInFilter.isEqualTo(true)))),
|
|
@@ -222,7 +222,7 @@ registerAction2(class extends ViewAction {
|
|
|
222
222
|
constructor() {
|
|
223
223
|
super({
|
|
224
224
|
id: 'workbench.scm.action.graph.refresh',
|
|
225
|
-
title: ( localize(
|
|
225
|
+
title: ( localize(10409, "Refresh")),
|
|
226
226
|
viewId: HISTORY_VIEW_PANE_ID,
|
|
227
227
|
f1: false,
|
|
228
228
|
icon: Codicon.refresh,
|
|
@@ -241,7 +241,7 @@ registerAction2(class extends ViewAction {
|
|
|
241
241
|
constructor() {
|
|
242
242
|
super({
|
|
243
243
|
id: 'workbench.scm.action.graph.setListViewMode',
|
|
244
|
-
title: ( localize(
|
|
244
|
+
title: ( localize(10410, "View as List")),
|
|
245
245
|
viewId: HISTORY_VIEW_PANE_ID,
|
|
246
246
|
toggled: ( ContextKeys.SCMHistoryViewMode.isEqualTo(ViewMode.List)),
|
|
247
247
|
menu: { id: MenuId.SCMHistoryTitle, group: '9_viewmode', order: 1 },
|
|
@@ -256,7 +256,7 @@ registerAction2(class extends ViewAction {
|
|
|
256
256
|
constructor() {
|
|
257
257
|
super({
|
|
258
258
|
id: 'workbench.scm.action.graph.setTreeViewMode',
|
|
259
|
-
title: ( localize(
|
|
259
|
+
title: ( localize(10411, "View as Tree")),
|
|
260
260
|
viewId: HISTORY_VIEW_PANE_ID,
|
|
261
261
|
toggled: ( ContextKeys.SCMHistoryViewMode.isEqualTo(ViewMode.Tree)),
|
|
262
262
|
menu: { id: MenuId.SCMHistoryTitle, group: '9_viewmode', order: 2 },
|
|
@@ -271,7 +271,7 @@ registerAction2(class extends Action2 {
|
|
|
271
271
|
constructor() {
|
|
272
272
|
super({
|
|
273
273
|
id: 'workbench.scm.action.graph.viewChanges',
|
|
274
|
-
title: ( localize(
|
|
274
|
+
title: ( localize(10412, "Open Changes")),
|
|
275
275
|
icon: Codicon.diffMultiple,
|
|
276
276
|
f1: false,
|
|
277
277
|
menu: [
|
|
@@ -298,21 +298,31 @@ registerAction2(class extends Action2 {
|
|
|
298
298
|
const historyItem = historyItems[0];
|
|
299
299
|
const historyItemLast = historyItems[historyItems.length - 1];
|
|
300
300
|
const historyProvider = provider.historyProvider.get();
|
|
301
|
+
const historyItemRef = historyProvider?.historyItemRef.get();
|
|
302
|
+
const historyItemRemoteRef = historyProvider?.historyItemRemoteRef.get();
|
|
301
303
|
if (historyItems.length > 1) {
|
|
302
304
|
const ancestor = await historyProvider?.resolveHistoryItemRefsCommonAncestor([historyItem.id, historyItemLast.id]);
|
|
303
305
|
if (!ancestor || (ancestor !== historyItem.id && ancestor !== historyItemLast.id)) {
|
|
304
306
|
return;
|
|
305
307
|
}
|
|
306
308
|
}
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
309
|
+
let title, historyItemId, historyItemParentId;
|
|
310
|
+
if (historyItem.id === SCMIncomingHistoryItemId) {
|
|
311
|
+
title = `${historyItem.subject} - ${historyItemRef?.name} \u2194 ${historyItemRemoteRef?.name}`;
|
|
312
|
+
historyItemId = historyProvider.historyItemRemoteRef.get().id;
|
|
313
|
+
historyItemParentId = historyItem.parentIds[0];
|
|
314
|
+
}
|
|
315
|
+
else if (historyItem.id === SCMOutgoingHistoryItemId) {
|
|
316
|
+
title = `${historyItem.subject} - ${historyItemRemoteRef?.name} \u2194 ${historyItemRef?.name}`;
|
|
317
|
+
historyItemId = historyProvider.historyItemRef.get().id;
|
|
318
|
+
historyItemParentId = historyItem.parentIds[0];
|
|
319
|
+
}
|
|
320
|
+
else {
|
|
321
|
+
title = getHistoryItemEditorTitle(historyItem);
|
|
322
|
+
historyItemId = historyItem.id;
|
|
323
|
+
historyItemParentId = historyItem.parentIds.length > 0 ? historyItem.parentIds[0] : undefined;
|
|
324
|
+
}
|
|
325
|
+
const multiDiffSourceUri = ScmHistoryItemResolver.getMultiDiffSourceUri(provider, historyItemId, historyItemParentId, '');
|
|
316
326
|
commandService.executeCommand('_workbench.openMultiDiffEditor', { title, multiDiffSourceUri });
|
|
317
327
|
}
|
|
318
328
|
});
|
|
@@ -320,7 +330,7 @@ registerAction2(class extends Action2 {
|
|
|
320
330
|
constructor() {
|
|
321
331
|
super({
|
|
322
332
|
id: 'workbench.scm.action.graph.openFile',
|
|
323
|
-
title: ( localize(
|
|
333
|
+
title: ( localize(10413, "Open File")),
|
|
324
334
|
icon: Codicon.goToFile,
|
|
325
335
|
f1: false,
|
|
326
336
|
menu: [
|
|
@@ -342,10 +352,18 @@ registerAction2(class extends Action2 {
|
|
|
342
352
|
if (!historyItem || !historyItemChange.modifiedUri) {
|
|
343
353
|
return;
|
|
344
354
|
}
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
}
|
|
355
|
+
let version;
|
|
356
|
+
if (historyItem.id === SCMIncomingHistoryItemId) {
|
|
357
|
+
version = ( localize(10414, "Incoming Changes"));
|
|
358
|
+
}
|
|
359
|
+
else if (historyItem.id === SCMOutgoingHistoryItemId) {
|
|
360
|
+
version = ( localize(10415, "Outgoing Changes"));
|
|
361
|
+
}
|
|
362
|
+
else {
|
|
363
|
+
version = historyItem.displayId ?? historyItem.id;
|
|
364
|
+
}
|
|
365
|
+
const name = basename(historyItemChange.modifiedUri.fsPath);
|
|
366
|
+
await editorService.openEditor({ resource: historyItemChange.modifiedUri, label: `${name} (${version})` });
|
|
349
367
|
}
|
|
350
368
|
});
|
|
351
369
|
class ListDelegate {
|
|
@@ -371,9 +389,8 @@ let HistoryItemRenderer = class HistoryItemRenderer {
|
|
|
371
389
|
static { HistoryItemRenderer_1 = this; }
|
|
372
390
|
static { this.TEMPLATE_ID = 'history-item'; }
|
|
373
391
|
get templateId() { return HistoryItemRenderer_1.TEMPLATE_ID; }
|
|
374
|
-
constructor(hoverDelegate,
|
|
392
|
+
constructor(hoverDelegate, _commandService, _configurationService, _contextKeyService, _contextMenuService, _hoverService, _keybindingService, _menuService, _telemetryService) {
|
|
375
393
|
this.hoverDelegate = hoverDelegate;
|
|
376
|
-
this._clipboardService = _clipboardService;
|
|
377
394
|
this._commandService = _commandService;
|
|
378
395
|
this._configurationService = _configurationService;
|
|
379
396
|
this._contextKeyService = _contextKeyService;
|
|
@@ -382,7 +399,6 @@ let HistoryItemRenderer = class HistoryItemRenderer {
|
|
|
382
399
|
this._keybindingService = _keybindingService;
|
|
383
400
|
this._menuService = _menuService;
|
|
384
401
|
this._telemetryService = _telemetryService;
|
|
385
|
-
this._themeService = _themeService;
|
|
386
402
|
this._badgesConfig = observableConfigValue('scm.graph.badges', 'filter', this._configurationService);
|
|
387
403
|
}
|
|
388
404
|
renderTemplate(container) {
|
|
@@ -410,12 +426,16 @@ let HistoryItemRenderer = class HistoryItemRenderer {
|
|
|
410
426
|
const provider = node.element.repository.provider;
|
|
411
427
|
const historyItemViewModel = node.element.historyItemViewModel;
|
|
412
428
|
const historyItem = historyItemViewModel.historyItem;
|
|
413
|
-
const
|
|
414
|
-
|
|
415
|
-
|
|
429
|
+
const hoverContent = {
|
|
430
|
+
markdown: historyItem.tooltip ?? historyItem.message,
|
|
431
|
+
markdownNotSupportedFallback: historyItem.message
|
|
432
|
+
};
|
|
433
|
+
const historyItemHover = this._hoverService.setupManagedHover(this.hoverDelegate, templateData.element, hoverContent);
|
|
416
434
|
templateData.elementDisposables.add(historyItemHover);
|
|
417
435
|
templateData.graphContainer.textContent = '';
|
|
418
|
-
templateData.graphContainer.classList.toggle('current', historyItemViewModel.
|
|
436
|
+
templateData.graphContainer.classList.toggle('current', historyItemViewModel.kind === 'HEAD');
|
|
437
|
+
templateData.graphContainer.classList.toggle('incoming-changes', historyItemViewModel.kind === 'incoming-changes');
|
|
438
|
+
templateData.graphContainer.classList.toggle('outgoing-changes', historyItemViewModel.kind === 'outgoing-changes');
|
|
419
439
|
templateData.graphContainer.appendChild(renderSCMHistoryItemGraph(historyItemViewModel));
|
|
420
440
|
const historyItemRef = provider.historyProvider.get()?.historyItemRef?.get();
|
|
421
441
|
const extraClasses = historyItemRef?.revision === historyItem.id ? ['history-item-current'] : [];
|
|
@@ -444,9 +464,12 @@ let HistoryItemRenderer = class HistoryItemRenderer {
|
|
|
444
464
|
if (key === '' && labelConfig !== 'all') {
|
|
445
465
|
continue;
|
|
446
466
|
}
|
|
467
|
+
if (!historyItemRefs) {
|
|
468
|
+
continue;
|
|
469
|
+
}
|
|
447
470
|
const historyItemRefByIconId = groupBy(historyItemRefs, ref => ThemeIcon.isThemeIcon(ref.icon) ? ref.icon.id : '');
|
|
448
471
|
for (const [key, historyItemRefs] of Object.entries(historyItemRefByIconId)) {
|
|
449
|
-
if (key === '') {
|
|
472
|
+
if (key === '' || !historyItemRefs) {
|
|
450
473
|
continue;
|
|
451
474
|
}
|
|
452
475
|
this._renderBadge(historyItemRefs, false, templateData);
|
|
@@ -481,31 +504,6 @@ let HistoryItemRenderer = class HistoryItemRenderer {
|
|
|
481
504
|
elements.description.textContent = showDescription ? historyItemRefs[0].name : '';
|
|
482
505
|
append(templateData.labelContainer, elements.root);
|
|
483
506
|
}
|
|
484
|
-
_getHoverActions(provider, historyItem) {
|
|
485
|
-
const actions = this._menuService.getMenuActions(MenuId.SCMHistoryItemHover, this._contextKeyService, {
|
|
486
|
-
arg: provider,
|
|
487
|
-
shouldForwardArgs: true
|
|
488
|
-
}).flatMap(item => item[1]);
|
|
489
|
-
return [
|
|
490
|
-
{
|
|
491
|
-
commandId: 'workbench.scm.action.graph.copyHistoryItemId',
|
|
492
|
-
iconClass: 'codicon.codicon-copy',
|
|
493
|
-
label: historyItem.displayId ?? historyItem.id,
|
|
494
|
-
run: () => this._clipboardService.writeText(historyItem.id)
|
|
495
|
-
},
|
|
496
|
-
...( actions.map(action => {
|
|
497
|
-
const iconClass = ThemeIcon.isThemeIcon(action.item.icon)
|
|
498
|
-
? ThemeIcon.asClassNameArray(action.item.icon).join('.')
|
|
499
|
-
: undefined;
|
|
500
|
-
return {
|
|
501
|
-
commandId: action.id,
|
|
502
|
-
label: action.label,
|
|
503
|
-
iconClass,
|
|
504
|
-
run: () => action.run(historyItem)
|
|
505
|
-
};
|
|
506
|
-
}))
|
|
507
|
-
];
|
|
508
|
-
}
|
|
509
507
|
_processMatches(historyItemViewModel, filterData) {
|
|
510
508
|
if (!filterData) {
|
|
511
509
|
return [undefined, undefined];
|
|
@@ -524,16 +522,14 @@ let HistoryItemRenderer = class HistoryItemRenderer {
|
|
|
524
522
|
}
|
|
525
523
|
};
|
|
526
524
|
HistoryItemRenderer = HistoryItemRenderer_1 = ( __decorate([
|
|
527
|
-
( __param(1,
|
|
528
|
-
( __param(2,
|
|
529
|
-
( __param(3,
|
|
530
|
-
( __param(4,
|
|
531
|
-
( __param(5,
|
|
532
|
-
( __param(6,
|
|
533
|
-
( __param(7,
|
|
534
|
-
( __param(8,
|
|
535
|
-
( __param(9, ITelemetryService)),
|
|
536
|
-
( __param(10, IThemeService))
|
|
525
|
+
( __param(1, ICommandService)),
|
|
526
|
+
( __param(2, IConfigurationService)),
|
|
527
|
+
( __param(3, IContextKeyService)),
|
|
528
|
+
( __param(4, IContextMenuService)),
|
|
529
|
+
( __param(5, IHoverService)),
|
|
530
|
+
( __param(6, IKeybindingService)),
|
|
531
|
+
( __param(7, IMenuService)),
|
|
532
|
+
( __param(8, ITelemetryService))
|
|
537
533
|
], HistoryItemRenderer));
|
|
538
534
|
let HistoryItemChangeRenderer = class HistoryItemChangeRenderer {
|
|
539
535
|
static { HistoryItemChangeRenderer_1 = this; }
|
|
@@ -659,7 +655,7 @@ let HistoryItemLoadMoreRenderer = class HistoryItemLoadMoreRenderer {
|
|
|
659
655
|
templateData.elementDisposables.add(autorun(reader => {
|
|
660
656
|
const isLoadingMore = this._isLoadingMore.read(reader);
|
|
661
657
|
const icon = `$(${isLoadingMore ? 'loading~spin' : 'fold-down'})`;
|
|
662
|
-
templateData.historyItemPlaceholderLabel.setLabel(( localize(
|
|
658
|
+
templateData.historyItemPlaceholderLabel.setLabel(( localize(10416, "{0} Load More...", icon)));
|
|
663
659
|
}));
|
|
664
660
|
}
|
|
665
661
|
}
|
|
@@ -719,7 +715,7 @@ SCMHistoryViewPaneActionRunner = ( __decorate([
|
|
|
719
715
|
], SCMHistoryViewPaneActionRunner));
|
|
720
716
|
class SCMHistoryTreeAccessibilityProvider {
|
|
721
717
|
getWidgetAriaLabel() {
|
|
722
|
-
return localize(
|
|
718
|
+
return localize(10417, "Source Control History");
|
|
723
719
|
}
|
|
724
720
|
getAriaLabel(element) {
|
|
725
721
|
if (isSCMRepository(element)) {
|
|
@@ -813,10 +809,27 @@ class SCMHistoryTreeDataSource extends Disposable {
|
|
|
813
809
|
}
|
|
814
810
|
}
|
|
815
811
|
else if (isSCMHistoryItemViewModelTreeElement(inputOrElement)) {
|
|
816
|
-
const historyItem = inputOrElement.historyItemViewModel.historyItem;
|
|
817
|
-
const historyItemParentId = historyItem.parentIds.length > 0 ? historyItem.parentIds[0] : undefined;
|
|
818
812
|
const historyProvider = inputOrElement.repository.provider.historyProvider.get();
|
|
819
|
-
const
|
|
813
|
+
const historyItemViewModel = inputOrElement.historyItemViewModel;
|
|
814
|
+
const historyItem = historyItemViewModel.historyItem;
|
|
815
|
+
let historyItemId, historyItemParentId;
|
|
816
|
+
if (historyItemViewModel.kind === 'incoming-changes' ||
|
|
817
|
+
historyItemViewModel.kind === 'outgoing-changes') {
|
|
818
|
+
const historyItemRef = historyProvider?.historyItemRef.get();
|
|
819
|
+
const historyItemRemoteRef = historyProvider?.historyItemRemoteRef.get();
|
|
820
|
+
if (!historyProvider || !historyItemRef || !historyItemRemoteRef) {
|
|
821
|
+
return [];
|
|
822
|
+
}
|
|
823
|
+
historyItemId = historyItemViewModel.kind === 'incoming-changes'
|
|
824
|
+
? historyItemRemoteRef.id
|
|
825
|
+
: historyItemRef.id;
|
|
826
|
+
historyItemParentId = historyItem.parentIds[0];
|
|
827
|
+
}
|
|
828
|
+
else {
|
|
829
|
+
historyItemId = historyItem.id;
|
|
830
|
+
historyItemParentId = historyItem.parentIds.length > 0 ? historyItem.parentIds[0] : undefined;
|
|
831
|
+
}
|
|
832
|
+
const historyItemChanges = (await historyProvider?.provideHistoryItemChanges(historyItemId, historyItemParentId)) ?? [];
|
|
820
833
|
if (this.viewMode() === ViewMode.List) {
|
|
821
834
|
children.push(...( historyItemChanges.map(change => ({
|
|
822
835
|
repository: inputOrElement.repository,
|
|
@@ -891,9 +904,10 @@ class SCMHistoryTreeDragAndDrop {
|
|
|
891
904
|
const provider = element.repository.provider;
|
|
892
905
|
const historyItem = element.historyItemViewModel.historyItem;
|
|
893
906
|
const attachmentName = `$(${Codicon.repo.id})\u00A0${provider.name}\u00A0$(${Codicon.gitCommit.id})\u00A0${historyItem.displayId ?? historyItem.id}`;
|
|
907
|
+
const historyItemParentId = historyItem.parentIds.length > 0 ? historyItem.parentIds[0] : undefined;
|
|
894
908
|
historyItems.push({
|
|
895
909
|
name: attachmentName,
|
|
896
|
-
resource: ScmHistoryItemResolver.getMultiDiffSourceUri(provider, historyItem),
|
|
910
|
+
resource: ScmHistoryItemResolver.getMultiDiffSourceUri(provider, historyItem.id, historyItemParentId, historyItem.displayId),
|
|
897
911
|
historyItem: historyItem
|
|
898
912
|
});
|
|
899
913
|
}
|
|
@@ -910,7 +924,8 @@ class SCMHistoryTreeDragAndDrop {
|
|
|
910
924
|
if (isSCMHistoryItemViewModelTreeElement(element)) {
|
|
911
925
|
const provider = element.repository.provider;
|
|
912
926
|
const historyItem = element.historyItemViewModel.historyItem;
|
|
913
|
-
|
|
927
|
+
const historyItemParentId = historyItem.parentIds.length > 0 ? historyItem.parentIds[0] : undefined;
|
|
928
|
+
return ScmHistoryItemResolver.getMultiDiffSourceUri(provider, historyItem.id, historyItemParentId, historyItem.displayId);
|
|
914
929
|
}
|
|
915
930
|
return undefined;
|
|
916
931
|
}
|
|
@@ -945,7 +960,7 @@ let SCMHistoryViewModel = class SCMHistoryViewModel extends Disposable {
|
|
|
945
960
|
if (selectedRepository !== 'auto') {
|
|
946
961
|
return selectedRepository;
|
|
947
962
|
}
|
|
948
|
-
return this._scmViewService.activeRepository.read(reader);
|
|
963
|
+
return this._scmViewService.activeRepository.read(reader)?.repository;
|
|
949
964
|
});
|
|
950
965
|
this.repository = latestChangedValue(this, [firstRepository, graphRepository]);
|
|
951
966
|
const closedRepository = observableFromEvent(this, this._scmService.onDidRemoveRepository, repository => repository);
|
|
@@ -1007,6 +1022,8 @@ let SCMHistoryViewModel = class SCMHistoryViewModel extends Disposable {
|
|
|
1007
1022
|
async getHistoryItems() {
|
|
1008
1023
|
const repository = this.repository.get();
|
|
1009
1024
|
const historyProvider = repository?.provider.historyProvider.get();
|
|
1025
|
+
const historyItemRef = historyProvider?.historyItemRef.get();
|
|
1026
|
+
const historyItemRemoteRef = historyProvider?.historyItemRemoteRef.get();
|
|
1010
1027
|
if (!repository || !historyProvider) {
|
|
1011
1028
|
this._scmHistoryItemCountCtx.set(0);
|
|
1012
1029
|
this.isViewModelEmpty.set(true, undefined);
|
|
@@ -1015,6 +1032,8 @@ let SCMHistoryViewModel = class SCMHistoryViewModel extends Disposable {
|
|
|
1015
1032
|
let state = this._repositoryState.get(repository);
|
|
1016
1033
|
if (!state || state.loadMore !== false) {
|
|
1017
1034
|
const historyItems = state?.viewModels
|
|
1035
|
+
.filter(vm => vm.historyItemViewModel.kind !== 'incoming-changes' &&
|
|
1036
|
+
vm.historyItemViewModel.kind !== 'outgoing-changes')
|
|
1018
1037
|
.map(vm => vm.historyItemViewModel.historyItem) ?? [];
|
|
1019
1038
|
const historyItemRefs = state?.historyItemsFilter ??
|
|
1020
1039
|
(await this._resolveHistoryItemFilter(repository, historyProvider));
|
|
@@ -1025,14 +1044,24 @@ let SCMHistoryViewModel = class SCMHistoryViewModel extends Disposable {
|
|
|
1025
1044
|
historyItemRefs: historyItemRefIds, limit, skip: historyItems.length
|
|
1026
1045
|
})) ?? []));
|
|
1027
1046
|
} while (typeof state?.loadMore === 'string' && !historyItems.find(item => item.id === state?.loadMore));
|
|
1047
|
+
const mergeBase = historyItemRef && historyItemRemoteRef && state?.mergeBase === undefined
|
|
1048
|
+
? await historyProvider.resolveHistoryItemRefsCommonAncestor([
|
|
1049
|
+
historyItemRef.name,
|
|
1050
|
+
historyItemRemoteRef.name
|
|
1051
|
+
])
|
|
1052
|
+
: state?.mergeBase;
|
|
1028
1053
|
const colorMap = this._getGraphColorMap(historyItemRefs);
|
|
1029
|
-
const
|
|
1054
|
+
const addIncomingChangesNode = this._scmViewService.graphShowIncomingChangesConfig.get()
|
|
1055
|
+
&& ( historyItemRefs.some(ref => ref.id === historyItemRemoteRef?.id));
|
|
1056
|
+
const addOutgoingChangesNode = this._scmViewService.graphShowOutgoingChangesConfig.get()
|
|
1057
|
+
&& ( historyItemRefs.some(ref => ref.id === historyItemRef?.id));
|
|
1058
|
+
const viewModels = ( toISCMHistoryItemViewModelArray(historyItems, colorMap, historyProvider.historyItemRef.get(), historyProvider.historyItemRemoteRef.get(), historyProvider.historyItemBaseRef.get(), addIncomingChangesNode, addOutgoingChangesNode, mergeBase)
|
|
1030
1059
|
.map(historyItemViewModel => ({
|
|
1031
1060
|
repository,
|
|
1032
1061
|
historyItemViewModel,
|
|
1033
1062
|
type: 'historyItemViewModel'
|
|
1034
1063
|
})));
|
|
1035
|
-
state = { historyItemsFilter: historyItemRefs, viewModels, loadMore: false };
|
|
1064
|
+
state = { historyItemsFilter: historyItemRefs, viewModels, mergeBase, loadMore: false };
|
|
1036
1065
|
this._repositoryState.set(repository, state);
|
|
1037
1066
|
this._scmHistoryItemCountCtx.set(viewModels.length);
|
|
1038
1067
|
this.isViewModelEmpty.set(viewModels.length === 0, undefined);
|
|
@@ -1162,8 +1191,8 @@ let RepositoryPicker = class RepositoryPicker {
|
|
|
1162
1191
|
this._quickInputService = _quickInputService;
|
|
1163
1192
|
this._scmViewService = _scmViewService;
|
|
1164
1193
|
this._autoQuickPickItem = {
|
|
1165
|
-
label: ( localize(
|
|
1166
|
-
description: ( localize(
|
|
1194
|
+
label: ( localize(10403, "Auto")),
|
|
1195
|
+
description: ( localize(10418, "Show the source control graph for the active repository")),
|
|
1167
1196
|
repository: 'auto'
|
|
1168
1197
|
};
|
|
1169
1198
|
}
|
|
@@ -1181,7 +1210,7 @@ let RepositoryPicker = class RepositoryPicker {
|
|
|
1181
1210
|
repository: r
|
|
1182
1211
|
}))));
|
|
1183
1212
|
return this._quickInputService.pick(picks, {
|
|
1184
|
-
placeHolder: ( localize(
|
|
1213
|
+
placeHolder: ( localize(10419, "Select the repository to view, type to filter all repositories"))
|
|
1185
1214
|
});
|
|
1186
1215
|
}
|
|
1187
1216
|
};
|
|
@@ -1197,21 +1226,21 @@ let HistoryItemRefPicker = class HistoryItemRefPicker extends Disposable {
|
|
|
1197
1226
|
this._quickInputService = _quickInputService;
|
|
1198
1227
|
this._allQuickPickItem = {
|
|
1199
1228
|
id: 'all',
|
|
1200
|
-
label: ( localize(
|
|
1201
|
-
description: ( localize(
|
|
1229
|
+
label: ( localize(10402, "All")),
|
|
1230
|
+
description: ( localize(10405, "All history item references")),
|
|
1202
1231
|
historyItemRef: 'all'
|
|
1203
1232
|
};
|
|
1204
1233
|
this._autoQuickPickItem = {
|
|
1205
1234
|
id: 'auto',
|
|
1206
|
-
label: ( localize(
|
|
1207
|
-
description: ( localize(
|
|
1235
|
+
label: ( localize(10403, "Auto")),
|
|
1236
|
+
description: ( localize(10420, "Current history item reference(s)")),
|
|
1208
1237
|
historyItemRef: 'auto'
|
|
1209
1238
|
};
|
|
1210
1239
|
}
|
|
1211
1240
|
async pickHistoryItemRef() {
|
|
1212
1241
|
const quickPick = this._quickInputService.createQuickPick({ useSeparators: true });
|
|
1213
1242
|
this._store.add(quickPick);
|
|
1214
|
-
quickPick.placeholder = ( localize(
|
|
1243
|
+
quickPick.placeholder = ( localize(10421, "Select one/more history item references to view, type to filter"));
|
|
1215
1244
|
quickPick.canSelectMany = true;
|
|
1216
1245
|
quickPick.hideCheckAll = true;
|
|
1217
1246
|
quickPick.busy = true;
|
|
@@ -1308,7 +1337,7 @@ HistoryItemRefPicker = ( __decorate([
|
|
|
1308
1337
|
( __param(2, IQuickInputService))
|
|
1309
1338
|
], HistoryItemRefPicker));
|
|
1310
1339
|
let SCMHistoryViewPane = class SCMHistoryViewPane extends ViewPane {
|
|
1311
|
-
constructor(options, _editorService, _instantiationService, _menuService, _progressService, configurationService, contextMenuService, keybindingService, instantiationService, viewDescriptorService, contextKeyService, openerService, themeService, hoverService) {
|
|
1340
|
+
constructor(options, _editorService, _instantiationService, _menuService, _progressService, _scmViewService, configurationService, contextMenuService, keybindingService, instantiationService, viewDescriptorService, contextKeyService, openerService, themeService, hoverService) {
|
|
1312
1341
|
super({
|
|
1313
1342
|
...options,
|
|
1314
1343
|
titleMenuId: MenuId.SCMHistoryTitle,
|
|
@@ -1318,18 +1347,22 @@ let SCMHistoryViewPane = class SCMHistoryViewPane extends ViewPane {
|
|
|
1318
1347
|
this._instantiationService = _instantiationService;
|
|
1319
1348
|
this._menuService = _menuService;
|
|
1320
1349
|
this._progressService = _progressService;
|
|
1350
|
+
this._scmViewService = _scmViewService;
|
|
1321
1351
|
this._repositoryIsLoadingMore = observableValue(this, false);
|
|
1322
1352
|
this._repositoryOutdated = observableValue(this, false);
|
|
1323
1353
|
this._visibilityDisposables = ( new DisposableStore());
|
|
1324
1354
|
this._treeOperationSequencer = ( new Sequencer());
|
|
1325
1355
|
this._treeLoadMoreSequencer = ( new Sequencer());
|
|
1356
|
+
this._refreshThrottler = ( new Throttler());
|
|
1326
1357
|
this._updateChildrenThrottler = ( new Throttler());
|
|
1327
1358
|
this._contextMenuDisposables = ( new MutableDisposable());
|
|
1328
1359
|
this._scmProviderCtx = ContextKeys.SCMProvider.bindTo(this.scopedContextKeyService);
|
|
1329
1360
|
this._scmCurrentHistoryItemRefHasRemote = ContextKeys.SCMCurrentHistoryItemRefHasRemote.bindTo(this.scopedContextKeyService);
|
|
1361
|
+
this._scmCurrentHistoryItemRefHasBase = ContextKeys.SCMCurrentHistoryItemRefHasBase.bindTo(this.scopedContextKeyService);
|
|
1330
1362
|
this._scmCurrentHistoryItemRefInFilter = ContextKeys.SCMCurrentHistoryItemRefInFilter.bindTo(this.scopedContextKeyService);
|
|
1331
1363
|
this._actionRunner = this.instantiationService.createInstance(SCMHistoryViewPaneActionRunner);
|
|
1332
1364
|
this._register(this._actionRunner);
|
|
1365
|
+
this._register(this._refreshThrottler);
|
|
1333
1366
|
this._register(this._updateChildrenThrottler);
|
|
1334
1367
|
}
|
|
1335
1368
|
renderHeaderTitle(container) {
|
|
@@ -1341,7 +1374,7 @@ let SCMHistoryViewPane = class SCMHistoryViewPane extends ViewPane {
|
|
|
1341
1374
|
container.appendChild(element.root);
|
|
1342
1375
|
this._register(this.hoverService.setupManagedHover(getDefaultHoverDelegate('mouse'), element.root, {
|
|
1343
1376
|
markdown: {
|
|
1344
|
-
value: ( localize(
|
|
1377
|
+
value: ( localize(10422, "Please refresh the graph using the refresh action ($(refresh)).")),
|
|
1345
1378
|
supportThemeIcons: true
|
|
1346
1379
|
},
|
|
1347
1380
|
markdownNotSupportedFallback: undefined
|
|
@@ -1380,8 +1413,14 @@ let SCMHistoryViewPane = class SCMHistoryViewPane extends ViewPane {
|
|
|
1380
1413
|
this._treeViewModel.isViewModelEmpty.read(reader);
|
|
1381
1414
|
this._onDidChangeViewWelcomeState.fire();
|
|
1382
1415
|
}));
|
|
1416
|
+
this._visibilityDisposables.add(runOnChange(this._scmViewService.graphShowIncomingChangesConfig, async () => {
|
|
1417
|
+
await this.refresh();
|
|
1418
|
+
}));
|
|
1419
|
+
this._visibilityDisposables.add(runOnChange(this._scmViewService.graphShowOutgoingChangesConfig, async () => {
|
|
1420
|
+
await this.refresh();
|
|
1421
|
+
}));
|
|
1383
1422
|
let isFirstRun = true;
|
|
1384
|
-
this._visibilityDisposables.add(
|
|
1423
|
+
this._visibilityDisposables.add(autorun(reader => {
|
|
1385
1424
|
const repository = this._treeViewModel.repository.read(reader);
|
|
1386
1425
|
const historyProvider = repository?.provider.historyProvider.read(reader);
|
|
1387
1426
|
if (!repository || !historyProvider) {
|
|
@@ -1390,11 +1429,11 @@ let SCMHistoryViewPane = class SCMHistoryViewPane extends ViewPane {
|
|
|
1390
1429
|
const historyItemRefId = derived(reader => {
|
|
1391
1430
|
return historyProvider.historyItemRef.read(reader)?.id;
|
|
1392
1431
|
});
|
|
1393
|
-
store.add(runOnChange(historyItemRefId, async (historyItemRefIdValue) => {
|
|
1432
|
+
reader.store.add(runOnChange(historyItemRefId, async (historyItemRefIdValue) => {
|
|
1394
1433
|
await this.refresh();
|
|
1395
1434
|
this._scmCurrentHistoryItemRefInFilter.set(this._isCurrentHistoryItemInFilter(historyItemRefIdValue));
|
|
1396
1435
|
}));
|
|
1397
|
-
store.add(runOnChange(historyProvider.historyItemRefChanges, changes => {
|
|
1436
|
+
reader.store.add(runOnChange(historyProvider.historyItemRefChanges, changes => {
|
|
1398
1437
|
if (changes.silent) {
|
|
1399
1438
|
if (this._tree.scrollTop === 0) {
|
|
1400
1439
|
this.refresh();
|
|
@@ -1405,14 +1444,17 @@ let SCMHistoryViewPane = class SCMHistoryViewPane extends ViewPane {
|
|
|
1405
1444
|
}
|
|
1406
1445
|
this.refresh();
|
|
1407
1446
|
}));
|
|
1408
|
-
store.add(runOnChange(this._treeViewModel.onDidChangeHistoryItemsFilter, async () => {
|
|
1447
|
+
reader.store.add(runOnChange(this._treeViewModel.onDidChangeHistoryItemsFilter, async () => {
|
|
1409
1448
|
await this.refresh();
|
|
1410
1449
|
this._scmCurrentHistoryItemRefInFilter.set(this._isCurrentHistoryItemInFilter(historyItemRefId.read(undefined)));
|
|
1411
1450
|
}));
|
|
1412
|
-
store.add(autorun(reader => {
|
|
1451
|
+
reader.store.add(autorun(reader => {
|
|
1413
1452
|
this._scmCurrentHistoryItemRefHasRemote.set(!!historyProvider.historyItemRemoteRef.read(reader));
|
|
1414
1453
|
}));
|
|
1415
|
-
store.add(
|
|
1454
|
+
reader.store.add(autorun(reader => {
|
|
1455
|
+
this._scmCurrentHistoryItemRefHasBase.set(!!historyProvider.historyItemBaseRef.read(reader));
|
|
1456
|
+
}));
|
|
1457
|
+
reader.store.add(runOnChange(this._treeViewModel.viewMode, async () => {
|
|
1416
1458
|
await this._updateChildren();
|
|
1417
1459
|
}));
|
|
1418
1460
|
this._scmProviderCtx.set(repository.provider.providerId);
|
|
@@ -1466,8 +1508,17 @@ let SCMHistoryViewPane = class SCMHistoryViewPane extends ViewPane {
|
|
|
1466
1508
|
return this._treeViewModel?.isViewModelEmpty.get() === true;
|
|
1467
1509
|
}
|
|
1468
1510
|
async refresh() {
|
|
1511
|
+
return this._refreshThrottler.queue(token => this._refresh(token));
|
|
1512
|
+
}
|
|
1513
|
+
async _refresh(token) {
|
|
1514
|
+
if (token.isCancellationRequested) {
|
|
1515
|
+
return;
|
|
1516
|
+
}
|
|
1469
1517
|
this._treeViewModel.clearRepositoryState();
|
|
1470
1518
|
await this._updateChildren();
|
|
1519
|
+
if (token.isCancellationRequested) {
|
|
1520
|
+
return;
|
|
1521
|
+
}
|
|
1471
1522
|
this.updateActions();
|
|
1472
1523
|
this._repositoryOutdated.set(false, undefined);
|
|
1473
1524
|
this._tree.scrollTop = 0;
|
|
@@ -1565,7 +1616,11 @@ let SCMHistoryViewPane = class SCMHistoryViewPane extends ViewPane {
|
|
|
1565
1616
|
else if (isSCMHistoryItemChangeViewModelTreeElement(e.element)) {
|
|
1566
1617
|
const historyItemChange = e.element.historyItemChange;
|
|
1567
1618
|
const historyItem = e.element.historyItemViewModel.historyItem;
|
|
1568
|
-
const historyItemDisplayId = historyItem.
|
|
1619
|
+
const historyItemDisplayId = historyItem.id === SCMIncomingHistoryItemId
|
|
1620
|
+
? ( localize(10414, "Incoming Changes"))
|
|
1621
|
+
: historyItem.id === SCMOutgoingHistoryItemId
|
|
1622
|
+
? ( localize(10415, "Outgoing Changes"))
|
|
1623
|
+
: historyItem.displayId ?? historyItem.id;
|
|
1569
1624
|
const historyItemParentId = historyItem.parentIds.length > 0 ? historyItem.parentIds[0] : undefined;
|
|
1570
1625
|
const historyItemParentDisplayId = historyItemParentId && historyItem.displayId
|
|
1571
1626
|
? historyItemParentId.substring(0, historyItem.displayId.length)
|
|
@@ -1573,7 +1628,7 @@ let SCMHistoryViewPane = class SCMHistoryViewPane extends ViewPane {
|
|
|
1573
1628
|
if (historyItemChange.originalUri && historyItemChange.modifiedUri) {
|
|
1574
1629
|
const originalUriTitle = `${basename(historyItemChange.originalUri.fsPath)} (${historyItemParentDisplayId})`;
|
|
1575
1630
|
const modifiedUriTitle = `${basename(historyItemChange.modifiedUri.fsPath)} (${historyItemDisplayId})`;
|
|
1576
|
-
const title = `${originalUriTitle}
|
|
1631
|
+
const title = `${originalUriTitle} \u2194 ${modifiedUriTitle}`;
|
|
1577
1632
|
await this._editorService.openEditor({
|
|
1578
1633
|
label: title,
|
|
1579
1634
|
original: { resource: historyItemChange.originalUri },
|
|
@@ -1607,7 +1662,13 @@ let SCMHistoryViewPane = class SCMHistoryViewPane extends ViewPane {
|
|
|
1607
1662
|
_onContextMenu(e) {
|
|
1608
1663
|
const element = e.element;
|
|
1609
1664
|
if (isSCMHistoryItemViewModelTreeElement(element)) {
|
|
1665
|
+
if (element.historyItemViewModel.kind === 'incoming-changes' || element.historyItemViewModel.kind === 'outgoing-changes') {
|
|
1666
|
+
return;
|
|
1667
|
+
}
|
|
1610
1668
|
this._contextMenuDisposables.value = ( new DisposableStore());
|
|
1669
|
+
const historyProvider = element.repository.provider.historyProvider.get();
|
|
1670
|
+
const historyItemRef = historyProvider?.historyItemRef.get();
|
|
1671
|
+
const historyItem = element.historyItemViewModel.historyItem;
|
|
1611
1672
|
const historyItemRefMenuItems = MenuRegistry.getMenuItems(MenuId.SCMHistoryItemRefContext).filter(item => isIMenuItem(item));
|
|
1612
1673
|
if (historyItemRefMenuItems.length > 0 && element.historyItemViewModel.historyItem.references?.length) {
|
|
1613
1674
|
const historyItemRefActions = ( new Map());
|
|
@@ -1654,7 +1715,10 @@ let SCMHistoryViewPane = class SCMHistoryViewPane extends ViewPane {
|
|
|
1654
1715
|
}
|
|
1655
1716
|
}
|
|
1656
1717
|
}
|
|
1657
|
-
const
|
|
1718
|
+
const contextKeyService = this.scopedContextKeyService.createOverlay([
|
|
1719
|
+
['scmHistoryItemHasCurrentHistoryItemRef', historyItem.references?.find(ref => ref.id === historyItemRef?.id) !== undefined]
|
|
1720
|
+
]);
|
|
1721
|
+
const menuActions = this._menuService.getMenuActions(MenuId.SCMHistoryItemContext, contextKeyService, {
|
|
1658
1722
|
arg: element.repository.provider,
|
|
1659
1723
|
shouldForwardArgs: true
|
|
1660
1724
|
}).filter(group => group[0] !== 'inline');
|
|
@@ -1714,15 +1778,16 @@ SCMHistoryViewPane = ( __decorate([
|
|
|
1714
1778
|
( __param(2, IInstantiationService)),
|
|
1715
1779
|
( __param(3, IMenuService)),
|
|
1716
1780
|
( __param(4, IProgressService)),
|
|
1717
|
-
( __param(5,
|
|
1718
|
-
( __param(6,
|
|
1719
|
-
( __param(7,
|
|
1720
|
-
( __param(8,
|
|
1721
|
-
( __param(9,
|
|
1722
|
-
( __param(10,
|
|
1723
|
-
( __param(11,
|
|
1724
|
-
( __param(12,
|
|
1725
|
-
( __param(13,
|
|
1781
|
+
( __param(5, ISCMViewService)),
|
|
1782
|
+
( __param(6, IConfigurationService)),
|
|
1783
|
+
( __param(7, IContextMenuService)),
|
|
1784
|
+
( __param(8, IKeybindingService)),
|
|
1785
|
+
( __param(9, IInstantiationService)),
|
|
1786
|
+
( __param(10, IViewDescriptorService)),
|
|
1787
|
+
( __param(11, IContextKeyService)),
|
|
1788
|
+
( __param(12, IOpenerService)),
|
|
1789
|
+
( __param(13, IThemeService)),
|
|
1790
|
+
( __param(14, IHoverService))
|
|
1726
1791
|
], SCMHistoryViewPane));
|
|
1727
1792
|
|
|
1728
1793
|
export { SCMHistoryViewPane };
|