mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-13 19:48:37 -05:00
Vscode merge (#4582)
* Merge from vscode 37cb23d3dd4f9433d56d4ba5ea3203580719a0bd * fix issues with merges * bump node version in azpipe * replace license headers * remove duplicate launch task * fix build errors * fix build errors * fix tslint issues * working through package and linux build issues * more work * wip * fix packaged builds * working through linux build errors * wip * wip * wip * fix mac and linux file limits * iterate linux pipeline * disable editor typing * revert series to parallel * remove optimize vscode from linux * fix linting issues * revert testing change * add work round for new node * readd packaging for extensions * fix issue with angular not resolving decorator dependencies
This commit is contained in:
@@ -649,14 +649,16 @@ export class CommandCenter {
|
||||
|
||||
if (!(resource instanceof Resource)) {
|
||||
// can happen when called from a keybinding
|
||||
console.log('WHAT');
|
||||
resource = this.getSCMResource();
|
||||
}
|
||||
|
||||
if (resource) {
|
||||
const resources = ([resource, ...resourceStates] as Resource[])
|
||||
.filter(r => r.type !== Status.DELETED && r.type !== Status.INDEX_DELETED);
|
||||
|
||||
uris = resources.map(r => r.resourceUri);
|
||||
uris = ([resource, ...resourceStates] as Resource[])
|
||||
.filter(r => r.type !== Status.DELETED && r.type !== Status.INDEX_DELETED)
|
||||
.map(r => r.resourceUri);
|
||||
} else if (window.activeTextEditor) {
|
||||
uris = [window.activeTextEditor.document.uri];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -665,6 +667,7 @@ export class CommandCenter {
|
||||
}
|
||||
|
||||
const activeTextEditor = window.activeTextEditor;
|
||||
|
||||
for (const uri of uris) {
|
||||
const opts: TextDocumentShowOptions = {
|
||||
preserveFocus,
|
||||
@@ -1458,8 +1461,7 @@ export class CommandCenter {
|
||||
name.trim().replace(/^\.|\/\.|\.\.|~|\^|:|\/$|\.lock$|\.lock\/|\\|\*|\s|^\s*$|\.$|\[|\]$/g, branchWhitespaceChar)
|
||||
: name;
|
||||
|
||||
const rawBranchName = await window.showInputBox({
|
||||
value: defaultName,
|
||||
const rawBranchName = defaultName || await window.showInputBox({
|
||||
placeHolder: localize('branch name', "Branch name"),
|
||||
prompt: localize('provide branch name', "Please provide a branch name"),
|
||||
ignoreFocusOut: true,
|
||||
@@ -1480,7 +1482,7 @@ export class CommandCenter {
|
||||
}
|
||||
|
||||
const picks = [new HEADItem(repository), ...createCheckoutItems(repository)];
|
||||
const placeHolder = localize('select a ref to create a new branch from', 'Select a ref to create a new branch from');
|
||||
const placeHolder = localize('select a ref to create a new branch from', 'Select a ref to create the \'{0}\' branch from', branchName);
|
||||
const target = await window.showQuickPick(picks, { placeHolder });
|
||||
|
||||
if (!target) {
|
||||
@@ -1801,6 +1803,72 @@ export class CommandCenter {
|
||||
await this._push(repository, { pushType: PushType.PushTo, forcePush: true });
|
||||
}
|
||||
|
||||
@command('git.addRemote', { repository: true })
|
||||
async addRemote(repository: Repository): Promise<void> {
|
||||
const remotes = repository.remotes;
|
||||
|
||||
const sanitize = (name: string) => {
|
||||
name = name.trim();
|
||||
return name && name.replace(/^\.|\/\.|\.\.|~|\^|:|\/$|\.lock$|\.lock\/|\\|\*|\s|^\s*$|\.$|\[|\]$/g, '-');
|
||||
};
|
||||
|
||||
const resultName = await window.showInputBox({
|
||||
placeHolder: localize('remote name', "Remote name"),
|
||||
prompt: localize('provide remote name', "Please provide a remote name"),
|
||||
ignoreFocusOut: true,
|
||||
validateInput: (name: string) => {
|
||||
if (sanitize(name)) {
|
||||
return null;
|
||||
}
|
||||
return localize('remote name format invalid', "Remote name format invalid");
|
||||
}
|
||||
});
|
||||
|
||||
const name = sanitize(resultName || '');
|
||||
|
||||
if (!name) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (remotes.find(r => r.name === name)) {
|
||||
window.showErrorMessage(localize('remote already exists', "Remote '{0}' already exists.", name));
|
||||
return;
|
||||
}
|
||||
|
||||
const url = await window.showInputBox({
|
||||
placeHolder: localize('remote url', "Remote URL"),
|
||||
prompt: localize('provide remote URL', "Enter URL for remote \"{0}\"", name),
|
||||
ignoreFocusOut: true
|
||||
});
|
||||
|
||||
if (!url) {
|
||||
return;
|
||||
}
|
||||
|
||||
await repository.addRemote(name, url);
|
||||
}
|
||||
|
||||
@command('git.removeRemote', { repository: true })
|
||||
async removeRemote(repository: Repository): Promise<void> {
|
||||
const remotes = repository.remotes;
|
||||
|
||||
if (remotes.length === 0) {
|
||||
window.showErrorMessage(localize('no remotes added', "Your repository has no remotes."));
|
||||
return;
|
||||
}
|
||||
|
||||
const picks = remotes.map(r => r.name);
|
||||
const placeHolder = localize('remove remote', "Pick a remote to remove");
|
||||
|
||||
const remoteName = await window.showQuickPick(picks, { placeHolder });
|
||||
|
||||
if (!remoteName) {
|
||||
return;
|
||||
}
|
||||
|
||||
await repository.removeRemote(remoteName);
|
||||
}
|
||||
|
||||
private async _sync(repository: Repository, rebase: boolean): Promise<void> {
|
||||
const HEAD = repository.HEAD;
|
||||
|
||||
@@ -2118,6 +2186,7 @@ export class CommandCenter {
|
||||
uri = uri ? uri : (window.activeTextEditor && window.activeTextEditor.document.uri);
|
||||
|
||||
this.outputChannel.appendLine(`git.getSCMResource.uri ${uri && uri.toString()}`);
|
||||
|
||||
for (const r of this.model.repositories.map(r => r.root)) {
|
||||
this.outputChannel.appendLine(`repo root ${r}`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user