1

Background

I am in a situation where in order to promote code cleanly, views with a certain number have to be branched in a coordinated way as such:

/some/dir/here@@/main/dev/view_dev__456_textDescription
/some/dir/here/file.txt@@/main/dev/view_dev__456_textDescription
/some/dir/here@@/main/dev/prod1/view_prod1_dev__456_textDescription
/some/dir/here/file.txt@@/main/dev/prod1/view_prod1_dev__456_textDescription

Each view of a certain product must be branched from its product branch.

Problem

I am in a situation where I accidentally created a product specific view, but off of the dev branch. Below is the situation I am in:

/some/dir/here@@/main/dev/view_dev__456_textDescription
/some/dir/here/file.txt@@/main/dev/view_dev__456_textDescription
/some/dir/here@@/main/dev/view_prod1_dev__456_textDescription <-- The erroneous branch
/some/dir/here/file.txt@@/main/dev/prod1/view_prod1_dev__456_textDescription

Attempted solution

I tried this command to get rid of the erroneous branch:

ct rmbranch /some/dir/here@@/main/dev/view_prod1_dev__456_textDescription

But I got this error:

...
Checking for mergeouts on branch [view_prod1_dev__456_textDescription] ...
ERROR: Cannot delete a WI branch that has mergeouts
cleartool: Warning: Trigger "TRG_PRE_RMBRANCH" has refused to let rmbranch proceed.
cleartool: Error: Unable to remove branch "/some/dir/here@@/main/dev/view_prod1_dev__456_textDescription"

Based on the error, I need to get rid of the mergeouts for this branch. Thus my question...

Question

How do I undo the mergeouts of a specific clearcase branch?

isakbob
  • 1,439
  • 2
  • 17
  • 39

1 Answers1

1

Assuming base ClearCase here, you do a a ct lstree --graph on some file to see if they are merged to other branch version.

That is: check if you see a red arrow, as seen in "Find all unmerged files/elements in ClearCase".
That answer includes a cleartool find which would give you all the merged elements between two branches.

For each element version involve in that merge (again, assuming base ClearCase), you can:

  • describe that version and find the merge hyperlink coming from it.
  • do a cleartool rmhlink Merge@xxxxx@/vobs/yourvob, removing said hyperlink.

Once there is no more merge hyperlink from view_prod1_dev__456_textDescription, the TRG_PRE_RMBRANCH should not block the rmbranch anymore.

See cleartool rmhlink, and the previous question: "How do I search for specific kinds of merge hyperlinks in ClearCase?".

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • My thought is that the OP needs to contact their CC admins make sure that this is really acceptable based on their processes. You *can* do that, but if this is a heavily regulated industry, removing development history may cause problems with regulatory audits. You may also find that the rmhlink operations are blocked by triggers. – Brian Cowan Jan 31 '20 at 14:59
  • @BrianCowan I agree: anything involving `rmver` or `rmhlink` needs to be vetted carefully. – VonC Jan 31 '20 at 15:00