Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

after commit a folder to svn, cannot svn:ignore it?

 
peter tong
Ranch Hand
Posts: 246
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I add some compile class to version control wrongly, now I want to svn:ignore it but when I right click the folder and select Team, the "add to svn:ignore" is greyed out.
So there is always an arterisk logo in that folder, any method to svn:ignore that folder after I have wrongly commit it?
Also, I found there is no svn:delete in subclipse.
I am using VisualSVN server and subclipse.

 
Tim Holloway
Saloon Keeper
Posts: 18303
56
Android Eclipse IDE Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I do that all the time.

While you cannot literally delete the folder from SVN as though it had never been, you can do the next best thing.

1. Delete the folder in Eclipse. Do NOT use the command line or Windows explorer to do this, use the Eclipse navigator. It should decorate the folder icon with a red "X", indicating that deletion has been done. This will also schedule any child files and folders for deletion.

2. Commit that deletion to svn. That should make the folder vanish from the Navigator. For good measure, update the working copy FROM svn head after the commit in order to get everything in sync.

3. Manually create the folder using the Eclipse navigator "new folder" function.

4. Use the context menu to tag the new copy of the folder as "svn:ignore". Commit this new folder and again update the project.
 
peter tong
Ranch Hand
Posts: 246
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
fail even on step one, the folder will directly delete from eclipse, but not a red mark for delete later when commit, the whole process is shown as attached. I want svn:ignore the folder "war\com.mycompany.project.GWTDesignerFirst"
beforedelete.jpg
[Thumbnail for beforedelete.jpg]
delete.jpg
[Thumbnail for delete.jpg]
deleted1.jpg
[Thumbnail for deleted1.jpg]
 
peter tong
Ranch Hand
Posts: 246
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
continue the file attachment of previous problem
compile.jpg
[Thumbnail for compile.jpg]
aftercompile.jpg
[Thumbnail for aftercompile.jpg]
aftercompile2.jpg
[Thumbnail for aftercompile2.jpg]
 
Tim Holloway
Saloon Keeper
Posts: 18303
56
Android Eclipse IDE Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is something wrong with your first screenshot. I can't seem to find that folder in the project navigator display.

Before deleting the folder, do an "svn update" to pull it from the archive. If you were re-creating the folder by doing a build, that isn't likely to work. You need the svn copy of it.
 
peter tong
Ranch Hand
Posts: 246
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OH, sorry, the first image and the third image is misplaced, the third image is the before delete screenshot, and then the second image, and then the first image (the folder is deleted).


If you were re-creating the folder by doing a build, that isn't likely to work.


yes, when I compile the source, the "war\com.mycompany.project.GWTDesignerFirst" will be regenerated, is this impossible to svn:ignore it once I commit this folder?
 
Tim Holloway
Saloon Keeper
Posts: 18303
56
Android Eclipse IDE Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When you delete and regenerate folders and folder trees, the regenerated folders and files do not have their related .svn folders and files (metadata), which are needed to process the svn delete transaction properly. Among other things, svn not only has to delete the top-level folder, but also all its children from the archive.

That is why you have to do an "svn update" before deleting the folder you want to remove from svn. For best results, do a filesystem delete of the generated folder, an "svn update" to pull the svn copy of the folder (and its children), then an svn delete to remove it from the svn archive. Or, more correctly, from the archive head, since no trustworthy version control system would allow you to literally delete stuff from history. But that's all you need anyway.

Once you've pulled the archive copy of the folder and used svn delete on it, you can regenerate the folder, mark the regenerated folder (which won't have svn metadata) as svn:ignore, then commit that operation.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic