Skip to content

Commit 2512d7b

Browse files
authored
Revert Git revert action (eclipse-che#6470)
1 parent 5d786ab commit 2512d7b

24 files changed

Lines changed: 12 additions & 933 deletions

File tree

ide/che-core-ide-api/src/main/java/org/eclipse/che/ide/api/git/GitServiceClient.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
import org.eclipse.che.api.git.shared.PushResponse;
2323
import org.eclipse.che.api.git.shared.Remote;
2424
import org.eclipse.che.api.git.shared.ResetRequest.ResetType;
25-
import org.eclipse.che.api.git.shared.RevertResult;
2625
import org.eclipse.che.api.git.shared.Revision;
2726
import org.eclipse.che.api.git.shared.ShowFileContentResponse;
2827
import org.eclipse.che.api.git.shared.Status;
@@ -367,13 +366,4 @@ Promise<LogResponse> log(
367366
* @return the promise with success status
368367
*/
369368
Promise<Void> deleteRepository(Path project);
370-
371-
/**
372-
* Reverts commit.
373-
*
374-
* @param project the project path
375-
* @param commit the hash of the commit to revert
376-
* @return result of the revert operation
377-
*/
378-
Promise<RevertResult> revert(Path project, String commit);
379369
}

ide/che-core-ide-api/src/main/java/org/eclipse/che/ide/api/git/GitServiceClientImpl.java

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@
4343
import org.eclipse.che.api.git.shared.Remote;
4444
import org.eclipse.che.api.git.shared.RemoteAddRequest;
4545
import org.eclipse.che.api.git.shared.ResetRequest;
46-
import org.eclipse.che.api.git.shared.RevertRequest;
47-
import org.eclipse.che.api.git.shared.RevertResult;
4846
import org.eclipse.che.api.git.shared.Revision;
4947
import org.eclipse.che.api.git.shared.ShowFileContentResponse;
5048
import org.eclipse.che.api.git.shared.Status;
@@ -88,7 +86,6 @@ public class GitServiceClientImpl implements GitServiceClient {
8886
private static final String REMOVE = "/git/remove";
8987
private static final String RESET = "/git/reset";
9088
private static final String REPOSITORY = "/git/repository";
91-
private static final String REVERT = "/git/revert";
9289

9390
/** Loader to be displayed. */
9491
private final AsyncRequestLoader loader;
@@ -506,16 +503,6 @@ public Promise<Void> deleteRepository(Path project) {
506503
return asyncRequestFactory.createDeleteRequest(url).loader(loader).send();
507504
}
508505

509-
@Override
510-
public Promise<RevertResult> revert(Path project, String commit) {
511-
RevertRequest revertRequest = dtoFactory.createDto(RevertRequest.class).withCommit(commit);
512-
String url = getWsAgentBaseUrl() + REVERT + "?projectPath=" + project;
513-
return asyncRequestFactory
514-
.createPostRequest(url, revertRequest)
515-
.loader(loader)
516-
.send(dtoUnmarshallerFactory.newUnmarshaller(RevertResult.class));
517-
}
518-
519506
private String getWsAgentBaseUrl() {
520507
return appContext.getDevMachine().getWsAgentBaseUrl();
521508
}

plugins/plugin-git/che-plugin-git-ext-git/src/main/java/org/eclipse/che/ide/ext/git/client/GitExtension.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
import org.eclipse.che.ide.ext.git.client.action.RemoveFromIndexAction;
4040
import org.eclipse.che.ide.ext.git.client.action.ResetFilesAction;
4141
import org.eclipse.che.ide.ext.git.client.action.ResetToCommitAction;
42-
import org.eclipse.che.ide.ext.git.client.action.RevertCommitAction;
4342
import org.eclipse.che.ide.ext.git.client.action.ShowBranchesAction;
4443
import org.eclipse.che.ide.ext.git.client.action.ShowMergeAction;
4544
import org.eclipse.che.ide.ext.git.client.action.ShowRemoteAction;
@@ -93,7 +92,6 @@ public GitExtension(
9392
CompareWithRevisionAction compareWithRevisionAction,
9493
NextDiffAction nextDiffAction,
9594
PreviousDiffAction previousDiffAction,
96-
RevertCommitAction revertCommitAction,
9795
KeyBindingAgent keyBinding) {
9896

9997
resources.gitCSS().ensureInjected();
@@ -133,8 +131,6 @@ public GitExtension(
133131
commandGroup.add(compareGroup);
134132
actionManager.registerAction("gitResetToCommit", resetToCommitAction);
135133
commandGroup.add(resetToCommitAction);
136-
actionManager.registerAction("gitRevertCommit", revertCommitAction);
137-
commandGroup.add(revertCommitAction);
138134
actionManager.registerAction("gitRemoveFromIndexCommit", removeFromIndexAction);
139135
commandGroup.add(removeFromIndexAction);
140136
actionManager.registerAction(GIT_SHOW_COMMIT_WINDOW, commitAction);
@@ -178,7 +174,6 @@ public GitExtension(
178174
gitContextMenuGroup.add(addToIndexAction);
179175
gitContextMenuGroup.add(removeFromIndexAction);
180176
gitContextMenuGroup.add(resetFilesAction);
181-
gitContextMenuGroup.add(revertCommitAction);
182177
gitContextMenuGroup.add(commitAction);
183178
gitContextMenuGroup.add(historyAction);
184179
gitContextMenuGroup.addSeparator();

plugins/plugin-git/che-plugin-git-ext-git/src/main/java/org/eclipse/che/ide/ext/git/client/GitLocalizationConstant.java

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,6 @@ public interface GitLocalizationConstant extends Messages {
7272
@Key("button.compare")
7373
String buttonCompare();
7474

75-
@Key("button.revert")
76-
String buttonRevert();
77-
7875
@Key("button.save_changes")
7976
String buttonSaveChanges();
8077

@@ -428,50 +425,13 @@ public interface GitLocalizationConstant extends Messages {
428425
@Key("view.reset.hard.type.description")
429426
String resetHardTypeDescription();
430427

431-
// Revert
432-
@Key("view.revert.commit.title")
433-
String revertCommitViewTitle();
434-
435-
@Key("view.revert.no_commit.type.title")
436-
String revertNoCommitTypeTitle();
437-
438-
@Key("view.revert.no_commit.type.description")
439-
String revertNoCommitTypeDescription();
440-
441-
@Key("view.revert.revision.table.id.title")
442-
String viewRevertRevisionTableIdTitle();
443-
444-
@Key("view.revert.revision.table.date.title")
445-
String viewRevertRevisionTableDateTitle();
446-
447-
@Key("view.revert.revision.table.author.title")
448-
String viewRevertRevisionTableAuthorTitle();
449-
450-
@Key("view.revert.revision.table.comment.title")
451-
String viewRevertRevisionTableCommentTitle();
452-
453-
@Key("reverted.commits")
454-
String revertedCommits(String commits);
455-
456-
@Key("reverted.new.head")
457-
String revertedNewHead(String newHead);
458-
459-
@Key("reverted.conflicts")
460-
String revertedConflicts();
461-
462428
// Remove
463429
@Key("view.remove_from_index.all")
464430
String removeFromIndexAll();
465431

466432
@Key("view.remove_from_index.only")
467433
String removeFromIndexOnly();
468434

469-
@Key("control.revert.commit.title")
470-
String revertCommitControlTitle();
471-
472-
@Key("control.revert.commit.prompt")
473-
String revertCommitControlPrompt();
474-
475435
@Key("view.remove_from_index.folder")
476436
String removeFromIndexFolder(String folder);
477437

plugins/plugin-git/che-plugin-git-ext-git/src/main/java/org/eclipse/che/ide/ext/git/client/GitResources.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,4 @@ interface GitCSS extends CssResource {
101101

102102
@Source("controls/git-output-icon.svg")
103103
SVGResource gitOutput();
104-
105-
@Source("controls/revert.svg")
106-
SVGResource revert();
107104
}

plugins/plugin-git/che-plugin-git-ext-git/src/main/java/org/eclipse/che/ide/ext/git/client/action/RevertCommitAction.java

Lines changed: 0 additions & 46 deletions
This file was deleted.

plugins/plugin-git/che-plugin-git-ext-git/src/main/java/org/eclipse/che/ide/ext/git/client/inject/GitGinModule.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,6 @@
6060
import org.eclipse.che.ide.ext.git.client.reset.commit.ResetToCommitViewImpl;
6161
import org.eclipse.che.ide.ext.git.client.reset.files.ResetFilesView;
6262
import org.eclipse.che.ide.ext.git.client.reset.files.ResetFilesViewImpl;
63-
import org.eclipse.che.ide.ext.git.client.revert.RevertCommitView;
64-
import org.eclipse.che.ide.ext.git.client.revert.RevertCommitViewImpl;
6563

6664
/** @author Andrey Plotnikov */
6765
@ExtensionGinModule
@@ -82,7 +80,6 @@ protected void configure() {
8280
bind(RemoveFromIndexView.class).to(RemoveFromIndexViewImpl.class).in(Singleton.class);
8381
bind(RevisionListView.class).to(RevisionListViewImpl.class).in(Singleton.class);
8482
bind(CommitView.class).to(CommitViewImpl.class).in(Singleton.class);
85-
bind(RevertCommitView.class).to(RevertCommitViewImpl.class).in(Singleton.class);
8683
bind(ChangesListView.class).to(ChangesListViewImpl.class).in(Singleton.class);
8784
bind(BranchView.class).to(BranchViewImpl.class).in(Singleton.class);
8885
bind(BranchListView.class).to(BranchListViewImpl.class).in(Singleton.class);

0 commit comments

Comments
 (0)