Fw: [p4perl] sync problems

Tony Smith tony at smee.org
Mon Mar 14 06:07:10 PST 2005


On Friday 11 March 2005 19:44, Roger Day wrote:
> with debug set, both running
>
> $self->Sync(....)
> and
> $self->Run("Sync"....)

I've installed your script and with some hacking to remove the references to 
the modules I don't have, and changing file paths etc. I've executed it with 
the following results:

  $self->Sync() works as expected

  $self->Run( "Sync" ) fails as expected.

Perforce commands are case-sensitive (and all in lowercase). The AUTOLOADER 
method in P4.pm lowercases the method names to make sure they run correctly, 
but when you call $self->Run( "Sync", ... ) you're bypassing the AUTOLOADER 
and trying to run 'p4 Sync' and Perforce doesn't like that.

> give me "p4 unknown command. Try p4 help for info" in the return errors.
>
> The command "user-sync" now appears in the log file like so:

> Perforce server warning:
>         2005/03/11 19:43:04 pid 2392 rday at mauberley 127.0.0.1 'user-sync
> -f //depot/swig_tests/simple_build/product.xml#head'

That  looks OK to me. My guess is that was executed when you were using 
$p4->Sync(). There's no log entry for unknown commands. That sync may have 
failed for other reasons which would have been in $self->Errors() or 
$self->Warnings().

In your fetchFile() method you've got:

    my $val = $self->Sync( "-f", "$url"); 
    print "return value $!\n";

We may have already covered this in another message, but it's $val that 
contains the output, not $!. Printing $val makes a lot more sense when 
debugging. Also you might want to add a call to P4::Errors() and 
P4::Warnings() to report any errors and warnings that occurred.

Also, it would help to know which build of P4Perl you're using? What's the 
VERSION in P4.pm?

Tony



More information about the p4perl mailing list