Guys,
Is there a way to enable exclusive checkouts on clear case? I want that when I work on a file, no one else will be able to check it out.
TY
Guys,
Is there a way to enable exclusive checkouts on clear case? I want that when I work on a file, no one else will be able to check it out.
TY
You just check out "reserved". Anyone else who checks out the same file will get an "unreserved" version. You will then be guaranteed the right to check in a version which creates the successor to the current version, whereas anyone else with an "unreserved" checkout will not. This is actually a much better system than exclusive checkouts.
ClearCase support both:
The advantage of checkout reserved is that it does not prevent another person to work on the same file, since he/she will have to wait for your checking before having to merge his/her work with your new version.
See about reserved/unreserved checkouts
That said, you could add a post-op trigger (post-checkout) which would check if the file has already a checkedout version and which would undo the checkout and exit with a message preventing the second user to checkout at all the same file.
cleartool mktrtype -element -all -postop checkout \
-execwin "\\path\to\checkIfNotCo.pl" \
-execunix "/path/to/checkIfNotCo.pl" \
-c "check if not CheckedOut" notco_trigger
You could still need to write the checkIfNotCo.pl
, but as Paul mentions in his answer, this is not really needed.
If it is a really sensitive file, you could lock it.