diff options
author | cletavernie | 2012-06-13 08:53:22 +0000 |
---|---|---|
committer | cletavernie | 2012-06-13 08:53:22 +0000 |
commit | 81d6244e1c86ef5a6e8d93d6e63c6091599a7254 (patch) | |
tree | aa4d2462012c02a689f6e64e076ebb0bb42761c3 /plugins/team | |
parent | bc047e0402c07e33702afb0e379664d5fa069cc0 (diff) | |
download | org.eclipse.papyrus-81d6244e1c86ef5a6e8d93d6e63c6091599a7254.tar.gz org.eclipse.papyrus-81d6244e1c86ef5a6e8d93d6e63c6091599a7254.tar.xz org.eclipse.papyrus-81d6244e1c86ef5a6e8d93d6e63c6091599a7254.zip |
382467: [Team] The dependency from Papyrus to SVN should be optional
https://bugs.eclipse.org/bugs/show_bug.cgi?id=382467
Diffstat (limited to 'plugins/team')
-rw-r--r-- | plugins/team/org.eclipse.papyrus.team.svn/META-INF/MANIFEST.MF | 4 | ||||
-rw-r--r-- | plugins/team/org.eclipse.papyrus.team.svn/src/org/eclipse/papyrus/team/svn/SVNLockHandler.java | 19 |
2 files changed, 20 insertions, 3 deletions
diff --git a/plugins/team/org.eclipse.papyrus.team.svn/META-INF/MANIFEST.MF b/plugins/team/org.eclipse.papyrus.team.svn/META-INF/MANIFEST.MF index 29828a5eff4..c0267068ea7 100644 --- a/plugins/team/org.eclipse.papyrus.team.svn/META-INF/MANIFEST.MF +++ b/plugins/team/org.eclipse.papyrus.team.svn/META-INF/MANIFEST.MF @@ -1,9 +1,9 @@ Manifest-Version: 1.0
Require-Bundle: org.eclipse.papyrus.infra.onefile;bundle-version="0.9.0",
- org.eclipse.team.svn.ui,
+ org.eclipse.team.svn.ui;resolution:=optional,
org.eclipse.gmf.runtime.common.core,
org.eclipse.emf.ecore,
- org.eclipse.team.svn.core,
+ org.eclipse.team.svn.core;resolution:=optional,
org.eclipse.papyrus.infra.emf.readonly;bundle-version="0.9.0",
org.eclipse.papyrus.infra.gmfdiag.commands;bundle-version="0.9.0"
Export-Package: org.eclipse.papyrus.team.svn
diff --git a/plugins/team/org.eclipse.papyrus.team.svn/src/org/eclipse/papyrus/team/svn/SVNLockHandler.java b/plugins/team/org.eclipse.papyrus.team.svn/src/org/eclipse/papyrus/team/svn/SVNLockHandler.java index 12e5b9db7e9..50366a8e7ac 100644 --- a/plugins/team/org.eclipse.papyrus.team.svn/src/org/eclipse/papyrus/team/svn/SVNLockHandler.java +++ b/plugins/team/org.eclipse.papyrus.team.svn/src/org/eclipse/papyrus/team/svn/SVNLockHandler.java @@ -9,6 +9,7 @@ *
* Contributors:
* Mathieu Velten (Atos Origin) mathieu.velten@atosorigin.com - Initial API and implementation
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Made the dependency to SVN optional
*
*****************************************************************************/
package org.eclipse.papyrus.team.svn;
@@ -25,9 +26,22 @@ import org.eclipse.team.svn.ui.SVNTeamModificationValidator; public class SVNLockHandler implements IReadOnlyHandler {
- SVNTeamModificationValidator validator = new SVNTeamModificationValidator();
+ SVNTeamModificationValidator validator;
+
+ public SVNLockHandler() {
+ try {
+ validator = new SVNTeamModificationValidator();
+ } catch (NoClassDefFoundError ex) {
+ System.out.println("Ignore SVN");
+ //If SVN is not installed, then the file is not locked, and can be written.
+ }
+
+ }
public boolean isReadOnly(IFile[] files) {
+ if(validator == null) {
+ return false; //SVN is not installed
+ }
IResource[] needsLockResources = FileUtility.filterResources(files, IStateFilter.SF_NEEDS_LOCK, IResource.DEPTH_ZERO);
for(IResource needsLockResource : needsLockResources) {
@@ -40,6 +54,9 @@ public class SVNLockHandler implements IReadOnlyHandler { }
public boolean enableWrite(IFile[] files) {
+ if(validator == null) {
+ return true; //SVN is not installed
+ }
IStatus result = validator.validateEdit(files, FileModificationValidationContext.VALIDATE_PROMPT);
|