提交 d49ea348 编写于 作者: A Alex Dima

Merge branch 'master' of https://github.com/Microsoft/vscode

......@@ -351,7 +351,6 @@ export class CommandCenter {
const config = workspace.getConfiguration('git');
let value = config.get<string>('defaultCloneDirectory') || os.homedir();
value = value.replace(/^~/, os.homedir());
const parentPath = await window.showInputBox({
prompt: localize('parent', "Parent Directory"),
......@@ -379,7 +378,7 @@ export class CommandCenter {
statusBarItem.command = cancelCommandId;
statusBarItem.show();
const clonePromise = this.git.clone(url, parentPath, tokenSource.token);
const clonePromise = this.git.clone(url, parentPath.replace(/^~/, os.homedir()), tokenSource.token);
try {
window.withProgress({ location: ProgressLocation.SourceControl, title: localize('cloning', "Cloning git repository...") }, () => clonePromise);
......@@ -1326,7 +1325,7 @@ export class CommandCenter {
const remoteRefs = repository.refs;
const remoteRefsFiltered = remoteRefs.filter(r => (r.remote === remotePick.label));
const branchPicks = remoteRefsFiltered.map(r => ({ label: r.name})) as {label : string; description : string}[];
const branchPicks = remoteRefsFiltered.map(r => ({ label: r.name })) as { label: string; description: string }[];
const branchPick = await window.showQuickPick(branchPicks, { placeHolder });
if (!branchPick) {
......@@ -1335,7 +1334,7 @@ export class CommandCenter {
const remoteCharCnt = remotePick.label.length;
repository.pull(false, remotePick.label, branchPick.label.slice(remoteCharCnt+1));
repository.pull(false, remotePick.label, branchPick.label.slice(remoteCharCnt + 1));
}
@command('git.pull', { repository: true })
......
......@@ -66,8 +66,14 @@ Registry.as<IWorkbenchActionRegistry>(WorkbenchActionExtensions.WorkbenchActions
Registry.as<IConfigurationRegistry>(ConfigurationExtensions.Configuration).registerConfiguration({
id: 'scm',
order: 5,
title: localize('scmConfigurationTitle', "SCM"),
type: 'object',
properties: {
'scm.alwaysShowProviders': {
type: 'boolean',
description: localize('alwaysShowProviders', "Whether to always show the Source Control Provider section."),
default: false
},
'scm.diffDecorations': {
type: 'string',
enum: ['all', 'gutter', 'overview', 'none'],
......
......@@ -8,7 +8,7 @@
import 'vs/css!./media/scmViewlet';
import { localize } from 'vs/nls';
import { TPromise } from 'vs/base/common/winjs.base';
import Event, { Emitter, chain, mapEvent, anyEvent } from 'vs/base/common/event';
import Event, { Emitter, chain, mapEvent, anyEvent, filterEvent } from 'vs/base/common/event';
import { domEvent, stop } from 'vs/base/browser/event';
import { basename } from 'vs/base/common/paths';
import { onUnexpectedError } from 'vs/base/common/errors';
......@@ -1035,7 +1035,8 @@ export class SCMViewlet extends PanelViewlet implements IViewModel {
@IWorkbenchEditorService protected editorService: IWorkbenchEditorService,
@IWorkspaceContextService contextService: IWorkspaceContextService,
@IStorageService storageService: IStorageService,
@IExtensionService extensionService: IExtensionService
@IExtensionService extensionService: IExtensionService,
@IConfigurationService private configurationService: IConfigurationService
) {
super(VIEWLET_ID, { showHeaderInTitleWhenSingleView: true }, telemetryService, themeService);
......@@ -1054,6 +1055,10 @@ export class SCMViewlet extends PanelViewlet implements IViewModel {
this.scmService.onDidAddRepository(this.onDidAddRepository, this, this.disposables);
this.scmService.onDidRemoveRepository(this.onDidRemoveRepository, this, this.disposables);
this.scmService.repositories.forEach(r => this.onDidAddRepository(r));
const onDidUpdateConfiguration = filterEvent(this.configurationService.onDidChangeConfiguration, e => e.affectsConfiguration('scm.alwaysShowProviders'));
onDidUpdateConfiguration(this.onDidChangeRepositories, this, this.disposables);
this.onDidChangeRepositories();
}
......@@ -1087,7 +1092,8 @@ export class SCMViewlet extends PanelViewlet implements IViewModel {
private onDidChangeRepositories(): void {
toggleClass(this.el, 'empty', this.scmService.repositories.length === 0);
const shouldMainPanelBeVisible = this.scmService.repositories.length > 1;
const shouldMainPanelAlwaysBeVisible = this.configurationService.getValue('scm.alwaysShowProviders');
const shouldMainPanelBeVisible = shouldMainPanelAlwaysBeVisible || this.scmService.repositories.length > 1;
if (!!this.mainPanel === shouldMainPanelBeVisible) {
return;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册