Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to remove a version in clearcase

Tags:

clearcase

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

After realized that I've made a mistake, I remove the newly created version by:

ct rmver scr@myranch/1

then use ct ls parent_dir_of_scr to do the double check and I found although scr@mybranch/1 disappeared, scr@mybranch/0 is still there .
Not 100% sure but I'm afraid I should not try to remove that version in the same way , cus it might let clearcase remove a version in main as well.
So my question is how should I do a totally "clean up" in this situation .

Need your help . thanks in advance .

like image 918
Haiyuan Zhang Avatar asked Feb 19 '10 10:02

Haiyuan Zhang


People also ask

How do I remove ClearCase element?

Use a -- a separator between options and arguments. To remove a ClearCase object (view, VOB, element or other ClearCase objects) with a preceding hyphen ( - ) character, execute the cleartool command with a double-hyphen argument to prevent cleartool from interpreting the name as an option.

How do I delete a ClearCase stream?

Once all of this check list is completed, you can delete your empty stream: While your empty stream is selected, click on "File" on the upper left corner, and select "Delete".

How do you delete private files in ClearCase?

In order to also get rid of private directories, first run the command with rmdir /S /Q "%i" and then with del /F "%i" .


1 Answers

First, as mentioned in How do I roll back a file checked in to Clearcase?, the one command to never ever do is rmver.
Even if in your case it could be appropriate, this is simply too dangerous, for it removes the version and all its associated metadata (hyperlinks, labels and so on).

Then, you mention:

rather than checked out /vobs/myvob/src I checked out /vobs/myvob/scr/...

... well /vobs/myvob/src is quite similar to /vobs/myvob/src here. I do not see any differences between the "two" directories.

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

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

Finally, the "version 0" you see is only a "declarative" version to act as a starting point for branches.
That is why the other answers suggest you to rmbranch (remove the branch) for that element. It only serves the purpose of cleaning the lsvtree (version tree).

"cleartool rmbranch -force $element"

as mentioned in the ten best scripts.

like image 60
VonC Avatar answered Nov 09 '22 10:11

VonC