I have tiny question about ClearCase. Help me please! When does config spec start to work? When I click CHECK OUT or CHECK IN ? I have test.c
and I have config spec
element * CHECKEDOUT
element * .../branch_1/LATEST
element * /main/LATEST -mkbranch branch_1
then I modify test.c
, then I change config spec:
element * CHECKEDOUT
element * .../branch_2/LATEST
element * /main/LATEST -mkbranch branch_2
Then I Check in test.c
and I have: created /main/branch_1/1
. BUT WHY???
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
inbranch2
whiletest.c
is already checked out (inbranch1
) doesn't change anything. It will be checked in inbranch_1
.Now that you will create a version on
branch1
on checkin fortest.c
(even with your second config spec), you need to realize that all future checkout/checkins will take place on that same branch fortest.c
, because:element * branch_1/LATEST
will keep the new versions on that branchelement * /main/LATEST -mkbranch branch_2
is only valid for version checked out from main (and test.c is no longer on/main
, it is onbranch1
:/main/branch1
)This config spec would make sure that all new versions (after the first checkin of
test.c
onbranch1
) are done onbranch2
: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 onbranch1
, 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:
This one would select the right version:
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 onbranch2
, soelement * /main/LATEST
is the only rule that can be applied.