1

I'm trying to use mkbranch command to create branch from main/abc branch.

I create branch type with following command:

mkbrtype –c "bugfix branch from abc" bugfixAbc

Now I need to create branch with that branch type.

How I'll create new branch from main/abc branch with branch type bugfixAbc?

Furkan Yavuz
  • 1,858
  • 5
  • 30
  • 51

2 Answers2

3

You need to modify your config spec in order to create new versions starting from abc. see for example "Where do new elements appear when mkelem is used?":

element * CHECKEDOUT
element * .../bugfixAbc/LATEST
element * .../abc -mkbranch(bugfixAbc)
element * /main/0 -mkbranch(bugfixAbc)
element * /main/LATEST

The ellipsis .../ in a selection rule allows for ClearCase to select that branch abc, from whatever branch it comes from: /main, or any other branch.

Using cleartool mkbranch is not the solution here: it won't scale if you have to do it for many files, and it creates a version 0 left in checked-out state, that you should checkin. (or cancel the checkout, which would delete the branch)

By using a config spec, you will create automatically that branch each time you checkout an element present in the abc branch. Any element, not just a given file.

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

I find out that I can give the path of the file like this:

mkbranch -c "bugfix branch from abc" bugfixAbc util.java@@/main/abc/27

So, this created branch from abc branch with branch type bugfixAbc

Furkan Yavuz
  • 1,858
  • 5
  • 30
  • 51
  • 1
    I have edited my answer to explain why mkbranch is not the solution here. – VonC Oct 26 '17 at 20:13
  • 1
    Another reason that you want to use the configspec option: If you manually run the mkbranch operation in a default configspec view, your changes will appear to vanish on chekin. They will still be there, but they won't be visible. – Brian Cowan Oct 28 '17 at 01:04