How to remove version in clearcase

I want to check the directory, say /vobs/myvob/src/ , to add a new file to this directory. But by mistake, and did not check /vobs/myvob/src , I checked /vobs/myvob/scr/ and even worse checked it. Then the scr directory has a new version: scr@mybranch /1 (let's say I'm working on the mybranch branch)

After realizing that I made a mistake, I delete the just created version:

 ct rmver scr@myranch /1 

then use ct ls parent_dir_of_scr to do a double check, and I found that although scr@mybranch /1 disappeared, scr@mybranch /0 still exists.
Not 100% sure, but I'm afraid that I should not try to uninstall this version in the same way, cus, this may cause clearcase to delete the version basically.
So my question is how should I completely “clean” in this situation.

You need your help. thanks in advance.

+6
clearcase
source share
3 answers

First, as mentioned in How to undo a file marked in Clearcase? One team will never do this rmver .
Even if this may be appropriate in your case, it is simply too dangerous, since it deletes the version and all metadata associated with it (hyperlinks, tags, etc.).

Then you indicate:

not checked /vobs/myvob/src I checked /vobs/myvob/scr/ ...

... ok /vobs/myvob/src here is very similar to /vobs/myvob/src . I do not see the difference between the "two" directories.

If you want to add a file to the directory through the CLI cleartool, you will need:

  • checkout /vobs/myvob/src (parent directory)
  • mkelem file to add
  • check parent directory

Finally, the “version 0” you see is only a “declarative” version, which acts as a starting point for the branches.
This is why other answers suggest you rmbranch (delete branch) for this element. It serves only to clear lsvtree (version tree).

 "cleartool rmbranch -force $element" 

as indicated in the top ten scenarios .

+5
source share

Even if you delete version 1 of the file in your branch, your branch will remain (with version 0). If you really want to perform a cleanup, you can delete the branch ( ct rmbranch your_branch) for the file - it will not delete the version from mainline.

+3
source share

If you want to completely remove the version of the object (file or directory) from the Clearcase control, I suggest you use the following command:

 cleartool rmverxbranchxlabelxattrxhlink test.txt@ @\main\3 

Command parameters are described on this snip2code message .

+1
source share

All Articles