提交 ea196dee 编写于 作者: J Joao Moreno

git commands: undo last commit

上级 c01d286e
......@@ -28,7 +28,7 @@ import {IFileService} from 'vs/platform/files/common/files';
import {IInstantiationService} from 'vs/platform/instantiation/common/instantiation';
import wbar = require('vs/workbench/common/actionRegistry');
import { SyncActionDescriptor } from 'vs/platform/actions/common/actions';
import { OpenChangeAction, OpenFileAction, SyncAction, PullAction, PushAction, PublishAction, StartGitBranchAction, StartGitCheckoutAction, InputCommitAction } from './gitActions';
import { OpenChangeAction, OpenFileAction, SyncAction, PullAction, PushAction, PublishAction, StartGitBranchAction, StartGitCheckoutAction, InputCommitAction, UndoLastCommitAction } from './gitActions';
import paths = require('vs/base/common/paths');
import URI from 'vs/base/common/uri';
......@@ -479,3 +479,4 @@ workbenchActionRegistry.registerWorkbenchAction(new SyncActionDescriptor(Publish
workbenchActionRegistry.registerWorkbenchAction(new SyncActionDescriptor(StartGitBranchAction, StartGitBranchAction.ID, StartGitBranchAction.LABEL), category);
workbenchActionRegistry.registerWorkbenchAction(new SyncActionDescriptor(StartGitCheckoutAction, StartGitCheckoutAction.ID, StartGitCheckoutAction.LABEL), category);
workbenchActionRegistry.registerWorkbenchAction(new SyncActionDescriptor(InputCommitAction, InputCommitAction.ID, InputCommitAction.LABEL), category);
workbenchActionRegistry.registerWorkbenchAction(new SyncActionDescriptor(UndoLastCommitAction, UndoLastCommitAction.ID, UndoLastCommitAction.LABEL), category);
......@@ -1162,9 +1162,14 @@ export class LiveSyncAction extends BaseSyncAction {
export class UndoLastCommitAction extends GitAction {
static ID = 'workbench.action.git.undoLastCommit';
static LABEL = nls.localize('undoLastCommit', "Undo Last Commit");
constructor(@IGitService gitService: IGitService) {
super(UndoLastCommitAction.ID, nls.localize('undoLastCommit', "Undo Last Commit"), 'git-action undo-last-commit', gitService);
constructor(
id = UndoLastCommitAction.ID,
label = UndoLastCommitAction.LABEL,
@IGitService gitService: IGitService
) {
super(UndoLastCommitAction.ID, UndoLastCommitAction.LABEL, 'git-action undo-last-commit', gitService);
}
public run():Promise {
......
......@@ -259,7 +259,7 @@ export class ChangesView extends EventEmitter.EventEmitter implements GitView.IV
new ActionBar.Separator(),
this.instantiationService.createInstance(GitActions.CommitAction, this),
this.instantiationService.createInstance(GitActions.StageAndCommitAction, this),
this.instantiationService.createInstance(GitActions.UndoLastCommitAction),
this.instantiationService.createInstance(GitActions.UndoLastCommitAction, GitActions.UndoLastCommitAction.ID, GitActions.UndoLastCommitAction.LABEL),
new ActionBar.Separator(),
this.instantiationService.createInstance(GitActions.GlobalUnstageAction),
this.instantiationService.createInstance(GitActions.GlobalUndoAction),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册