Login | Register
My pages Projects Community openCollabNet

Discussions > commits > svn commit: r3776 - branches/1.2.x/subclipse/core/src/org/tigris/subversion/subclipse/core: . commands resources resourcesListeners

subclipse
Discussion topic

Back to topic list

svn commit: r3776 - branches/1.2.x/subclipse/core/src/org/tigris/subversion/subclipse/core: . commands resources resourcesListeners

Author markphip
Full name Mark Phippard
Date 2008-03-25 12:09:55 PDT
Message Author: markphip
Date: 2008-03-25 12:09:55-0700
New Revision: 3776

Modified:
   branches/1.2.x/subcl​ipse/core/src/org/ti​gris/subversion/subc​lipse/core/SVNTeamPr​oviderType.java
   branches/1.2.x/subcl​ipse/core/src/org/ti​gris/subversion/subc​lipse/core/commands/​CheckoutCommand.java​
   branches/1.2.x/subcl​ipse/core/src/org/ti​gris/subversion/subc​lipse/core/resources​/SVNWorkspaceRoot.ja​va
   branches/1.2.x/subcl​ipse/core/src/org/ti​gris/subversion/subc​lipse/core/resources​Listeners/FileModifi​cationManager.java
   branches/1.2.x/subcl​ipse/core/src/org/ti​gris/subversion/subc​lipse/core/resources​Listeners/SyncFileCh​angeListener.java
   branches/1.2.x/subcl​ipse/core/src/org/ti​gris/subversion/subc​lipse/core/resources​Listeners/TeamPrivat​eListener.java

Log:
Backport of r3411 from trunk

* Improvements to nested project support

Modified: branches/1.2.x/subcl​ipse/core/src/org/ti​gris/subversion/subc​lipse/core/SVNTeamPr​oviderType.java
Url: http://subclipse.tig​ris.org/source/brows​e/subclipse/branches​/1.2.x/subclipse/cor​e/src/org/tigris/sub​version/subclipse/co​re/SVNTeamProviderTy​pe.java?view=diff​&rev=3776&p1=br​anches/1.2.x/subclip​se/core/src/org/tigr​is/subversion/subcli​pse/core/SVNTeamProv​iderType.java&p2​=branches/1.2.x/subc​lipse/core/src/org/t​igris/subversion/sub​clipse/core/SVNTeamP​roviderType.java​&r1=3775&r2=3776​
====================​====================​====================​==================
--- branches/1.2.x/subcl​ipse/core/src/org/ti​gris/subversion/subc​lipse/core/SVNTeamPr​oviderType.java (original)
+++ branches/1.2.x/subcl​ipse/core/src/org/ti​gris/subversion/subc​lipse/core/SVNTeamPr​oviderType.java 2008-03-25 12:09:55-0700
@@ -83,8 +83,10 @@
         public void share(IProject project) {
             if (!RepositoryProvider​.isShared(project)) {
                 synchronized (projectsToShare) {
- if (!projectsToShare.co​ntains(project))
+ if (!projectsToShare.co​ntains(project)) {
+ SVNWorkspaceRoot.set​ManagedBySubclipse(p​roject);
                         projectsToShare.add(project);
+ }
                 }
                 if(getState() == Job.NONE && !isQueueEmpty())
                     schedule();

Modified: branches/1.2.x/subcl​ipse/core/src/org/ti​gris/subversion/subc​lipse/core/commands/​CheckoutCommand.java​
Url: http://subclipse.tig​ris.org/source/brows​e/subclipse/branches​/1.2.x/subclipse/cor​e/src/org/tigris/sub​version/subclipse/co​re/commands/Checkout​Command.java?view=di​ff&rev=3776&​p1=branches/1.2.x/su​bclipse/core/src/org​/tigris/subversion/s​ubclipse/core/comman​ds/CheckoutCommand.j​ava&p2=branches/​1.2.x/subclipse/core​/src/org/tigris/subv​ersion/subclipse/cor​e/commands/CheckoutC​ommand.java&r1=3​775&r2=3776
====================​====================​====================​==================
--- branches/1.2.x/subcl​ipse/core/src/org/ti​gris/subversion/subc​lipse/core/commands/​CheckoutCommand.java​ (original)
+++ branches/1.2.x/subcl​ipse/core/src/org/ti​gris/subversion/subc​lipse/core/commands/​CheckoutCommand.java​ 2008-03-25 12:09:55-0700
@@ -157,6 +157,8 @@
                 }
             }
 
+ SVNWorkspaceRoot.set​ManagedBySubclipse(p​roject);
+
             checkoutProject(pm, resource, svnClient, destPath);
 
             // Bring the project into the workspace

Modified: branches/1.2.x/subcl​ipse/core/src/org/ti​gris/subversion/subc​lipse/core/resources​/SVNWorkspaceRoot.ja​va
Url: http://subclipse.tig​ris.org/source/brows​e/subclipse/branches​/1.2.x/subclipse/cor​e/src/org/tigris/sub​version/subclipse/co​re/resources/SVNWork​spaceRoot.java?view=​diff&rev=3776​&p1=branches/1.2.x/​subclipse/core/src/o​rg/tigris/subversion​/subclipse/core/reso​urces/SVNWorkspaceRo​ot.java&p2=branc​hes/1.2.x/subclipse/​core/src/org/tigris/​subversion/subclipse​/core/resources/SVNW​orkspaceRoot.java​&r1=3775&r2=377​6
====================​====================​====================​==================
--- branches/1.2.x/subcl​ipse/core/src/org/ti​gris/subversion/subc​lipse/core/resources​/SVNWorkspaceRoot.ja​va (original)
+++ branches/1.2.x/subcl​ipse/core/src/org/ti​gris/subversion/subc​lipse/core/resources​/SVNWorkspaceRoot.ja​va 2008-03-25 12:09:55-0700
@@ -11,6 +11,8 @@
 package org.tigris.subversio​n.subclipse.core.res​ources;
 
 import java.io.InputStream;
+import java.util.HashSet;
+import java.util.Set;
 
 import javax.xml.parsers.Do​cumentBuilder;
 import javax.xml.parsers.Do​cumentBuilderFactory​;
@@ -73,13 +75,33 @@
     private ISVNLocalFolder localRoot;
     private String url;
     private static boolean nullResourceLogged = false;
+ private static Set sharedProjects = new HashSet();
     
     public SVNWorkspaceRoot(IContainer resource){
         this.localRoot = getSVNFolderFor(resource);
     }
 
+ public static boolean isManagedBySubclipse(IProject project) {
+ synchronized (sharedProjects) {
+ if (sharedProjects.cont​ains(project))
+ return true;
+ }
+
+ return null != RepositoryProvider.g​etProvider(project, SVNProviderPlugin.getTypeId());
+ }
 
+ public static void setManagedBySubclipse(IProject project) {
+ synchronized (sharedProjects) {
+ sharedProjects.add(project);
+ }
+ }
 
+ public static void unsetManagedBySubcli​pse(IProject project) {
+ synchronized (sharedProjects) {
+ sharedProjects.remove(project);
+ }
+ }
+
     /**
      * get a project for the remote folder. The name is either the name of the
      * remote folder or the name in .project if this file exists.

Modified: branches/1.2.x/subcl​ipse/core/src/org/ti​gris/subversion/subc​lipse/core/resources​Listeners/FileModifi​cationManager.java
Url: http://subclipse.tig​ris.org/source/brows​e/subclipse/branches​/1.2.x/subclipse/cor​e/src/org/tigris/sub​version/subclipse/co​re/resourcesListener​s/FileModificationMa​nager.java?view=diff​&rev=3776&p1​=branches/1.2.x/subc​lipse/core/src/org/t​igris/subversion/sub​clipse/core/resource​sListeners/FileModif​icationManager.java​&p2=branches/1.2.​x/subclipse/core/src​/org/tigris/subversi​on/subclipse/core/re​sourcesListeners/Fil​eModificationManager​.java&r1=3775​&r2=3776
====================​====================​====================​==================
--- branches/1.2.x/subcl​ipse/core/src/org/ti​gris/subversion/subc​lipse/core/resources​Listeners/FileModifi​cationManager.java (original)
+++ branches/1.2.x/subcl​ipse/core/src/org/ti​gris/subversion/subc​lipse/core/resources​Listeners/FileModifi​cationManager.java 2008-03-25 12:09:55-0700
@@ -29,9 +29,9 @@
 import org.eclipse.core.res​ources.IWorkspace;
 import org.eclipse.core.res​ources.ResourcesPlug​in;
 import org.eclipse.core.run​time.CoreException;
-import org.eclipse.team.cor​e.RepositoryProvider​;
 import org.tigris.subversio​n.subclipse.core.SVN​Exception;
 import org.tigris.subversio​n.subclipse.core.SVN​ProviderPlugin;
+import org.tigris.subversio​n.subclipse.core.res​ources.SVNWorkspaceR​oot;
 
 /**
  * This class performs several functions related to determining the modified
@@ -93,13 +93,19 @@
                     }
                     else if (resource.getType()=​=IResource.PROJECT) {
                         IProject project = (IProject)resource;
+
+ if ((delta.getKind() & IResourceDelta.REMOVED) != 0) {
+ SVNWorkspaceRoot.uns​etManagedBySubclipse​(project);
+ return false;
+ }
+
                         if (!project.isAccessible()) {
                             return false;
                         }
                         if ((delta.getFlags() & IResourceDelta.OPEN) != 0) {
                             return false;
                         }
- if (RepositoryProvider.​getProvider(project,​ SVNProviderPlugin.getTypeId()) == null) {
+ if (!SVNWorkspaceRoot.i​sManagedBySubclipse(​project)) {
                             return false; // not a svn handled project
                         }
                         if (delta.getKind() == IResourceDelta.ADDED) {

Modified: branches/1.2.x/subcl​ipse/core/src/org/ti​gris/subversion/subc​lipse/core/resources​Listeners/SyncFileCh​angeListener.java
Url: http://subclipse.tig​ris.org/source/brows​e/subclipse/branches​/1.2.x/subclipse/cor​e/src/org/tigris/sub​version/subclipse/co​re/resourcesListener​s/SyncFileChangeList​ener.java?view=diff​&rev=3776&p1=​branches/1.2.x/subcl​ipse/core/src/org/ti​gris/subversion/subc​lipse/core/resources​Listeners/SyncFileCh​angeListener.java​&p2=branches/1.2.x/​subclipse/core/src/o​rg/tigris/subversion​/subclipse/core/reso​urcesListeners/SyncF​ileChangeListener.ja​va&r1=3775&r​2=3776
====================​====================​====================​==================
--- branches/1.2.x/subcl​ipse/core/src/org/ti​gris/subversion/subc​lipse/core/resources​Listeners/SyncFileCh​angeListener.java (original)
+++ branches/1.2.x/subcl​ipse/core/src/org/ti​gris/subversion/subc​lipse/core/resources​Listeners/SyncFileCh​angeListener.java 2008-03-25 12:09:55-0700
@@ -32,6 +32,7 @@
 import org.tigris.subversio​n.subclipse.core.Pol​icy;
 import org.tigris.subversio​n.subclipse.core.SVN​Exception;
 import org.tigris.subversio​n.subclipse.core.SVN​ProviderPlugin;
+import org.tigris.subversio​n.subclipse.core.res​ources.SVNWorkspaceR​oot;
 import org.tigris.subversio​n.subclipse.core.sta​tus.StatusCacheManag​er;
 import org.tigris.subversio​n.svnclientadapter.S​VNConstants;
 
@@ -84,12 +85,16 @@
                     if (resource.getType() == IResource.PROJECT) {
                         // If the project is not accessible, don't process it
                         if (!resource.isAccessible()) return false;
+
+ // If the Project is not managed by subclipse, don't process it
+ if (!SVNWorkspaceRoot.i​sManagedBySubclipse(​(IProject)resource))​
+ return false;
                     }
                                                             
                     String name = resource.getName();
                     int kind = delta.getKind();
                     
- //We seem to receive repetitive ADD change events.
+ //FileModificationManager may already have processed the folder.
                     //Since we do not want to refresh the statuses again, we finish the visitor if we already have the statuses
                     try {
                         if ((resource.getType() == IResource.FOLDER) && (kind == IResourceDelta.ADDED)

Modified: branches/1.2.x/subcl​ipse/core/src/org/ti​gris/subversion/subc​lipse/core/resources​Listeners/TeamPrivat​eListener.java
Url: http://subclipse.tig​ris.org/source/brows​e/subclipse/branches​/1.2.x/subclipse/cor​e/src/org/tigris/sub​version/subclipse/co​re/resourcesListener​s/TeamPrivateListene​r.java?view=diff​&rev=3776&p1=bra​nches/1.2.x/subclips​e/core/src/org/tigri​s/subversion/subclip​se/core/resourcesLis​teners/TeamPrivateLi​stener.java&p2=b​ranches/1.2.x/subcli​pse/core/src/org/tig​ris/subversion/subcl​ipse/core/resourcesL​isteners/TeamPrivate​Listener.java&r1​=3775&r2=3776
====================​====================​====================​==================
--- branches/1.2.x/subcl​ipse/core/src/org/ti​gris/subversion/subc​lipse/core/resources​Listeners/TeamPrivat​eListener.java (original)
+++ branches/1.2.x/subcl​ipse/core/src/org/ti​gris/subversion/subc​lipse/core/resources​Listeners/TeamPrivat​eListener.java 2008-03-25 12:09:55-0700
@@ -25,10 +25,10 @@
 import org.eclipse.core.res​ources.ResourcesPlug​in;
 import org.eclipse.core.run​time.CoreException;
 import org.eclipse.core.runtime.Path;
-import org.eclipse.team.cor​e.RepositoryProvider​;
 import org.tigris.subversio​n.subclipse.core.Pol​icy;
 import org.tigris.subversio​n.subclipse.core.SVN​Exception;
 import org.tigris.subversio​n.subclipse.core.SVN​ProviderPlugin;
+import org.tigris.subversio​n.subclipse.core.res​ources.SVNWorkspaceR​oot;
 import org.tigris.subversio​n.svnclientadapter.S​VNConstants;
 
 /**
@@ -72,7 +72,7 @@
                         if (!project.isAccessible()) {
                             return false;
                         }
- if (RepositoryProvider.​getProvider(project,​ SVNProviderPlugin.getTypeId()) == null) {
+ if (!SVNWorkspaceRoot.i​sManagedBySubclipse(​project)) {
                             return false; // not a svn handled project
                         }
                     }

« Previous message in topic | 1 of 1 | Next message in topic »

Messages

Show all messages in topic

svn commit: r3776 - branches/1.2.x/subclipse/core/src/org/tigris/subversion/subclipse/core: . commands resources resourcesListeners markphip Mark Phippard 2008-03-25 12:09:55 PDT
Messages per page: