File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes IDEs, Version Control and other tools and the fly likes How to delete files/folders from CVS on Eclipse? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "How to delete files/folders from CVS on Eclipse?" Watch "How to delete files/folders from CVS on Eclipse?" New topic
Author

How to delete files/folders from CVS on Eclipse?

jim yin
Ranch Hand

Joined: Aug 15, 2002
Posts: 111
Hi,
I am using Eclipse, I checked in my project days ago. Now I find its directory structure is not right, I want to delete and change some of them. How can I do it?
Thanks,
David Gallardo
Author
Greenhorn

Joined: Jul 07, 2003
Posts: 18
It's a piece of cake! Just make your changes and commit. Eclipse and CVS will take care of the details.
For example, I created a new package in a project and moved some existing files from another package into it by dragging and dropping them. Eclipse did the necessary refactoring automatically. I also deleted an obsolete file.
When I committed the changes (on my desktop) and then updated the project on another machine (my laptop) the new structure and file deletion were reflected.
@D
[ July 22, 2003: Message edited by: David Gallardo ]
[ July 22, 2003: Message edited by: David Gallardo ]

Co-author: "Eclipse in Action: A guide for the Java developer"<br />Author: "Java Oracle Database Development"
jim yin
Ranch Hand

Joined: Aug 15, 2002
Posts: 111
Thanks, David:
You must be DA expert, and I may get your book to understand it more.
Here is the problem, I changed my directory structure, now even I do commit, some folders there. This is not what I want. When I do a synchronize with repository, it tells me workspace is the same as remote repository. But when I load CVS repository, I still see some empty folders I do not want. How can I delete these empty folders?
Thanks,
Originally posted by David Gallardo:
It's a piece of cake! Just make your changes and commit. Eclipse and CVS will take care of the details.
For example, I created a new package in a project and moved some existing files from another package into it by dragging and dropping them. Eclipse did the necessary refactoring automatically. I also deleted an obsolete file.
When I committed the changes (on my desktop) and then updated the project on another machine (my laptop) the new structure and file deletion were reflected.
@D
[ July 22, 2003: Message edited by: David Gallardo ]
[ July 22, 2003: Message edited by: David Gallardo ]
Dan Kehn
Dastardly Dan the Author
Ranch Hand

Joined: Jun 11, 2003
Posts: 120
Just a couple thoughts, in no particular order:
  • Verify that Window > Preferences > CVS > Prune empty directories is checked.
  • Turn on CVS label decorators, it may help you understand what's going on (Window > Preferences > Workbench > Label Decorations > CVS). For example, when you delete a folder, you should see the changed indicator (">") displayed in its parent folder. That tells you that you must commit the deletion to CVS (deleting a folder with the "Delete..." context menu choice only marks it for deletion; committing the parent folder actually deletes it in the repository (*)).
  • If you are familiar with the CVS command interface, open the CVS Console (Window > Show View > Other... > CVS > CVS Console). This will echo the commands as they are sent to the CVS server. When things don't work as you expect, that shows you precisely what really happened.
  • Apart from our books , my second favorite CVS reference is Open Source Development with CVS. It is not an easy read, however.
  • If you get tired of scratching your head, there is the brute force approach. Call whoever manages your CVS repository and ask them to delete the offending directories.


  • This may go without saying, but just in case... remember that you must use the Eclipse menu choices (e.g., from the Navigator). If you delete a file / folder from the command line or Explorer, for example, you must select "Refresh" in Eclipse. You should see the ">" changed indicators show up, telling you that there are local uncommitted changes.
    Hope some of this random rambling helps.
    -- Dan
    (*) Technically, it doesn't delete it but rather moves it into the "attic" where it can be recovered at a later date.


    Co-author of <a href="http://www.jdg2e.com" target="_blank" rel="nofollow">The Java Developer's Guide to Eclipse</a>, 2nd Edition<br />(Yahoo group <a href="http://groups.yahoo.com/group/JDG2E/" target="_blank" rel="nofollow">JDG2E</a>)
    David Gallardo
    Author
    Greenhorn

    Joined: Jul 07, 2003
    Posts: 18
    I'd like to add a little to what Dan said about the CVS "prune directories" option. Selecting this option does not delete directories from the server; it only affects the way CVS checks out directories to your local workspace. If you have this option checked, and there is an empty directory, it will not appear (or will be removed) from you workspace the next time you update.
    Since this does not affect the server, it means that if somebody else checks out (or updates) the project, the directory will appear if they don't have this option checked too. It's checked by default when Eclipse is installed, (at least in 2.1), but you might want to double-check that everyone on your team has it selected. Otherwise, someone might mistakenly put a file in it, and it will re-appear that next you update.
    Contrary to what Dan said, directories are not put in the ATTIC, only deleted files. There is normally no way to delete a directory within CVS. If you *really* want to remove a directory, it is necessary to delete it from the server at the file system level.
    BTW, another good source for additional CVS information is the standard reference, "Version Management with CVS" by Per Cederqvist et al., (usually called "the Cederqvist") available for free download at http://www.cvshome.org.
    @D
    [ July 23, 2003: Message edited by: David Gallardo ]
    Dan Kehn
    Dastardly Dan the Author
    Ranch Hand

    Joined: Jun 11, 2003
    Posts: 120
    Originally posted by David Gallardo:
    Contrary to what Dan said, directories are not put in the ATTIC, only deleted files.

    Sorry, I wasn't clear enough. Deleting a folder does indeed put all its contents in the "Attic" -- my point being that deleting a folder doesn't really "lose" anything. Thanks for the additional clarification.
    Jim, here's some specific references related to your question from the Open Source Development with CVS I mentioned earlier, plus a couple others that are particularly noteworthy:
  • What happens when you remove a file
  • I need to remove a subdirectory in my project; how do I do it?
  • Real life problems with solutions
  • I am having problems with sticky tags - how do I get rid of them?

  • FWIW, I find this reference more friendly than the Cederqvist.
    -- Dan
     
    Don't get me started about those stupid light bulbs.
     
    subject: How to delete files/folders from CVS on Eclipse?
     
    Similar Threads
    The selected wizard could not be started
    Eclipse 3.0 not recognizing plugins
    Q about Eclipse & CVS: deleting cvs folders, versions, etc.
    Intenationalization JSF using Tomcat & Eclipse
    type converson failed in struts 2 : ognl.MethodFailedException