Larry
Larry

Reputation: 487

Is it possible to use patterns as branch type restrictions when creating a ClearCase trigger?

I'd like to create a branch restriction for a ClearCase preop merge trigger.

However, it should fire based not on the exact branch type, but rather based on whether the branch type follows a specific naming convention, like

.../my_special_branchname_prefix*

Can I do this, or do I have to list every branch separately?

I read in "cleartool man mktrtype" that a "branch-type-selector" can be used, but unfortunately I was not able to find comprehensive information on what it entails, i.e. if it can be a version selector pattern as used in a config spec (using e.g. the three-dot ellipsis), or even a globbing pattern, or if it can only be an exact branch type name.

Upvotes: 2

Views: 70

Answers (1)

VonC
VonC

Reputation: 1324447

One way to check what you can do is to write a dummy preop trigger script which will simply output the "trigger environment variables (EV)"

That way, you can check if one of those CLEARCASE_xxx environment variable has the name of the branch you want (do you mean the source or destination branch of that merge?).
Once you see the right variable, you can enforce your policy, by making sure the preop trigger script exits with -1 when the name of that branch does not start with the expected prefix.

Upvotes: 1

Related Questions