From df0a60bfa3848556a7cd5b221ffac94cecd147c2 Mon Sep 17 00:00:00 2001 From: Nadya Zabrodina Date: Fri, 1 Jul 2016 17:08:26 +0300 Subject: [PATCH] [shelf]: refresh VF content of patchFile before apply; cleanUp --- .../vcs/changes/shelf/UnshelveWithDialogAction.java | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/shelf/UnshelveWithDialogAction.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/shelf/UnshelveWithDialogAction.java index 24d9f60a0696..b065382d8880 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/shelf/UnshelveWithDialogAction.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/shelf/UnshelveWithDialogAction.java @@ -29,14 +29,12 @@ import com.intellij.openapi.vcs.VcsDataKeys; import com.intellij.openapi.vcs.changes.Change; import com.intellij.openapi.vcs.changes.ChangeListManager; import com.intellij.openapi.vcs.changes.patch.ApplyPatchDifferentiatedDialog; -import com.intellij.openapi.vcs.changes.patch.ApplyPatchExecutor; import com.intellij.openapi.vcs.changes.patch.ApplyPatchMode; import com.intellij.openapi.vcs.changes.patch.UnshelvePatchDefaultExecutor; import com.intellij.openapi.vcs.changes.ui.ChangeListChooser; import com.intellij.openapi.vcs.ui.VcsBalloonProblemNotifier; import com.intellij.openapi.vfs.LocalFileSystem; import com.intellij.openapi.vfs.VirtualFile; -import com.intellij.util.Function; import com.intellij.util.ObjectUtils; import com.intellij.util.containers.ContainerUtil; import org.jetbrains.annotations.NotNull; @@ -73,13 +71,9 @@ public class UnshelveWithDialogAction extends DumbAwareAction { VcsBalloonProblemNotifier.showOverChangesView(project, "Can not find path file", MessageType.ERROR); return; } + virtualFile.refresh(false, false); List binaryShelvedPatches = - ContainerUtil.map(changeList.getBinaryFiles(), new Function() { - @Override - public ShelvedBinaryFilePatch fun(ShelvedBinaryFile file) { - return new ShelvedBinaryFilePatch(file); - } - }); + ContainerUtil.map(changeList.getBinaryFiles(), ShelvedBinaryFilePatch::new); final ApplyPatchDifferentiatedDialog dialog = new MyUnshelveDialog(project, virtualFile, changeList, binaryShelvedPatches, e.getData(VcsDataKeys.CHANGES)); dialog.setHelpId("reference.dialogs.vcs.unshelve"); @@ -138,7 +132,7 @@ public class UnshelveWithDialogAction extends DumbAwareAction { @NotNull List binaryShelvedPatches, @Nullable Change[] preselectedChanges) { super(project, new UnshelvePatchDefaultExecutor(project, changeList, binaryShelvedPatches), - Collections.emptyList(), ApplyPatchMode.UNSHELVE, + Collections.emptyList(), ApplyPatchMode.UNSHELVE, patchFile, null, getPredefinedChangeList(changeList.DESCRIPTION, ChangeListManager.getInstance(project)), binaryShelvedPatches, hasNotAllSelectedChanges(project, changeList, preselectedChanges) ? newArrayList(preselectedChanges) : null, changeList.DESCRIPTION, true);