[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Bug 279 fix proposal

From: Martin Letenay <mle_at_whitestein.com>
Date: 2005-06-10 10:44:56 CEST

Hi All,
 
I've just joined the project and as a start I've took a look at some
reported bugs whether I can fix some.
So I've picked this one:
http://subclipse.tigris.org/issues/show_bug.cgi?id=279 - Dir not decorated
when file is deleted
 
The problem is that when a resource stored in svn is being deleted, to mark
parent directories as dirty,
the resource cannot be deleted directly but rather turned into "phantom".
(See Resoure#deleteResource)
 
The Resource#synchronizing(boolean) is checked wheter it can be turned into
phantom, which futher checks for presence of non-empty getSyncInfo().
And there lies the problem, the syncInfo is always empty.
 
I've tried to trace it down where it might get set and have found that
PersistantResourceVariantByteStore#setBytes is the only reasonable place
being used.
 
However the SVNWorkspaceSubscriber does not use this
PersistantResourceVariantByteStore but rather
SessionResourceVariantByteStore which does not
maintain the resource's syncInfo.
 
When I replaced the remoteSyncStateStore in SVNWorkspaceSubscriber with
PersistantResourceVariantByteStore everything starts to work as expected,
when file is deleted, it is converted into phantom and parent resources are
marked as dirty ...
 
However I have absolutely no idea about other potential (negative)
consequences of replacing SessionResourceVariantByteStore with
PersistantResourceVariantByteStore,
my knowledge of eclipse platform is very limited here ...
 
Could you guys take a closer look whether such fix makes sense ?
 
Regards,
Martin
 
 
Patch proposal:
 
 
Index:
src/org/tigris/subversion/subclipse/core/sync/SVNWorkspaceSubscriber.java
===================================================================
---
src/org/tigris/subversion/subclipse/core/sync/SVNWorkspaceSubscriber.java
(revision 1367)
+++
src/org/tigris/subversion/subclipse/core/sync/SVNWorkspaceSubscriber.java
(working copy)
@@ -32,6 +32,7 @@
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.MultiStatus;
import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.QualifiedName;
import org.eclipse.core.runtime.Status;
import org.eclipse.team.core.RepositoryProvider;
import org.eclipse.team.core.TeamException;
@@ -41,8 +42,8 @@
import org.eclipse.team.core.subscribers.SubscriberChangeEvent;
import org.eclipse.team.core.synchronize.SyncInfo;
import org.eclipse.team.core.variants.IResourceVariantComparator;
+import org.eclipse.team.core.variants.PersistantResourceVariantByteStore;
import org.eclipse.team.core.variants.ResourceVariantByteStore;
-import org.eclipse.team.core.variants.SessionResourceVariantByteStore;
import org.eclipse.team.internal.core.TeamPlugin;
import org.tigris.subversion.subclipse.core.IResourceStateChangeListener;
import org.tigris.subversion.subclipse.core.ISVNLocalResource;
@@ -76,7 +77,7 @@
 
 protected SVNRevisionComparator comparator = new SVNRevisionComparator();
 
- protected ResourceVariantByteStore remoteSyncStateStore = new
SessionResourceVariantByteStore();
+ protected ResourceVariantByteStore remoteSyncStateStore = new
PersistantResourceVariantByteStore(new QualifiedName(SVNProviderPlugin.ID,
"workspaceSubscriber"));
 
 public SVNWorkspaceSubscriber() {
     SVNProviderPlugin.addResourceStateChangeListener(this);
 
 
Received on Fri Jun 10 18:44:56 2005

This is an archived mail posted to the Subclipse Dev mailing list.