Login | Register
My pages Projects Community openCollabNet

Discussions > dev > [Subclipse-dev] Re: [Subclipse-users] i can't delete folders (and commit them) in Subclipse 1.7

subclipse
Discussion topic

Back to topic list

[Subclipse-dev] Re: [Subclipse-users] i can't delete folders (and commit them) in Subclipse 1.7

Author jcompagner
Full name jcompagner
Date 2011-08-23 01:48:49 PDT
Message 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.get​SVNResourceFor(resou​rce);
                 // 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.statusesToU​pdate(resource));
            Set<IResource> resourcesToRefresh = resourcesToRefresh(resource,
depth, IContainer.INCLUDE_PHANTOMS, refreshedResources.size());
            for (Iterator<IResource> iter = refreshedResources.iterator();
iter.hasNext();) {
                resourcesToRefresh.r​emove(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().g​etName().indexOf("."​) == -1) {
                return root.getFolder(fullPath);
            }
        }

        if (location.toFile().i​sDirectory()) {
            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().g​etName().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.tig​ris.org/issues/show_​bug.cgi?id=1297


On Mon, Aug 22, 2011 at 21:22, Mark Phippard <markphip at gmail dot com> wrote:
> I see a few bugs using the current trunk code:
> 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
>
>
>
>
>
>
> On Mon, Aug 22, 2011 at 10:47 AM, Stephen Elsemore <selsemore at collab dot net>
> wrote:
>>
>> 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-----
>> From: jcompagner [mailto:jcompagner at gmail dot com]
>> Sent: Monday, August 22, 2011 3:14 AM
>> To: users at subclipse dot tigris dot org
>> 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..
>>
>> in the log i see entries like this:
>>
>> !ENTRY org.tigris.subversio​n.subclipse.core 4 368 2011-08-22 12:11:50.139
>> !MESSAGE Resource
>> '/eclipse_target/shi​p_plugins/features/o​rg.eclipse.dltk.core​.servoy_3.0.0.201108​041240'
>> does not exist.
>> !STACK 1
>> org.eclipse.core.int​ernal.resources.Reso​urceException: Resource
>> '/eclipse_target/shi​p_plugins/features/o​rg.eclipse.dltk.core​.servoy_3.0.0.201108​041240'
>> does not exist.
>>        at
>> org.eclipse.core.int​ernal.resources.Reso​urce.checkExists(Res​ource.java:320)
>>        at
>> org.eclipse.core.int​ernal.resources.Reso​urce.checkAccessible​(Resource.java:194)
>>        at
>> org.eclipse.core.int​ernal.resources.Sync​hronizer.setSyncInfo​(Synchronizer.java:2​44)
>>        at
>> org.tigris.subversio​n.subclipse.core.sta​tus.SynchronizerSync​InfoCache$SyncInfoS​ynchronizedAccessor.​flushPendingCacheWri​tes(SynchronizerSync​InfoCache.java:260)
>>        at
>> org.tigris.subversio​n.subclipse.core.sta​tus.SynchronizerSync​InfoCache$1.run(Syn​chronizerSyncInfoCac​he.java:205)
>>        at
>> org.eclipse.core.int​ernal.resources.Work​space.run(Workspace.​java:2344)
>>        at
>> org.eclipse.core.int​ernal.resources.Work​space.run(Workspace.​java:2326)
>>        at
>> org.tigris.subversio​n.subclipse.core.sta​tus.SynchronizerSync​InfoCache.flushPendi​ngStatuses(Synchroni​zerSyncInfoCache.jav​a:203)
>>        at
>> org.tigris.subversio​n.subclipse.core.sta​tus.StatusCacheManag​er$2.run(StatusCach​eManager.java:368)
>>        at
>> org.tigris.subversio​n.subclipse.core.uti​l.JobUtility$1$1.r​un(JobUtility.java:2​2)
>>        at
>> org.eclipse.core.int​ernal.resources.Work​space.run(Workspace.​java:2344)
>>        at
>> org.tigris.subversio​n.subclipse.core.uti​l.JobUtility$1.run(​JobUtility.java:20)
>>        at org.eclipse.core.int​ernal.jobs.Worker.ru​n(Worker.java:54)
>>
>>
>>
>> On Mon, Aug 22, 2011 at 12:05, Johan Compagner <jcompagner at gmail dot com>
>> wrote:
>> > I am using the latest 1.7 (from the 1.8 url)
>> >
>> > and when i delete i see this in the log:
>> >
>> > delete --force
>> > C:/workspace60/eclip​se_target/ship_plugi​ns/features/org.ecli​pse.dltk.c
>> > ore.servoy.source_3.​0.0.201108041240
>> >    D
>> > C:/workspace60/eclip​se_target/ship_plugi​ns/features/org.ecli​pse.dltk.c
>> > ore.servoy.source_3.​0.0.201108041240
>> >    D
>> > C:/workspace60/eclip​se_target/ship_plugi​ns/features/org.ecli​pse.dltk.c
>> > ore.servoy.source_3.​0.0.201108041240/ecl​ipse_update_120.jpg
>> >    D
>> > C:/workspace60/eclip​se_target/ship_plugi​ns/features/org.ecli​pse.dltk.c
>> > ore.servoy.source_3.​0.0.201108041240/epl​-v10.html
>> >    D
>> > C:/workspace60/eclip​se_target/ship_plugi​ns/features/org.ecli​pse.dltk.c
>> > ore.servoy.source_3.​0.0.201108041240/fea​ture.properties
>> >    D
>> > C:/workspace60/eclip​se_target/ship_plugi​ns/features/org.ecli​pse.dltk.c
>> > ore.servoy.source_3.​0.0.201108041240/fea​ture.xml
>> >    D
>> > C:/workspace60/eclip​se_target/ship_plugi​ns/features/org.ecli​pse.dltk.c
>> > ore.servoy.source_3.​0.0.201108041240/lic​ense.html
>> > delete --force
>> > C:/workspace60/eclip​se_target/ship_plugi​ns/features/org.ecli​pse.dltk.j
>> > avascript.servoy.sou​rce_3.0.0.2011080412​40
>> >    D
>> > C:/workspace60/eclip​se_target/ship_plugi​ns/features/org.ecli​pse.dltk.j
>> > avascript.servoy.sou​rce_3.0.0.2011080412​40
>> >    D
>> > C:/workspace60/eclip​se_target/ship_plugi​ns/features/org.ecli​pse.dltk.j
>> > avascript.servoy.sou​rce_3.0.0.2011080412​40/eclipse_update_12​0.jpg
>> >    D
>> > C:/workspace60/eclip​se_target/ship_plugi​ns/features/org.ecli​pse.dltk.j
>> > avascript.servoy.sou​rce_3.0.0.2011080412​40/epl-v10.html
>> >    D
>> > C:/workspace60/eclip​se_target/ship_plugi​ns/features/org.ecli​pse.dltk.j
>> > avascript.servoy.sou​rce_3.0.0.2011080412​40/feature.propertie​s
>> >    D
>> > C:/workspace60/eclip​se_target/ship_plugi​ns/features/org.ecli​pse.dltk.j
>> > avascript.servoy.sou​rce_3.0.0.2011080412​40/feature.xml
>> >    D
>> > C:/workspace60/eclip​se_target/ship_plugi​ns/features/org.ecli​pse.dltk.j
>> > avascript.servoy.sou​rce_3.0.0.2011080412​40/license.html
>> > delete --force
>> > C:/workspace60/eclip​se_target/ship_plugi​ns/features/org.ecli​pse.dltk.c
>> > ore.servoy_3.0.0.201108041240
>> >    D
>> > C:/workspace60/eclip​se_target/ship_plugi​ns/features/org.ecli​pse.dltk.c
>> > ore.servoy_3.0.0.201108041240
>> >    D
>> > C:/workspace60/eclip​se_target/ship_plugi​ns/features/org.ecli​pse.dltk.c
>> > ore.servoy_3.0.0.201​108041240/eclipse_up​date_120.jpg
>> >    D
>> > C:/workspace60/eclip​se_target/ship_plugi​ns/features/org.ecli​pse.dltk.c
>> > ore.servoy_3.0.0.201​108041240/epl-v10.ht​ml
>> >    D
>> > C:/workspace60/eclip​se_target/ship_plugi​ns/features/org.ecli​pse.dltk.c
>> > ore.servoy_3.0.0.201​108041240/feature.pr​operties
>> >    D
>> > C:/workspace60/eclip​se_target/ship_plugi​ns/features/org.ecli​pse.dltk.c
>> > ore.servoy_3.0.0.201​108041240/feature.xm​l
>> >    D
>> > C:/workspace60/eclip​se_target/ship_plugi​ns/features/org.ecli​pse.dltk.c
>> > ore.servoy_3.0.0.201​108041240/license.ht​ml
>> > delete --force
>> > C:/workspace60/eclip​se_target/ship_plugi​ns/features/org.ecli​pse.dltk.j
>> > avascript.servoy_3.0​.0.201108041240
>> >    D
>> > C:/workspace60/eclip​se_target/ship_plugi​ns/features/org.ecli​pse.dltk.j
>> > avascript.servoy_3.0​.0.201108041240
>> >    D
>> > C:/workspace60/eclip​se_target/ship_plugi​ns/features/org.ecli​pse.dltk.j
>> > avascript.servoy_3.0​.0.201108041240/ecli​pse_update_120.jpg
>> >    D
>> > C:/workspace60/eclip​se_target/ship_plugi​ns/features/org.ecli​pse.dltk.j
>> > avascript.servoy_3.0​.0.201108041240/epl-​v10.html
>> >    D
>> > C:/workspace60/eclip​se_target/ship_plugi​ns/features/org.ecli​pse.dltk.j
>> > avascript.servoy_3.0​.0.201108041240/feat​ure.properties
>> >    D
>> > C:/workspace60/eclip​se_target/ship_plugi​ns/features/org.ecli​pse.dltk.j
>> > avascript.servoy_3.0​.0.201108041240/feat​ure.xml
>> >    D
>> > C:/workspace60/eclip​se_target/ship_plugi​ns/features/org.ecli​pse.dltk.j
>> > avascript.servoy_3.0​.0.201108041240/lice​nse.html
>> >    D
>> > C:/workspace60/eclip​se_target/ship_plugi​ns/features/org.ecli​pse.dltk.c
>> > ore.servoy_3.0.0.201​108041240/eclipse_up​date_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
>> > changes. but as a weird entry like:
>> >
>> > -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.tig​ris.org/ds/viewMessa​ge.do?dsForumId=1047​&dsMessageId=282​7368
>>
>> To unsubscribe from this discussion, e-mail:
>> [users-unsubscribe@s​ubclipse.tigris.org]​.
>>
>> --------------------​--------------------​--------------
>>
>> http://subclipse.tig​ris.org/ds/viewMessa​ge.do?dsForumId=1047​&dsMessageId=282​7618
>>
>> To unsubscribe from this discussion, e-mail:
>> [users-unsubscribe@s​ubclipse.tigris.org]​.
>
>
> --
> Thanks
>
> Mark Phippard
> http://markphip.blogspot.com/
>

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

Messages

Show all messages in topic

[Subclipse-dev] Re: [Subclipse-users] i can't delete folders (and commit them) in Subclipse 1.7 jcompagner jcompagner 2011-08-23 01:48:49 PDT
Messages per page: