mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[shelf]: Store shelf paths only in system Independent way
This commit is contained in:
+2
-2
@@ -196,7 +196,7 @@ public class ShelveChangesManager extends AbstractProjectComponent implements JD
|
||||
File newPatchFile = getPatchFileInConfigDir(targetDirectory);
|
||||
try {
|
||||
FileUtil.copy(patchFile, newPatchFile);
|
||||
list.PATH = newPatchFile.getPath();
|
||||
list.PATH = FileUtil.toSystemIndependentName(newPatchFile.getPath());
|
||||
FileUtil.delete(patchFile);
|
||||
}
|
||||
catch (IOException e) {
|
||||
@@ -211,7 +211,7 @@ public class ShelveChangesManager extends AbstractProjectComponent implements JD
|
||||
File newShelvedFile = new File(targetDirectory, PathUtil.getFileName(file.AFTER_PATH));
|
||||
try {
|
||||
FileUtil.copy(shelvedFile, newShelvedFile);
|
||||
file.SHELVED_PATH = newShelvedFile.getPath();
|
||||
file.SHELVED_PATH = FileUtil.toSystemIndependentName(newShelvedFile.getPath());
|
||||
FileUtil.delete(shelvedFile);
|
||||
}
|
||||
catch (IOException e) {
|
||||
|
||||
@@ -21,6 +21,7 @@ import com.intellij.openapi.util.DefaultJDOMExternalizer;
|
||||
import com.intellij.openapi.util.InvalidDataException;
|
||||
import com.intellij.openapi.util.JDOMExternalizable;
|
||||
import com.intellij.openapi.util.WriteExternalException;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.vcs.FilePath;
|
||||
import com.intellij.openapi.vcs.FileStatus;
|
||||
import com.intellij.openapi.vcs.VcsBundle;
|
||||
@@ -49,9 +50,14 @@ public class ShelvedBinaryFile implements JDOMExternalizable {
|
||||
|
||||
public ShelvedBinaryFile(final String beforePath, final String afterPath, @Nullable final String shelvedPath) {
|
||||
assert beforePath != null || afterPath != null;
|
||||
BEFORE_PATH = beforePath;
|
||||
AFTER_PATH = afterPath;
|
||||
SHELVED_PATH = shelvedPath;
|
||||
BEFORE_PATH = convertToSystemIndependent(beforePath);
|
||||
AFTER_PATH = convertToSystemIndependent(afterPath);
|
||||
SHELVED_PATH = convertToSystemIndependent(shelvedPath);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private String convertToSystemIndependent(@Nullable String beforePath) {
|
||||
return beforePath != null ? FileUtil.toSystemIndependentName(beforePath) : null;
|
||||
}
|
||||
|
||||
public void readExternal(Element element) throws InvalidDataException {
|
||||
|
||||
@@ -31,6 +31,7 @@ import com.intellij.openapi.util.DefaultJDOMExternalizer;
|
||||
import com.intellij.openapi.util.InvalidDataException;
|
||||
import com.intellij.openapi.util.JDOMExternalizable;
|
||||
import com.intellij.openapi.util.WriteExternalException;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.vcs.FileStatus;
|
||||
import org.jdom.Element;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
@@ -65,7 +66,7 @@ public class ShelvedChangeList implements JDOMExternalizable, ExternalizableSche
|
||||
}
|
||||
|
||||
public ShelvedChangeList(final String path, final String description, final List<ShelvedBinaryFile> binaryFiles, final long time) {
|
||||
PATH = path;
|
||||
PATH = FileUtil.toSystemIndependentName(path);
|
||||
DESCRIPTION = description;
|
||||
DATE = new Date(time);
|
||||
myBinaryFiles = binaryFiles;
|
||||
|
||||
Reference in New Issue
Block a user