Config spec in ClearCase

时光总嘲笑我的痴心妄想 提交于 2019-11-28 00:30:17
VonC

The config spec will apply the rules on each update and on checkout, and on checkin (but not as you think it would).

On checkin, the new version will be created in the branch it has been checked out (here branch_1).
That new version might not be selected by the new config spec, BUT the branch in which it has been checked out is NOT changed by said new config spec.

Changing branch1 in branch2 while test.c is already checked out (in branch1) doesn't change anything. It will be checked in in branch_1.

Now that you will create a version on branch1 on checkin for test.c (even with your second config spec), you need to realize that all future checkout/checkins will take place on that same branch for test.c, because:

  • the rule element * branch_1/LATEST will keep the new versions on that branch
  • the rule element * /main/LATEST -mkbranch branch_2 is only valid for version checked out from main (and test.c is no longer on /main, it is on branch1: /main/branch1)

This config spec would make sure that all new versions (after the first checkin of test.c on branch1) are done on branch2:

element * CHECKEDOUT
element * .../branch_2/LATEST
element * ../branch_1/LATEST  -mkbranch branch_2
element * /main/LATEST -mkbranch branch_2

The order of the rules is important, because the first one that can be applied "wins" (i.e. the pothers are ignored).
See this concrete example of config spec in "Config Spec to display labeled files from 2 branches".


Note that after the first checkin of test.c, you will get a new version created on branch1, as explained before.

Yet your second config spec will select /main/1, not /main/branch1/1.

That is because of an incorrect rule in your second config spec:

element * branch_1/LATEST

This one would select the right version:

element * .../branch_1/LATEST

But if your second config spec has no rule regarding branch1, test.c will still be selected as /main/1: there is no version created on branch2, so element * /main/LATEST is the only rule that can be applied.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!