Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Clearcase Delete Directory

I have a directory structure like so:

root_dir
  dir1
  dir2
    file1.txt
    file2.txt
    sub_dir
      file3.txt
      file4.txt

What is the best way to delete dir2 and all it's sub-elements using rmname? Can I simply do 'cleartool rmname dir2' and have it recursively delete all it's contents?

like image 387
Ken Hirakawa Avatar asked May 13 '11 03:05

Ken Hirakawa


1 Answers

You only need to:

cleartool checkout -nc root_dir
cleartool rmname dir2
cleartool checkin root_dir

That remove the reference to dir2 in the new version of root_dir, making dir2 and all its content invisible (not reachable).
And you can easily restore dir2 (and all its content) by merging the previous version of root_dir (which was still referencing dir2) with the current version (the one where you rmname'd dir2) in order to recreate a new version where you get back dir2.

Note: when using rmname, you might have an error message mentioning that the element is in checked out, even though it is not checked out in the branch where you are doing the rmname.
using rmname -force is the solution to still perform the rmname: see this technote.

like image 146
VonC Avatar answered Sep 21 '22 07:09

VonC