Fw: [p4perl] sync problems

Roger Day roger.day at globalgraphics.com
Mon Mar 14 06:39:38 PST 2005

With $self->Sync()

$version = 1.4320

The returns from $self->Sync() and $self->Warnings are undefined.

The return from $self->Errors() is an array -1 in length.


                      Tony Smith                                                                                                        
                      <tony at smee.org>          To:       "Roger Day" <roger.day at globalgraphics.com>                                     
                                               cc:       p4perl at perforce.com                                                            
                      14/03/2005 14:07         Subject:  Re: Fw: [p4perl] sync problems                                                 

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
the modules I don't have, and changing file paths etc. I've executed it
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
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 '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

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?


More information about the p4perl mailing list