[p4perl] Help creating client workspace from template

Nathan_Tran at trendmicro.com Nathan_Tran at trendmicro.com
Wed Apr 25 20:12:39 PDT 2007


Hi,

 

I have the following code that uses an existing client workspace
template to create a new client workspace. The client workspace seems to
get created by the options and view mappings from the template are not
preserved in the new client workspace. Here's a snipet of the code:

 

$p4->Run("client", "-o", "-t", $client_template, $client_name);

@errors = $p4->Errors();

if ( @errors ) {

  foreach (@errors) {

    print "\t*** ERROR: P4: $_ ***\n";

    return 1;

  }

}

my $client_spec = $p4->FetchClient($client_name);

@errors = $p4->Errors();

if ( @errors ) {

  foreach (@errors) {

    print "\t*** ERROR: P4: $_ ***\n";

    return 1;

  }

}

 

$client_spec->{"Root"} = $local_src_root;

@errors = $p4->Errors();

if ( @errors ) {

  foreach (@errors) {

    print "\t*** ERROR: P4: $_ ***\n";

    return 1;

  }

}

$p4->SaveClient($client_spec);

@errors = $p4->Errors();

if ( @errors ) {

  foreach (@errors) {

    print "\t*** ERROR: P4: $_ ***\n";

    return 1;

  }

}

 

I'm new to Perforce so I'm probably not using the "p4 client -o -t
<client_teamplate> <client_name>" command correctly?

 

Does anyone have some code sample to create a new client workspace based
on an existing template?

 

Thanks,

Nathan



TREND MICRO EMAIL NOTICE
The information contained in this email and any attachments is confidential and may be subject to copyright or other intellectual property protection. If you are not the intended recipient, you are not authorized to use or disclose this information, and we request that you notify us by reply mail or telephone and delete the original message from your mail system.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://maillist.perforce.com/pipermail/p4perl/attachments/20070425/04a44ad8/attachment-0001.html>


More information about the p4perl mailing list