I'm not quite sure how this happened, but somehow a completely empty hierarchy of directories has ended up in my repository:
com/ com/companyname/ com/companyname/blah/ com/sun/ com/sun/java/ com/sun/java/jax_rpc_ri/
I think what happened was that these directories did have files in them, but then a developer realized he/she shouldn't have checked them in in the first place since these are by-products of the build process, so he/she removed the files but somehow the empty directories are left in the repository as ancient relics.
How can I remove this from CVS? The only results I seem to be able to find on google say that there shouldn't be a need to remove empty directories as CVS won't keep them around in the first place, and that the -P
(prune) options to cvs update
should remove them from the working directory - which is zero help if you actually have empty directories in your repository.
A cvs remove
and cvs commit
doesn't seem to take care of this situation:
$ cvs remove -Rf com cvs remove: Removing com cvs remove: Removing com/companyname cvs remove: Removing com/companyname/blah cvs remove: Removing com/sun cvs remove: Removing com/sun/java cvs remove: Removing com/sun/java/jax_rpc_ri $ cvs commit com cvs commit: Examining com cvs commit: Examining com/companyname cvs commit: Examining com/companyname/blah cvs commit: Examining com/sun cvs commit: Examining com/sun/java cvs commit: Examining com/sun/java/jax_rpc_ri $ ls -l com total 24 drwxrwxr-x 2 matt matt 4096 Oct 15 14:38 CVS drwxrwxr-x 9 matt matt 4096 Oct 15 14:38 companyname drwxrwxr-x 4 matt matt 4096 Oct 15 14:38 sun
It's still there!
Does SVN have this weird behavior too?
Remove the file from your working copy of the directory. You can for instance use rm . Use ' cvs remove filename ' to tell CVS that you really want to delete the file. Use ' cvs commit filename ' to actually perform the removal of the file from the repository.
Click to open My Computer. Choose the Search tab at the top line. In the opening Search Menu, set Size filter to Empty (0 KB) and check All subfolders option. From the list of the files and folders that don't take up any disk space, right-click the empty folder(s) and select Delete.
It is definitely not safe to delete all empty folders from your C drive, there are many folders used by Windows and the installed software that will be empty from time to time and the folders themself are still required for when Windows or that software needs the folder to be there.
Delete Empty Files in a Directory First, search all the empty files in the given directory and then, delete all those files. This particular part of the command, find . -type f -empty -print, will find all the empty files in the given directory recursively. Then, we add the -delete option to delete all those files.
AFAIK the CVS protocol does not allow to remove directories. You should go to the server console and remove them from the real physical repository.
http://www.network-theory.co.uk/docs/cvsmanual/Removingdirectories.html
You don't remove the directory itself; there is no way to do that.
CVS checkout and update will always check out empty directories; that's just the way CVS is built. Do an update with "-P" -- "prune" -- to remove empty directories:
cvs update -dP
(Adding "-d" will update new directories that have appeared since your last update; otherwise, CVS will ignore them.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With