1

Is there any way I can block the users checking in with preserve modification time. If preserve modification time box is checked, it will checkin with the last saved time and not the actual checkin time. I need only the checkin time. So if preserve modification time is checked also, it should checkin with the current time, or if preserve modification time is checked, it should not allow checkin. Please guide.

  • Regarding a cleartool wrapper, it depends on your client's environment, but you can take inspiration from http://backpan.perl.org/authors/id/D/DS/DSB/ClearCase-Wrapper-1.17.readme, in http://backpan.perl.org/authors/id/D/DS/DSB/?C=M;O=D. – VonC Dec 07 '12 at 12:29

1 Answers1

0

Since it is a client preference, you cannot force it.

In a previous client, I was able to run every day a .reg files on all ClearCase clients in order to reset certain preferences, but this is a workaround which isn't available everywhere.

The other option I saw was to deploy wrappers (checkout and checkin custom scripts) which would refuse to call the cleartool co/ci if the -ptime option was used.
Again not trivial to deploy/maintain.
An example of cleartool wrapper which could be adapted to control certain commands can be found here: (ClearCase::Wrapper perl module)

Blocking a checkin with a trigger could be possible, with a preop trigger:

 cleartool mktrtype -element -all -preop checkin -execwin ... -execunix " -c "Checkin time check" ci_trigger

What I don't know is whether or not you can access to the local file timestamp (you should, with $ENV{"CLEARCASE_PN"}), in order to check it with the current time: if it differs, that means -ptime is in effect, and the command should be denied.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Hi.. Thanks. Is there any way I can block this checkin via triggers? –  Dec 07 '12 at 12:28
  • Like identical checkin box if ticked also im blocking using the following script. '$fileName=$ENV{"CLEARCASE_PN"}; chomp $fileName; $status=`cleartool diff -pred "$fileName"`; chomp $status; if ( $status eq "Files are identical" ) { print "\n No changes has been done...Files are identical with previous Version\n" ; exit 1; } else { exit 0; }' –  Dec 07 '12 at 12:31
  • @user1797693 Maybe. I have edited the answer to address that possibility, but you need to test it. – VonC Dec 07 '12 at 12:38