1

But check in/out & merge should happen for the same work_branch.The only aim is that work_branch should not allow applying any label.

2 Answers2

1

Since:

  • locking the brtype for that branch would also prevent checkout/checkin,
  • locking the lbtype would prevent any mklabel on any branch,

You can try instead definining a pre-op trigger on mklabel:

If that mklabel operation is done on the wrong branch, that pre-op trigger would exit with a non-zero status, preventing the mklabel to proceed and apply the label.
See EV (Environment Variables) section of the mktrtype command.

See an example (not based on branches) in this thread:

ct mktrtype -element -all -preop mklabel -exec "/path/to/script"
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
1

Actually. You can also use a trigger with an inclusion list.

cleartool mktrtype -element -all -preop mklabel -brtype nolabel -exec "ccperl -e \" die();\"" NOLABEL_TRIG

Will block any attempt to make a label on a given brtype. Pardon the windows centric nature of the above.

Brian Cowan
  • 1,048
  • 6
  • 7