mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-55339 SVN: java.io.IOException: The requested operation cannot be performed on a file with a user-mapped section open
(cherry picked from commit 8a0eb8e7ffde34ddf63e61aa63d17e7bc2c9f932)
This commit is contained in:
@@ -372,6 +372,7 @@ public class SvnVcs extends AbstractVcs<CommittedChangeList> {
|
||||
|
||||
myAuthNotifier.init();
|
||||
mySvnBranchPointsCalculator = new SvnBranchPointsCalculator(myProject);
|
||||
mySvnBranchPointsCalculator.activate();
|
||||
|
||||
// do one time after project loaded
|
||||
StartupManager.getInstance(myProject).runWhenProjectIsInitialized(new DumbAwareRunnable() {
|
||||
@@ -474,6 +475,7 @@ public class SvnVcs extends AbstractVcs<CommittedChangeList> {
|
||||
myAuthNotifier.stop();
|
||||
myAuthNotifier.clear();
|
||||
|
||||
mySvnBranchPointsCalculator.deactivate();
|
||||
mySvnBranchPointsCalculator = null;
|
||||
myWorkingCopiesContent.deactivate();
|
||||
}
|
||||
|
||||
@@ -43,21 +43,25 @@ import java.util.*;
|
||||
|
||||
public class SvnBranchPointsCalculator {
|
||||
private static final Logger LOG = Logger.getInstance("#org.jetbrains.idea.svn.dialogs.SvnBranchPointsCalculator");
|
||||
private final FactsCalculator<KeyData, WrapperInvertor<BranchCopyData>> myCalculator;
|
||||
|
||||
private FactsCalculator<KeyData, WrapperInvertor<BranchCopyData>> myCalculator;
|
||||
private PersistentHolder myPersistentHolder;
|
||||
private File myFile;
|
||||
private final Project myProject;
|
||||
|
||||
public SvnBranchPointsCalculator(final Project project) {
|
||||
myProject = project;
|
||||
final File vcs = new File(PathManager.getSystemPath(), "vcs");
|
||||
File file = new File(vcs, "svn_copy_sources");
|
||||
file.mkdirs();
|
||||
file = new File(file, project.getLocationHash());
|
||||
myFile = file;
|
||||
myFile = new File(file, project.getLocationHash());
|
||||
}
|
||||
|
||||
// todo when will it die?
|
||||
public void activate() {
|
||||
ValueHolder<WrapperInvertor<BranchCopyData>, KeyData> cache = null;
|
||||
|
||||
try {
|
||||
myPersistentHolder = new PersistentHolder(file);
|
||||
myPersistentHolder = new PersistentHolder(myFile);
|
||||
cache = new ValueHolder<WrapperInvertor<BranchCopyData>, KeyData>() {
|
||||
public WrapperInvertor<BranchCopyData> getValue(KeyData dataHolder) {
|
||||
try {
|
||||
@@ -93,7 +97,13 @@ public class SvnBranchPointsCalculator {
|
||||
};
|
||||
}
|
||||
|
||||
myCalculator = new FactsCalculator<KeyData, WrapperInvertor<BranchCopyData>>(project, "Looking for branch origin", cache, new Loader(project));
|
||||
myCalculator = new FactsCalculator<KeyData, WrapperInvertor<BranchCopyData>>(myProject, "Looking for branch origin", cache, new Loader(myProject));
|
||||
}
|
||||
|
||||
public void deactivate() {
|
||||
myPersistentHolder.close();
|
||||
myCalculator = null;
|
||||
myPersistentHolder = null;
|
||||
}
|
||||
|
||||
private static class BranchDataExternalizer implements DataExternalizer<TreeMap<String,BranchCopyData>> {
|
||||
@@ -193,6 +203,15 @@ public class SvnBranchPointsCalculator {
|
||||
}
|
||||
}
|
||||
|
||||
public void close() {
|
||||
try {
|
||||
myPersistentMap.close();
|
||||
}
|
||||
catch (IOException e) {
|
||||
LOG.info(e);
|
||||
}
|
||||
}
|
||||
|
||||
public void put(final String uid, final String target, final BranchCopyData data) throws IOException {
|
||||
// todo - rewrite of rather big piece; consider rewriting
|
||||
synchronized (myLock) {
|
||||
|
||||
Reference in New Issue
Block a user