Search code examples
clearcase

How to make an exact replica of a branch?


I'm having a ClearCase read-only branch A.

I want to create an exact copy/replica of Branch A and create another Branch B.
Can we make such an exact replica of branch A at byte level?
Is this possible?

Update: As suggested by @VonC, I tried to make a change in the Branch A, let's call it "A_read" and it gave me an error in the checkout. Sorry had to paint some info as per company policy.

enter image description here


Solution

  • You simply create a viewB which starts at a label A you have set in viewA.
    Or you start from A/LATEST:

    That viewB will have a selection rule like:

    element .../A/LATEST -mkbranch B
    # or
    element * A -mkbranch B
    element * /main/LATEST
    

    That means:

    • it select the latest version in branch A (.../A because A can derive from /main or /main/someOtherBranch, or /main/X/Y/...)
    • it will create branch B only if there is a checkout.

    A branch in ClearCase has a starting point, and will have version of its own only once changes are versioned (checkout/checkin).

    Right now, with that selection rule, branch B is identical to A, in that it starts from the versions selected by A.