• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to delete files/folders from CVS on Eclipse?

 
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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,
 
Author
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
jim yin
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]

 
Dastardly Dan the Author
Posts: 120
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
     
    David Gallardo
    Author
    Posts: 18
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    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
    Posts: 120
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    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
     
    With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    reply
      Bookmark Topic Watch Topic
    • New Topic