mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-22 19:29:17 +00:00
SCM - more improvements to the repositories view (#274438)
* SCM - tweak artifact folder compression * SCM - fixed more commands and layout * SCM - more compression changes
This commit is contained in:
@@ -3363,24 +3363,7 @@ export class CommandCenter {
|
||||
|
||||
@command('git.createTag', { repository: true })
|
||||
async createTag(repository: Repository, historyItem?: SourceControlHistoryItem): Promise<void> {
|
||||
const inputTagName = await window.showInputBox({
|
||||
placeHolder: l10n.t('Tag name'),
|
||||
prompt: l10n.t('Please provide a tag name'),
|
||||
ignoreFocusOut: true
|
||||
});
|
||||
|
||||
if (!inputTagName) {
|
||||
return;
|
||||
}
|
||||
|
||||
const inputMessage = await window.showInputBox({
|
||||
placeHolder: l10n.t('Message'),
|
||||
prompt: l10n.t('Please provide a message to annotate the tag'),
|
||||
ignoreFocusOut: true
|
||||
});
|
||||
|
||||
const name = inputTagName.replace(/^\.|\/\.|\.\.|~|\^|:|\/$|\.lock$|\.lock\/|\\|\*|\s|^\s*$|\.$/g, '-');
|
||||
await repository.tag({ name, message: inputMessage, ref: historyItem?.id });
|
||||
await this._createTag(repository, historyItem?.id);
|
||||
}
|
||||
|
||||
@command('git.deleteTag', { repository: true })
|
||||
@@ -5259,6 +5242,24 @@ export class CommandCenter {
|
||||
config.update(setting, !enabled, true);
|
||||
}
|
||||
|
||||
@command('git.repositories.createBranch', { repository: true })
|
||||
async artifactGroupCreateBranch(repository: Repository): Promise<void> {
|
||||
if (!repository) {
|
||||
return;
|
||||
}
|
||||
|
||||
await this._branch(repository, undefined, false);
|
||||
}
|
||||
|
||||
@command('git.repositories.createTag', { repository: true })
|
||||
async artifactGroupCreateTag(repository: Repository): Promise<void> {
|
||||
if (!repository) {
|
||||
return;
|
||||
}
|
||||
|
||||
await this._createTag(repository);
|
||||
}
|
||||
|
||||
@command('git.repositories.checkout', { repository: true })
|
||||
async artifactCheckout(repository: Repository, artifact: SourceControlArtifact): Promise<void> {
|
||||
if (!repository || !artifact) {
|
||||
@@ -5312,6 +5313,27 @@ export class CommandCenter {
|
||||
`${sourceRef.ref.name} ↔ ${artifact.name}`);
|
||||
}
|
||||
|
||||
private async _createTag(repository: Repository, ref?: string): Promise<void> {
|
||||
const inputTagName = await window.showInputBox({
|
||||
placeHolder: l10n.t('Tag name'),
|
||||
prompt: l10n.t('Please provide a tag name'),
|
||||
ignoreFocusOut: true
|
||||
});
|
||||
|
||||
if (!inputTagName) {
|
||||
return;
|
||||
}
|
||||
|
||||
const inputMessage = await window.showInputBox({
|
||||
placeHolder: l10n.t('Message'),
|
||||
prompt: l10n.t('Please provide a message to annotate the tag'),
|
||||
ignoreFocusOut: true
|
||||
});
|
||||
|
||||
const name = inputTagName.replace(/^\.|\/\.|\.\.|~|\^|:|\/$|\.lock$|\.lock\/|\\|\*|\s|^\s*$|\.$/g, '-');
|
||||
await repository.tag({ name, message: inputMessage, ref });
|
||||
}
|
||||
|
||||
private createCommand(id: string, key: string, method: Function, options: ScmCommandOptions): (...args: any[]) => any {
|
||||
const result = (...args: any[]) => {
|
||||
let result: Promise<any>;
|
||||
|
||||
Reference in New Issue
Block a user