Remove empty directory from CVS?

后端 未结 7 1014
礼貌的吻别
礼貌的吻别 2020-12-14 06:53

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/compa         


        
相关标签:
7条回答
  • 2020-12-14 07:12

    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.

    0 讨论(0)
  • 2020-12-14 07:12

    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.

    0 讨论(0)
  • 2020-12-14 07:17

    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.

    0 讨论(0)
  • 2020-12-14 07:18

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

    0 讨论(0)
  • 2020-12-14 07:25

    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.

    0 讨论(0)
  • 2020-12-14 07:26

    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

    0 讨论(0)
提交回复
热议问题