Remove empty directory from CVS?

牧云@^-^@ 提交于 2019-11-28 20:07:43
Jorge Ferreira

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.)

Just did

  1. rm -rvf /localCopy/project/emptyDirectory
  2. edit /localCopy/project/CVS/Entries, delete line D/emptyDirectory////, save file
  3. rmdir -v /CVSROOT/project/emptyDirectory

to get rid of emptyDirectory in project. Admit not legit to mess with internal CVS data, but seems to have worked (cvs version 1.12.13).

CVS has a number of design flaws, never being able to get rid of a directory without losing history is one. Difficulty renaming files and directories without losing history is another.

Consider graduating to Subversion. cvs2svn does a very good job converting repositories including all branches and tags. The CVS and SVN command sets are very similar and require minimal adjustment. (And to head off this becoming a "what version control should you use" war) once you're using SVN you can move to any number of more advanced version control systems such as git or SVK.

This worked for me. Basically When you do

rmdir -v /CVSROOT/project/emptyDirectory # We are deleting directory from CVS repository directory.

If you have repository unix server login access, you can travel to the path and can delete the directory,or raise the same concern with unix team.

Rob Wells

cvs tends to work on a two phase approach regarding directories that's why there is a -P option for many cvs commands to "Prune empty directories".

When this has happened, e.g. want to rename a directory I've just added, I delete the directory, delete the entry for the directory in the CVS/Entries file, it'll be a line prepended with a "D".

Job done.

If I've committed, I make sure my current working area that contains the empty directory/ies is all checked in. Then I blow away the part of the work area that I have added the directories to.

For example, in

~/Sandbox/my_project/some_stuff_i_want
~/Sandbox/my_project/empty_dir_1
~/Sandbox/my_project/other_stuff_i_want

I make sure everything is up to date in both directories containing the stuff I want to keep. I then blow away my_project from within my sandbox.

Then I delete the empty directories from the repository itself.

Going back and checking out the same work area, e.g. my_project will give me the work area without the empty dirs.

Or just leave everything as is and use the -P option to get CVS check everything out (or update everything), then prune out the empty dirs.

HTH

cheers,

Rob

You cannot delete directory from your workspace , you need to delete it from going to server where actual repository is kept. but you can delete files from the directory with cvs remove command.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!