diff options
author | Michael Valenta | 2003-10-17 19:00:21 +0000 |
---|---|---|
committer | Michael Valenta | 2003-10-17 19:00:21 +0000 |
commit | 13c741d6ec38d2d938dbafa8e482c86a5bb73dfa (patch) | |
tree | 4cda76b6773b857811358e58d8f22107b30ceea1 | |
parent | 891bec1119d1629c3414d062dd77bb0ea2e41b1a (diff) | |
download | eclipse.platform.team-13c741d6ec38d2d938dbafa8e482c86a5bb73dfa.tar.gz eclipse.platform.team-13c741d6ec38d2d938dbafa8e482c86a5bb73dfa.tar.xz eclipse.platform.team-13c741d6ec38d2d938dbafa8e482c86a5bb73dfa.zip |
41883: [Live Sync View] After crash, some outgoing additions don't appear
-rw-r--r-- | bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSProviderPlugin.java | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSProviderPlugin.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSProviderPlugin.java index 0ae33a9c2..dbe768ddc 100644 --- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSProviderPlugin.java +++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSProviderPlugin.java @@ -126,6 +126,10 @@ public class CVSProviderPlugin extends Plugin { */ private static final String NATURE_ID = ID + ".cvsnature"; //$NON-NLS-1$ + // File used to idicate if the workbench was shut down properly or not + private static final String CRASH_INDICATION_FILE = ".crash"; //$NON-NLS-1$ + private boolean crash; + public synchronized CVSWorkspaceSubscriber getCVSWorkspaceSubscriber() { if (cvsWorkspaceSubscriber == null) { cvsWorkspaceSubscriber = new CVSWorkspaceSubscriber( @@ -307,6 +311,7 @@ public class CVSProviderPlugin extends Plugin { // load the state which includes the known repositories loadState(); + crash = createCrashFile(); // Initialize CVS change listeners. Note tha the report type is important. IWorkspace workspace = ResourcesPlugin.getWorkspace(); @@ -344,6 +349,8 @@ public class CVSProviderPlugin extends Plugin { workspace.removeSaveParticipant(this); RemoteContentsCache.disableCache(ID); + + deleteCrashFile(); } /** @@ -729,4 +736,33 @@ public class CVSProviderPlugin extends Plugin { public void setDebugProtocol(boolean value) { Policy.DEBUG_CVS_PROTOCOL = value; } + + /* + * Create the crash indicator file. This method returns true if the file + * already existed, indicating that a crash occurred on the last invokation of + * the platform. + */ + private boolean createCrashFile() { + IPath pluginStateLocation = CVSProviderPlugin.getPlugin().getStateLocation(); + File crashFile = pluginStateLocation.append(CRASH_INDICATION_FILE).toFile(); + if (crashFile.exists()) { + return true; + } + try { + crashFile.createNewFile(); + } catch (IOException e) { + CVSProviderPlugin.log(IStatus.ERROR, e.getMessage(), e); + } + return false; + } + + private void deleteCrashFile() { + IPath pluginStateLocation = CVSProviderPlugin.getPlugin().getStateLocation(); + File crashFile = pluginStateLocation.append(CRASH_INDICATION_FILE).toFile(); + crashFile.delete(); + } + + public boolean crashOnLastRun() { + return crash; + } } |