[git] remove unused methods around GitChangesSaver, correctly refresh after unstashing

This commit is contained in:
Kirill Likhodedov
2015-07-24 16:17:30 +03:00
parent a8524791bd
commit ee81a2b991
4 changed files with 2 additions and 30 deletions
@@ -53,11 +53,6 @@ public abstract class GitChangesSaver {
protected GitConflictResolver.Params myParams;
/**
* Refreshes files changed during save or load.
*/
public abstract void refresh();
/**
* Returns an instance of the proper GitChangesSaver depending on the given save changes policy.
* @return {@link GitStashChangesSaver} or {@link GitShelveChangesSaver}.
@@ -96,13 +91,6 @@ public abstract class GitChangesSaver {
save(rootsToSave);
}
/**
* Loads local changes from stash or shelf, and sorts the changes back to the change lists they were before update.
*/
public void restoreLocalChanges() {
load();
}
public void notifyLocalChangesAreNotRestored() {
if (wereChangesSaved()) {
LOG.info("Update is incomplete, changes are not restored");
@@ -112,10 +112,4 @@ public class GitShelveChangesSaver extends GitChangesSaver {
protected void showSavedChanges() {
myShelveViewManager.activateView(myShelvedLists.get(myShelvedLists.keySet().iterator().next()));
}
@Override
public void refresh() {
// refreshed inside shelve manager
}
}
@@ -26,7 +26,7 @@ import com.intellij.openapi.vcs.changes.Change;
import com.intellij.openapi.vcs.history.VcsRevisionNumber;
import com.intellij.openapi.vcs.impl.LocalChangesUnderRoots;
import com.intellij.openapi.vcs.merge.MergeDialogCustomizer;
import com.intellij.openapi.vfs.LocalFileSystem;
import com.intellij.openapi.vfs.VfsUtil;
import com.intellij.openapi.vfs.VirtualFile;
import git4idea.GitPlatformFacade;
import git4idea.commands.Git;
@@ -92,12 +92,6 @@ public class GitStashChangesSaver extends GitChangesSaver {
GitUnstashDialog.showUnstashDialog(myProject, new ArrayList<VirtualFile>(myStashedRoots), myStashedRoots.iterator().next());
}
@Override
public void refresh() {
// we'll refresh more but this way we needn't compute what files under roots etc
LocalFileSystem.getInstance().refreshIoFiles(myChangeManager.getAffectedPaths());
}
private void stash(Collection<VirtualFile> roots) throws VcsException {
for (VirtualFile root : roots) {
final String message = GitHandlerUtil.formatOperationName("Stashing changes from", root);
@@ -131,6 +125,7 @@ public class GitStashChangesSaver extends GitChangesSaver {
GitSimpleEventDetector conflictDetector = new GitSimpleEventDetector(GitSimpleEventDetector.Event.MERGE_CONFLICT_ON_UNSTASH);
GitCommandResult result = myGit.stashPop(repository, conflictDetector);
VfsUtil.markDirtyAndRefresh(false, true, false, root);
if (result.success()) {
return false;
}
@@ -304,11 +304,6 @@ public class GitUpdateProcess {
return compoundResult.join(result);
}
private void restoreLocalChanges() {
mySaver.restoreLocalChanges();
mySaver.refresh();
}
// fetch all roots. If an error happens, return false and notify about errors.
private boolean fetchAndNotify() {
return new GitFetcher(myProject, myProgressIndicator, false).fetchRootsAndNotify(myRepositories, "Update failed", false);