[jbosstools-commits] JBoss Tools SVN: r39341 - branches/jbosstools-3.3.0.Beta1/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour.

jbosstools-commits at lists.jboss.org jbosstools-commits at lists.jboss.org
Wed Mar 7 10:37:43 EST 2012


Author: rob.stryker at jboss.com
Date: 2012-03-07 10:37:42 -0500 (Wed, 07 Mar 2012)
New Revision: 39341

Modified:
   branches/jbosstools-3.3.0.Beta1/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressPublishMethod.java
Log:
JBIDE-11166 to beta1 branch, slim patch

Modified: branches/jbosstools-3.3.0.Beta1/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressPublishMethod.java
===================================================================
--- branches/jbosstools-3.3.0.Beta1/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressPublishMethod.java	2012-03-07 15:12:24 UTC (rev 39340)
+++ branches/jbosstools-3.3.0.Beta1/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressPublishMethod.java	2012-03-07 15:37:42 UTC (rev 39341)
@@ -100,7 +100,12 @@
 		if( module.length > 1 )
 			return 0;
 		
+		// Magic Project
 		String destProjName = ExpressServerUtils.getExpressDeployProject(behaviour.getServer());
+		
+		if( isInDestProjectTree(destProjName, module))
+			return IServer.PUBLISH_STATE_NONE;
+		
 		IProject destProj = ResourcesPlugin.getWorkspace().getRoot().getProject(destProjName);
 		
 		if( destProj.equals(module[module.length-1].getProject()))
@@ -138,6 +143,19 @@
 		}
 		return 0;
 	}
+	
+	protected boolean isInDestProjectTree(String magicProject, IModule[] module) {
+		IProject magic = magicProject == null ? null : 
+			ResourcesPlugin.getWorkspace().getRoot().getProject(magicProject);
+		IProject moduleProject = module == null ? null : module.length == 0 ? null : module[module.length-1].getProject();
+		if( magic == null || moduleProject == null )
+			return false;
+		
+		IPath moduleProjectRoot = moduleProject.getLocation();
+		IPath magicProjectRoot = magic.getLocation();
+		boolean ret = magicProjectRoot.isPrefixOf(moduleProjectRoot);
+		return ret;
+	}
 
 	protected PushOperationResult commitAndPushProject(IProject p,
 			DeployableServerBehavior behaviour, IProgressMonitor monitor) throws CoreException {



More information about the jbosstools-commits mailing list