jcompagner
2011-08-23 08:48:27 UTC
Ok i tracked it down a bit the folders don't come up correctly because
isPhantom() returns false for those specific resources..
In StatusCacheManager :
private LocalResourceStatus getStatus(IResource resource,
StatusUpdateStrategy strategy, boolean getStatusFromSvn) throws
SVNException {
if (!resource.exists() && !resource.isPhantom())
{
return null;
}
for the specific folders that are not working, that if is true, and
for others that are working that if is false (because of isPhantom())
Also status cache a few lines below:
statusCache.getStatus(resource)
does return null so it is really not in there, but the thing is that
in RevertAction this piece of code:
for (int i = 0; i < resources.length; i++) {
IResource resource = resources[i];
ISVNLocalResource svnResource =
SVNWorkspaceRoot.getSVNResourceFor(resource);
// get adds, deletes, updates and property updates.
GetStatusCommand command = new GetStatusCommand(svnResource, true, false);
command.run(iProgressMonitor);
ISVNStatus[] statuses = command.getStatuses();
does return the 'deleted' status for all the files..
So i guess the underlying native svn client does know the correct
thing, but somehow that is synced wrong in the subclipse layer.
I looked a bit further and saw that in StatusCacheManager
public IResource[] refreshStatus(final IContainer resource, final
boolean recursive)
that is called by the FileModificationManager there is a difference
between a dir that works fine and a dir that doesn't work.
for a dir that works resourcesToRefresh is after the loop empty, but
for the dir that fails it still has that one dir.
List<IResource> refreshedResources = updateCache(resource,
strategy.statusesToUpdate(resource));
Set<IResource> resourcesToRefresh = resourcesToRefresh(resource,
depth, IContainer.INCLUDE_PHANTOMS, refreshedResources.size());
for (Iterator<IResource> iter = refreshedResources.iterator();
iter.hasNext();) {
resourcesToRefresh.remove(iter.next());
}
And that is because in refreshedResources it is listed as a File
instead of a Folder .. So the Folder in resourcesToRefresh is not
removed.
So i looked why it is a File instead of a Folder and i see the bug now:
SVNWorkspaceRoot
public static IResource getResourceFor(IResource parent, IPath location)
ends with:
if (!location.toFile().exists()) {
if (location.toFile().getName().indexOf(".") == -1) {
return root.getFolder(fullPath);
}
}
if (location.toFile().isDirectory()) {
return root.getFolder(fullPath);
}
return root.getFile(fullPath);
and my folder that goes wrong ends up all the way to return
root.getFile(fullPath); so it becomes a file
and that is because my folder has a '.' in the name!
and because of that it will not end up in:
if (location.toFile().getName().indexOf(".") == -1) {
return root.getFolder(fullPath);
}
that the one does that works.
why is that? What does it try to do? Why can't a foldername not have a
dot? All plugins of eclipse are folder names with dots...
So what i did to fix this was:
instead of
IResource resource = root.findMember(fullPath);
i also told eclipse to find the phantoms:
IResource resource = root.findMember(fullPath,true);
because that is what you want to have, you also want to get the
phantoms back, and then eclipse will return a Folder
http://subclipse.tigris.org/issues/show_bug.cgi?id=1297
http://subclipse.tigris.org/ds/viewMessage.do?dsForumId=1043&dsMessageId=2828655
To unsubscribe from this discussion, e-mail: [dev-***@subclipse.tigris.org].
isPhantom() returns false for those specific resources..
In StatusCacheManager :
private LocalResourceStatus getStatus(IResource resource,
StatusUpdateStrategy strategy, boolean getStatusFromSvn) throws
SVNException {
if (!resource.exists() && !resource.isPhantom())
{
return null;
}
for the specific folders that are not working, that if is true, and
for others that are working that if is false (because of isPhantom())
Also status cache a few lines below:
statusCache.getStatus(resource)
does return null so it is really not in there, but the thing is that
in RevertAction this piece of code:
for (int i = 0; i < resources.length; i++) {
IResource resource = resources[i];
ISVNLocalResource svnResource =
SVNWorkspaceRoot.getSVNResourceFor(resource);
// get adds, deletes, updates and property updates.
GetStatusCommand command = new GetStatusCommand(svnResource, true, false);
command.run(iProgressMonitor);
ISVNStatus[] statuses = command.getStatuses();
does return the 'deleted' status for all the files..
So i guess the underlying native svn client does know the correct
thing, but somehow that is synced wrong in the subclipse layer.
I looked a bit further and saw that in StatusCacheManager
public IResource[] refreshStatus(final IContainer resource, final
boolean recursive)
that is called by the FileModificationManager there is a difference
between a dir that works fine and a dir that doesn't work.
for a dir that works resourcesToRefresh is after the loop empty, but
for the dir that fails it still has that one dir.
List<IResource> refreshedResources = updateCache(resource,
strategy.statusesToUpdate(resource));
Set<IResource> resourcesToRefresh = resourcesToRefresh(resource,
depth, IContainer.INCLUDE_PHANTOMS, refreshedResources.size());
for (Iterator<IResource> iter = refreshedResources.iterator();
iter.hasNext();) {
resourcesToRefresh.remove(iter.next());
}
And that is because in refreshedResources it is listed as a File
instead of a Folder .. So the Folder in resourcesToRefresh is not
removed.
So i looked why it is a File instead of a Folder and i see the bug now:
SVNWorkspaceRoot
public static IResource getResourceFor(IResource parent, IPath location)
ends with:
if (!location.toFile().exists()) {
if (location.toFile().getName().indexOf(".") == -1) {
return root.getFolder(fullPath);
}
}
if (location.toFile().isDirectory()) {
return root.getFolder(fullPath);
}
return root.getFile(fullPath);
and my folder that goes wrong ends up all the way to return
root.getFile(fullPath); so it becomes a file
and that is because my folder has a '.' in the name!
and because of that it will not end up in:
if (location.toFile().getName().indexOf(".") == -1) {
return root.getFolder(fullPath);
}
that the one does that works.
why is that? What does it try to do? Why can't a foldername not have a
dot? All plugins of eclipse are folder names with dots...
So what i did to fix this was:
instead of
IResource resource = root.findMember(fullPath);
i also told eclipse to find the phantoms:
IResource resource = root.findMember(fullPath,true);
because that is what you want to have, you also want to get the
phantoms back, and then eclipse will return a Folder
http://subclipse.tigris.org/issues/show_bug.cgi?id=1297
1) Delete a folder
* Synch view shows the folder delete. However, it shows all of the children
of the deleted folder as incoming changes. Need a way to suppress this.
2) Commit the Delete
* Decorators in Package Explorer do not refresh
* Nothing is removed from Synch view
* Refreshing project does nothing
* Team > Cleanup does nothing.
Mark
Thanks
Mark Phippard
http://markphip.blogspot.com/
------------------------------------------------------* Synch view shows the folder delete. However, it shows all of the children
of the deleted folder as incoming changes. Need a way to suppress this.
2) Commit the Delete
* Decorators in Package Explorer do not refresh
* Nothing is removed from Synch view
* Refreshing project does nothing
* Team > Cleanup does nothing.
Mark
Hi Johan,
The main problem was that our move/delete hook (SVNMoveDeleteHook) was not
notifying the Eclipse resource tree that it had deleted the folder, so we
weren't seeing the deletion reflected in the workspace. I've committed a
fix for this, and also for the problem that was causing the Synchronize view
to not refresh after the deleted folder was committed. Does Cleanup resolve
the current problem with your working copy?
Thanks,
Steve
p.s.
We decided to always show Team->Upgrade and show an error message if it is
selected against a folder that has already been upgraded, rather than
disabling or not showing the option. This is to avoid the overhead of an
API call when the context menu is shown.
-----Original Message-----
Sent: Monday, August 22, 2011 3:14 AM
Subject: Re: [Subclipse-users] i can't delete folders (and commit them) in
Subclipse 1.7
hmm after a restart it is even worse, then Team->Revert on the project
also doesn't show up the deleted dirs.
And i don't see that weird synchronize view entry. So now it seems to be
completely gone..
!ENTRY org.tigris.subversion.subclipse.core 4 368 2011-08-22 12:11:50.139
!MESSAGE Resource
'/eclipse_target/ship_plugins/features/org.eclipse.dltk.core.servoy_3.0.0.201108041240'
does not exist.
!STACK 1
org.eclipse.core.internal.resources.ResourceException: Resource
'/eclipse_target/ship_plugins/features/org.eclipse.dltk.core.servoy_3.0.0.201108041240'
does not exist.
at
org.eclipse.core.internal.resources.Resource.checkExists(Resource.java:320)
at
org.eclipse.core.internal.resources.Resource.checkAccessible(Resource.java:194)
at
org.eclipse.core.internal.resources.Synchronizer.setSyncInfo(Synchronizer.java:244)
at
org.tigris.subversion.subclipse.core.status.SynchronizerSyncInfoCache$SyncInfoSynchronizedAccessor.flushPendingCacheWrites(SynchronizerSyncInfoCache.java:260)
at
org.tigris.subversion.subclipse.core.status.SynchronizerSyncInfoCache$1.run(SynchronizerSyncInfoCache.java:205)
at
org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344)
at
org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2326)
at
org.tigris.subversion.subclipse.core.status.SynchronizerSyncInfoCache.flushPendingStatuses(SynchronizerSyncInfoCache.java:203)
at
org.tigris.subversion.subclipse.core.status.StatusCacheManager$2.run(StatusCacheManager.java:368)
at
org.tigris.subversion.subclipse.core.util.JobUtility$1$1.run(JobUtility.java:22)
at
org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344)
at
org.tigris.subversion.subclipse.core.util.JobUtility$1.run(JobUtility.java:20)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
http://subclipse.tigris.org/ds/viewMessage.do?dsForumId=1047&dsMessageId=2827368
------------------------------------------------------
http://subclipse.tigris.org/ds/viewMessage.do?dsForumId=1047&dsMessageId=2827618
--The main problem was that our move/delete hook (SVNMoveDeleteHook) was not
notifying the Eclipse resource tree that it had deleted the folder, so we
weren't seeing the deletion reflected in the workspace. I've committed a
fix for this, and also for the problem that was causing the Synchronize view
to not refresh after the deleted folder was committed. Does Cleanup resolve
the current problem with your working copy?
Thanks,
Steve
p.s.
We decided to always show Team->Upgrade and show an error message if it is
selected against a folder that has already been upgraded, rather than
disabling or not showing the option. This is to avoid the overhead of an
API call when the context menu is shown.
-----Original Message-----
Sent: Monday, August 22, 2011 3:14 AM
Subject: Re: [Subclipse-users] i can't delete folders (and commit them) in
Subclipse 1.7
hmm after a restart it is even worse, then Team->Revert on the project
also doesn't show up the deleted dirs.
And i don't see that weird synchronize view entry. So now it seems to be
completely gone..
!ENTRY org.tigris.subversion.subclipse.core 4 368 2011-08-22 12:11:50.139
!MESSAGE Resource
'/eclipse_target/ship_plugins/features/org.eclipse.dltk.core.servoy_3.0.0.201108041240'
does not exist.
!STACK 1
org.eclipse.core.internal.resources.ResourceException: Resource
'/eclipse_target/ship_plugins/features/org.eclipse.dltk.core.servoy_3.0.0.201108041240'
does not exist.
at
org.eclipse.core.internal.resources.Resource.checkExists(Resource.java:320)
at
org.eclipse.core.internal.resources.Resource.checkAccessible(Resource.java:194)
at
org.eclipse.core.internal.resources.Synchronizer.setSyncInfo(Synchronizer.java:244)
at
org.tigris.subversion.subclipse.core.status.SynchronizerSyncInfoCache$SyncInfoSynchronizedAccessor.flushPendingCacheWrites(SynchronizerSyncInfoCache.java:260)
at
org.tigris.subversion.subclipse.core.status.SynchronizerSyncInfoCache$1.run(SynchronizerSyncInfoCache.java:205)
at
org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344)
at
org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2326)
at
org.tigris.subversion.subclipse.core.status.SynchronizerSyncInfoCache.flushPendingStatuses(SynchronizerSyncInfoCache.java:203)
at
org.tigris.subversion.subclipse.core.status.StatusCacheManager$2.run(StatusCacheManager.java:368)
at
org.tigris.subversion.subclipse.core.util.JobUtility$1$1.run(JobUtility.java:22)
at
org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344)
at
org.tigris.subversion.subclipse.core.util.JobUtility$1.run(JobUtility.java:20)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
I am using the latest 1.7 (from the 1.8 url)
delete --force
C:/workspace60/eclipse_target/ship_plugins/features/org.eclipse.dltk.c
ore.servoy.source_3.0.0.201108041240
D
C:/workspace60/eclipse_target/ship_plugins/features/org.eclipse.dltk.c
ore.servoy.source_3.0.0.201108041240
D
C:/workspace60/eclipse_target/ship_plugins/features/org.eclipse.dltk.c
ore.servoy.source_3.0.0.201108041240/eclipse_update_120.jpg
D
C:/workspace60/eclipse_target/ship_plugins/features/org.eclipse.dltk.c
ore.servoy.source_3.0.0.201108041240/epl-v10.html
D
C:/workspace60/eclipse_target/ship_plugins/features/org.eclipse.dltk.c
ore.servoy.source_3.0.0.201108041240/feature.properties
D
C:/workspace60/eclipse_target/ship_plugins/features/org.eclipse.dltk.c
ore.servoy.source_3.0.0.201108041240/feature.xml
D
C:/workspace60/eclipse_target/ship_plugins/features/org.eclipse.dltk.c
ore.servoy.source_3.0.0.201108041240/license.html
delete --force
C:/workspace60/eclipse_target/ship_plugins/features/org.eclipse.dltk.j
avascript.servoy.source_3.0.0.201108041240
D
C:/workspace60/eclipse_target/ship_plugins/features/org.eclipse.dltk.j
avascript.servoy.source_3.0.0.201108041240
D
C:/workspace60/eclipse_target/ship_plugins/features/org.eclipse.dltk.j
avascript.servoy.source_3.0.0.201108041240/eclipse_update_120.jpg
D
C:/workspace60/eclipse_target/ship_plugins/features/org.eclipse.dltk.j
avascript.servoy.source_3.0.0.201108041240/epl-v10.html
D
C:/workspace60/eclipse_target/ship_plugins/features/org.eclipse.dltk.j
avascript.servoy.source_3.0.0.201108041240/feature.properties
D
C:/workspace60/eclipse_target/ship_plugins/features/org.eclipse.dltk.j
avascript.servoy.source_3.0.0.201108041240/feature.xml
D
C:/workspace60/eclipse_target/ship_plugins/features/org.eclipse.dltk.j
avascript.servoy.source_3.0.0.201108041240/license.html
delete --force
C:/workspace60/eclipse_target/ship_plugins/features/org.eclipse.dltk.c
ore.servoy_3.0.0.201108041240
D
C:/workspace60/eclipse_target/ship_plugins/features/org.eclipse.dltk.c
ore.servoy_3.0.0.201108041240
D
C:/workspace60/eclipse_target/ship_plugins/features/org.eclipse.dltk.c
ore.servoy_3.0.0.201108041240/eclipse_update_120.jpg
D
C:/workspace60/eclipse_target/ship_plugins/features/org.eclipse.dltk.c
ore.servoy_3.0.0.201108041240/epl-v10.html
D
C:/workspace60/eclipse_target/ship_plugins/features/org.eclipse.dltk.c
ore.servoy_3.0.0.201108041240/feature.properties
D
C:/workspace60/eclipse_target/ship_plugins/features/org.eclipse.dltk.c
ore.servoy_3.0.0.201108041240/feature.xml
D
C:/workspace60/eclipse_target/ship_plugins/features/org.eclipse.dltk.c
ore.servoy_3.0.0.201108041240/license.html
delete --force
C:/workspace60/eclipse_target/ship_plugins/features/org.eclipse.dltk.j
avascript.servoy_3.0.0.201108041240
D
C:/workspace60/eclipse_target/ship_plugins/features/org.eclipse.dltk.j
avascript.servoy_3.0.0.201108041240
D
C:/workspace60/eclipse_target/ship_plugins/features/org.eclipse.dltk.j
avascript.servoy_3.0.0.201108041240/eclipse_update_120.jpg
D
C:/workspace60/eclipse_target/ship_plugins/features/org.eclipse.dltk.j
avascript.servoy_3.0.0.201108041240/epl-v10.html
D
C:/workspace60/eclipse_target/ship_plugins/features/org.eclipse.dltk.j
avascript.servoy_3.0.0.201108041240/feature.properties
D
C:/workspace60/eclipse_target/ship_plugins/features/org.eclipse.dltk.j
avascript.servoy_3.0.0.201108041240/feature.xml
D
C:/workspace60/eclipse_target/ship_plugins/features/org.eclipse.dltk.j
avascript.servoy_3.0.0.201108041240/license.html
D
C:/workspace60/eclipse_target/ship_plugins/features/org.eclipse.dltk.c
ore.servoy_3.0.0.201108041240/eclipse_update_120.jpg
I don't see the directories really disappearing, only when a manual or
auto refresh happens they are gone.
(so that is one bug in my eyes)
And then in the synchronize view, i don't see them as out going
-1 [SynchronizeView.noAuthor] (n/a)
and under that i see incoming additions of what i just deleted..
Updating that does nothing.
And i don't see those files as outgoing deletions in the sync view
Also when i click on the project and just say: Commit
In that window they are not appearing...So i can't really commit by
deletion at all
If i do Revert on that project i do see them, and i can revert them..
If i revert them, and then delete again, i get exactly the same thing.
johan
P.S. Team->Upgrade should be gone or disabled when it is already
upgraded..
------------------------------------------------------delete --force
C:/workspace60/eclipse_target/ship_plugins/features/org.eclipse.dltk.c
ore.servoy.source_3.0.0.201108041240
D
C:/workspace60/eclipse_target/ship_plugins/features/org.eclipse.dltk.c
ore.servoy.source_3.0.0.201108041240
D
C:/workspace60/eclipse_target/ship_plugins/features/org.eclipse.dltk.c
ore.servoy.source_3.0.0.201108041240/eclipse_update_120.jpg
D
C:/workspace60/eclipse_target/ship_plugins/features/org.eclipse.dltk.c
ore.servoy.source_3.0.0.201108041240/epl-v10.html
D
C:/workspace60/eclipse_target/ship_plugins/features/org.eclipse.dltk.c
ore.servoy.source_3.0.0.201108041240/feature.properties
D
C:/workspace60/eclipse_target/ship_plugins/features/org.eclipse.dltk.c
ore.servoy.source_3.0.0.201108041240/feature.xml
D
C:/workspace60/eclipse_target/ship_plugins/features/org.eclipse.dltk.c
ore.servoy.source_3.0.0.201108041240/license.html
delete --force
C:/workspace60/eclipse_target/ship_plugins/features/org.eclipse.dltk.j
avascript.servoy.source_3.0.0.201108041240
D
C:/workspace60/eclipse_target/ship_plugins/features/org.eclipse.dltk.j
avascript.servoy.source_3.0.0.201108041240
D
C:/workspace60/eclipse_target/ship_plugins/features/org.eclipse.dltk.j
avascript.servoy.source_3.0.0.201108041240/eclipse_update_120.jpg
D
C:/workspace60/eclipse_target/ship_plugins/features/org.eclipse.dltk.j
avascript.servoy.source_3.0.0.201108041240/epl-v10.html
D
C:/workspace60/eclipse_target/ship_plugins/features/org.eclipse.dltk.j
avascript.servoy.source_3.0.0.201108041240/feature.properties
D
C:/workspace60/eclipse_target/ship_plugins/features/org.eclipse.dltk.j
avascript.servoy.source_3.0.0.201108041240/feature.xml
D
C:/workspace60/eclipse_target/ship_plugins/features/org.eclipse.dltk.j
avascript.servoy.source_3.0.0.201108041240/license.html
delete --force
C:/workspace60/eclipse_target/ship_plugins/features/org.eclipse.dltk.c
ore.servoy_3.0.0.201108041240
D
C:/workspace60/eclipse_target/ship_plugins/features/org.eclipse.dltk.c
ore.servoy_3.0.0.201108041240
D
C:/workspace60/eclipse_target/ship_plugins/features/org.eclipse.dltk.c
ore.servoy_3.0.0.201108041240/eclipse_update_120.jpg
D
C:/workspace60/eclipse_target/ship_plugins/features/org.eclipse.dltk.c
ore.servoy_3.0.0.201108041240/epl-v10.html
D
C:/workspace60/eclipse_target/ship_plugins/features/org.eclipse.dltk.c
ore.servoy_3.0.0.201108041240/feature.properties
D
C:/workspace60/eclipse_target/ship_plugins/features/org.eclipse.dltk.c
ore.servoy_3.0.0.201108041240/feature.xml
D
C:/workspace60/eclipse_target/ship_plugins/features/org.eclipse.dltk.c
ore.servoy_3.0.0.201108041240/license.html
delete --force
C:/workspace60/eclipse_target/ship_plugins/features/org.eclipse.dltk.j
avascript.servoy_3.0.0.201108041240
D
C:/workspace60/eclipse_target/ship_plugins/features/org.eclipse.dltk.j
avascript.servoy_3.0.0.201108041240
D
C:/workspace60/eclipse_target/ship_plugins/features/org.eclipse.dltk.j
avascript.servoy_3.0.0.201108041240/eclipse_update_120.jpg
D
C:/workspace60/eclipse_target/ship_plugins/features/org.eclipse.dltk.j
avascript.servoy_3.0.0.201108041240/epl-v10.html
D
C:/workspace60/eclipse_target/ship_plugins/features/org.eclipse.dltk.j
avascript.servoy_3.0.0.201108041240/feature.properties
D
C:/workspace60/eclipse_target/ship_plugins/features/org.eclipse.dltk.j
avascript.servoy_3.0.0.201108041240/feature.xml
D
C:/workspace60/eclipse_target/ship_plugins/features/org.eclipse.dltk.j
avascript.servoy_3.0.0.201108041240/license.html
D
C:/workspace60/eclipse_target/ship_plugins/features/org.eclipse.dltk.c
ore.servoy_3.0.0.201108041240/eclipse_update_120.jpg
I don't see the directories really disappearing, only when a manual or
auto refresh happens they are gone.
(so that is one bug in my eyes)
And then in the synchronize view, i don't see them as out going
-1 [SynchronizeView.noAuthor] (n/a)
and under that i see incoming additions of what i just deleted..
Updating that does nothing.
And i don't see those files as outgoing deletions in the sync view
Also when i click on the project and just say: Commit
In that window they are not appearing...So i can't really commit by
deletion at all
If i do Revert on that project i do see them, and i can revert them..
If i revert them, and then delete again, i get exactly the same thing.
johan
P.S. Team->Upgrade should be gone or disabled when it is already
upgraded..
http://subclipse.tigris.org/ds/viewMessage.do?dsForumId=1047&dsMessageId=2827368
------------------------------------------------------
http://subclipse.tigris.org/ds/viewMessage.do?dsForumId=1047&dsMessageId=2827618
Thanks
Mark Phippard
http://markphip.blogspot.com/
http://subclipse.tigris.org/ds/viewMessage.do?dsForumId=1043&dsMessageId=2828655
To unsubscribe from this discussion, e-mail: [dev-***@subclipse.tigris.org].