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

Re: [Subclipse-users] Copy/paste with folders

From: jcompagner <jcompagner_at_gmail.com>
Date: Wed, 29 Jul 2009 20:10:05 +0200

i updated the patch a bit so that subclipse just doesnt delete stuff when a
folder is seen as a copy (without subclipse knowing it)
but ask a user what to do.

On Fri, Jul 24, 2009 at 11:40, Johan Compagner <jcompagner_at_gmail.com> wrote:

> I used the Team->Copy i see this:
>
> delete --force
> F:/workspace/shiplibs/configuration/org.eclipse.equinox.simpleconfigurator/org.eclipse.update
> D
> F:/workspace/shiplibs/configuration/org.eclipse.equinox.simpleconfigurator/org.eclipse.update
> copy F:/workspace/shiplibs/configuration/org.eclipse.update
> F:/workspace/shiplibs/configuration/org.eclipse.equinox.simpleconfigurator/org.eclipse.update
> A
> F:/workspace/shiplibs/configuration/org.eclipse.equinox.simpleconfigurator/org.eclipse.update
>
> If i then look into the copied folder, i notice that the files are not in
> added mode.. But already have a icon of managed and nothing changed
> If i then look into the svn properties of such a file i get this:
>
> Bad URL passed to RA layer
> svn: URL '
> https://subversion.servoy.com/development/trunk/eclipse_build/eclipse_ship_files/configuration/org.eclipse.equinox.simpleconfigurator/org.eclipse.update/platform.xml'
> non-existent in revision 25548
>
> Is there here something to blame?
> I would say that it should also be in "added" mode or atleast show me that
> in the icon.
>
>
> I did try to search for a way to be able to copy just normally in eclipse
> I changed FileModificationManager a bit, i added this:
>
> if (!addedFolders.isEmpty())
> {
> for(int i=0;i<addedFolders.size();i++)
> {
> final IResource resource = (IResource)
> addedFolders.get(i);
> LocalResourceStatus resourceStatus =
> SVNWorkspaceRoot.peekResourceStatusFor(resource.getRawLocation());
> if (resourceStatus.isManaged())
> {
> boolean deleteSVNMetaFolders = false;
> // quick check.
> if (resourceStatus.getUrlCopiedFrom() == null)
> {
> // if it was an ADDED folder and the copied
> from url is still null then it was a copy and not a move. So delete all the
> svn folders from that folder.
> deleteSVNMetaFolders = true;
> }
> else
> {
> // is it maybe a copy of an to add folder?
> SVNUrl parent =
> resourceStatus.getUrl().getParent();
> LocalResourceStatus parentStatus =
> SVNWorkspaceRoot.peekResourceStatusFor(resource.getParent().getRawLocation());
> if ( !parentStatus.getUrl().equals(parent))
> {
> // the added folder
> deleteSVNMetaFolders = true;
> }
> }
> if (deleteSVNMetaFolders)
> {
> Job job = new Job("Deleting svn meta data of "
> + resource.getName()) {
> protected IStatus run(IProgressMonitor
> monitor) {
> try {
> resource.accept(new
> IResourceVisitor() {
> public boolean visit(IResource
> resource) throws CoreException {
> if
> (SVNWorkspaceRoot.isSvnMetaResource(resource))
> {
> resource.delete(true,
> null);
> return false;
> }
> return true;
> }
> },
> IResource.DEPTH_INFINITE,IContainer.INCLUDE_TEAM_PRIVATE_MEMBERS);
>
> SVNWorkspaceRoot.getSVNFolderFor(resource.getParent()).refreshStatus(true);
> } catch (CoreException e) {
> e.printStackTrace();
> }
> return Status.OK_STATUS;
> }
> };
> job.setSystem(true);
> job.setRule(resource);
> job.schedule();
> }
> }
> }
> }
>
>
> Then it works for me, ok its not an svn copy so that you keep that history,
> but i dont really care for that at that time
> I just want to have a copy of something, and in my eyes thats the same as
> new. (if i really want a history copy then i can always use the Team->copy)
>
> I dont know if that works for all occasions. is there a way that i get a
> folder add where the folder doesnt have a copyFromUrl and the parent urls
> also dont match
> I guess something like a checkout of a dir into an already versioned dir
> would fall in that category (but i cant seem to do that in the eclipse ui)
>
> johan
>
>
>
>
> On Fri, Jul 24, 2009 at 00:01, Mark Phippard <markphip_at_gmail.com> wrote:
>
>> Last time I checked (long time ago) the xxx\cvs was copied. The
>> Eclipse bug to add a copy hook is still not implemented.
>>
>> If you make any headway, use this issue:
>>
>> http://subclipse.tigris.org/issues/show_bug.cgi?id=784
>>
>>
>>
>> On Thu, Jul 23, 2009 at 5:43 PM, jcompagner<jcompagner_at_gmail.com> wrote:
>> > i am diving in to this a bit
>> >
>> > The problem is that if i copy the folder "xxx" that then "xxx\.svn" is
>> also
>> > copied right?
>> >
>> > But why does that happen? How does CVS not do that? if i copy "xxx" then
>> > "xxx\cvs" isnt copied...
>> >
>> > johan
>> >
>> >
>> > On Thu, Jul 23, 2009 at 15:41, Mark Phippard <markphip_at_gmail.com>
>> wrote:
>> >>
>> >> This is an Eclipse issue that has existed forever. Unlike when you
>> >> move something, when you copy Eclipse does not do anything to allow a
>> >> Team provider to be involved. There is no "copyHook" for team
>> >> providers as there is with move and delete. People have tried to use
>> >> listeners to detect when this happens and fix it, but it is not
>> >> possible to make it work.
>> >>
>> >> We added a Team > Copy/Export option as something of a workaround. So
>> >> that you can do a copy that we do know about and can do it right.
>> >>
>> >>
>> >> On Wed, Jul 22, 2009 at 7:57 PM, kukgini<kukgini_at_gmail.com> wrote:
>> >> > Bug or feature? --
>> >> >
>> >> > Copy/paste of a folder under SVN controls leads to a duplication not
>> >> > only of the folder contents, but also of the ".svn" subfolders inside
>> >> > it. Therefore, the copy is also automatically markes as being under
>> >> > version control.
>> >> >
>> >> > My experience is that this result is usually unwanted and/or
>> annoying.
>> >> >
>> >> > (Furthermore, it appears that the copied resources point to the same
>> SVN
>> >> > resources, i.e. deleting the files in the new copy might probably
>> mark
>> >> > them as deleted in the other parent folder, too.)
>> >> >
>> >>
>> >>
>> >>
>> >> --
>> >> Thanks
>> >>
>> >> Mark Phippard
>> >> http://markphip.blogspot.com/
>> >>
>> >> ------------------------------------------------------
>> >>
>> >>
>> http://subclipse.tigris.org/ds/viewMessage.do?dsForumId=1047&dsMessageId=2374822
>> >>
>> >> To unsubscribe from this discussion, e-mail:
>> >> [users-unsubscribe_at_subclipse.tigris.org].
>> >
>> >
>>
>>
>>
>> --
>> Thanks
>>
>> Mark Phippard
>> http://markphip.blogspot.com/
>>
>> ------------------------------------------------------
>>
>> http://subclipse.tigris.org/ds/viewMessage.do?dsForumId=1047&dsMessageId=2375008
>>
>> To unsubscribe from this discussion, e-mail: [
>> users-unsubscribe_at_subclipse.tigris.org].
>>
>
>

------------------------------------------------------
http://subclipse.tigris.org/ds/viewMessage.do?dsForumId=1047&dsMessageId=2376679

To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_subclipse.tigris.org].
Received on 2009-07-29 20:10:40 CEST

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.