0

I need help on below requirement.

I have a extracted report where I used to get "revision number", element details, version path, changeset.

I need to:

  1. Create a temporary directory using a Perl script for each revision.

  2. Do an unreserved check out for the each element map with each revision and put into the created temporary folders.

I am able to create the temporary directory (e.g-for 100 revision number able to create 100 folders) but need help to write piece of code to do a unreserved checkout (prior to this create activity, set activity) each element associated with the each revision and put the file into the particular created folder. Also implement a undo unreserve checkout after the successful copy.

The data are like,

Revision#       Element                    version_path            changeset
-------  ---------------------------     ---------------          ------------
1  C:\views\xyz_mn-11\gahdg\test.java    \main\sdgks-1111_Int\3"  "C:\views\xyz_mn-11 
                                                               \gahdg\test.java@@\main
                                                                \sdgks-1111_Int\3"         
2
3
4

Please give some suggestions or valuable guidance on this.

brian d foy
  • 129,424
  • 31
  • 207
  • 592
devtech
  • 155
  • 1
  • 1
  • 5
  • I have tried this from CMD cleartool checkout -unr -nc -out -ver \main\sdgks-1111_Int\3 test.java – devtech Feb 25 '10 at 14:35

2 Answers2

2

One way to execute an external command from Perl is to use system:

my $cmd = 'cleartool checkout -unr -nc -out -ver \main\sdgks-1111_Int\3 test.java';
if (system $cmd) {
    die "Error: $cmd";
}
toolic
  • 57,801
  • 17
  • 75
  • 117
1

Check also the question How can I interact with ClearCase from Perl?, where you will be able to execute cleartool command in Perl with the CCCmd package.

CCCmd::ClearToolNoError("cleartool checkout -unr -nc -out -ver \main\sdgks-1111_Int\3 test.java");

However, after reading checkout man page, I am not sure this is the right syntax

cleartool checkout -unr -nc -out /my/temp/file -ver test.java@@\main\sdgks-1111_Int\3

would be more like it, using the extended pathname form to reference the right version to checkout from test.java.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250