1

I have a couple files that I want to work with on some branched but not others. For these files, the clearcase branching looks like this:

Dev ---> Dev/speical_branch_1
    ---> Dev/test_branch_1

I want to completely obliterate the test branch for both of these files so that the clearcase branching looks like this

Dev --> Dev/special_branch_1

How do I erase this branch from existence for only these files?

This is different from How to delete a clearcase branch with a single command? becasue I want to delete the branch for specific files. It is also different from Delete file from ClearCase checked out on another branch because I do not want to delete the files outright, but only remove certain branches from them.

isakbob
  • 1,439
  • 2
  • 17
  • 39

2 Answers2

1

That would be using cleartool rmver using a version-extended pathname, or a version selector (for base CC only, not UCM).

The idea is to delete the extended path version of the file for that branch

cleartool rmver -force -version \main\Dev\test_branch_1\1 myFile

(use / on Unix, \ on Windows)

Or, shorter: delete all versions between 1 and LATEST on the test_branch_1 branch of element myFile

cleartool rmver -vrange  \main\Dev\test_branch_1\1  \main\Dev\test_branch_1\LATEST myFile

That can be dangerous, especially in ClearCase UCM, where each version can have metadata (attributes) associated to it, which can break objects (like baselines).
rmver is often blocked in that case.

But in base ClearCase, if you have not set anything on those versions, and do not intend to use that branch for that file... that should work.

I mentioned cleartool rmbranch -f file@@/main/aBranch 'seen in Brian's answer) as an alternative approach in "Command to delete branches of Clearcase element with “0” versions".

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
0

@VonC. That answer is not correct. You CANNOT remove the \0 version on a branch.

If you are removing an entire branch instance from a file, and this is NOT a UCM environment, you would use:

cleartool rmbranch myfile@@\main\branch

If it is a UCM environment, things get a little more challenging, and it's often best to leave them there and create a new stream.

Brian Cowan
  • 1,048
  • 6
  • 7
  • 1
    As it changed since 2013? I did remove version 0 in https://stackoverflow.com/a/18183902/6309 – VonC Jan 16 '20 at 14:22
  • It might be only /main/0 that is completely irremovable. But /0 versions are pretty darn important. They are the roots of the various subtrees. I would never explicitly remove a /0 version unless the underlying container was corrupt, then I'd use rmver -data instead. (or let checkvob do it. – Brian Cowan Jan 17 '20 at 15:10
  • OK, I understand. I try to avoid rmver as much as possible indeed, for version 0 or any version for that matter. – VonC Jan 17 '20 at 15:15