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

Re: [Subclipse-users] Drag and drop replace of a binary file caused Subclipse to mark file as deleted

From: Mark Phippard <markp_at_softlanding.com>
Date: 2006-08-10 21:34:29 CEST

Chris Leon <chris.leon@realtimerisksystems.com> wrote on 08/10/2006
12:45:50 PM:

> We have two projects checked in to SVN. One contains source code for
> a binary that is built and checked in to the other.
>
> Our process under CVS (we've just recently switched over) involved
> running an Ant script which builds the JAR, then dragging and
> dropping the new JAR from project 1 to project 2, and then checking
> it in in project 2.
>
> However, now that we've switched to SVN, we find that Subclipse
> detects the drag and drop replace as a deletion of the JAR file,
> rather than a modification to the checked in content. We've found
> that if we use File->Import... to replace the JAR file, Subclipse
> properly detects this as a modification.
>
> It would seem appropriate to me that at the very least, File-
> >Import... and drag and drop for this scenario should work the
> same. I believe File->Import... has the correct behavior, and that
> the action on drag and drop should be changed to reflect that.

This is really an issue with Eclipse (although I do not believe they
consider it a bug). We have a MoveDeleteHook registered with Eclipse.
This means that Eclipse tells us when a file is deleted or moved so that
we can relay that to Subversion. When you drag and drop copy a file from
one Eclipse project to another, Eclipse fires the delete hook for the
file. We have no way of knowing that this is because of drag and drop as
opposed to pressing the delete key or some other actual delete.

When you drag and drop from Windows Explorer into Eclipse it does not do
this, nor when you import/export a JAR.

Besides using one of these other technique to replace your JAR's, we have
also code a workaround into Subclipse. You can set a SVN property named
"DeferFileDelete" with a value of "true" on any of the parent folders for
the JAR, such as a "lib" folder. When the delete hook is fired, we walk
up your folder hierarchy looking for this property. If we find it, and
the value is true, we will just ignore the delete and it will show as a
modification. If you do a real file delete, the file will still show up
in the Synchronize view/Commit/Revert dialogs with a status of missing. If
you Commit it will convert to a delete and commit it. Note however that
if you update a folder with missing items it will restore the files, so
you should do the commit soon after deleting.

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subclipse.tigris.org
For additional commands, e-mail: users-help@subclipse.tigris.org
Received on Thu Aug 10 21:34:42 2006

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.