List Info

Thread: force sync




force sync
user name
2006-08-02 11:56:28
I use this set of subroutines to display any p4perl warnings or errors. Just call command Status() immediately after any important p4perl calls. Warnings will warn and errors will exit.
 
#------------------------------------------------
# Error handling subroutines
#------------------------------------------------
sub commandStatus {
 
    if ( $p4->WarningCount() )
    {
        displayWarnings();
    }
 
    if ( $p4->ErrorCount() )
    {
        displayErrors();
       exit;
    }
}
 
sub displayWarnings {
    my $warnings = $p4->Warnings();
 
    foreach $warning ( {$warnings} )
    {
     ;   print "\nWarnings: $warning\n\n";
 ;   }
 
    return $warnings;
}
 
sub displayErrors {
    my $errors = $p4->Errors();
 
    foreach $error ( {$errors} )
    {
     ;   print "\nError: $error\n\n";
    }
 
    return $errors;
}
Later.....Scott...
-----Original Message-----
From: p4perl-bouncesperforce.com [mailto:p4perl-bouncesperforce.com]On Behalf Of mehta suman
Sent: Wednesday, August 02, 2006 1:17 AM
To: Weintraub, David; p4perlperforce.com
Subject: Re: [p4perl] force sync

Thanks for your prompt response..
 
Could you please also tell me what command gets run at perforce commandline when we issue P4::Run("&lt;cmd>", "<parameters>); from perl.
 
is this converted in to below command?
p4 <cmd>; <parameters>

if yes then ,"p4 sync -f //depot/automation/color/inxIDColor1.js" works at command line but
$p4->Run("sync","-f  //depot/automation/color/inxIDColor1.js"); fails.
 
thanks again
Suman
"Weintraub, David" <david.weintraubbofasecurities.com>; wrote:
If you looked at the source code of the P4.pm module, you'll notice that the "P4::Sync" subroutine isn't defined there. This isn't uncommon in Perl modules. When you create a Perl module, you can take a shortcut defining all the subroutines (or methods if you prefer&nbsp;object oriented syntax)&nbsp;in that module by creating an AUTOLOAD subroutine. Basically, any undefined call to a subroutine is handled by the AUTOLOAD subroutine.
 
If you look at the P4::AUTOLOAD subroutine, you'll notice that any call to the P4 module that doesn't start with "Fetch", "Parse", "Save", or "Format" is merely translated directly into the P4::Run subroutine, so that any call to the P4 module in the form of:
 
P4::<Cmd>(<parameters&gt;)
 
Is translated as:
 
P4::Run("&lt;cmd>", "<parameters>);
 
So, to force a sync, all you need to do is:
 
$p4->Sync("-f");
 
which is run by the AUTOLOAD command as:
 
$p4->Run("sync", "-f");
 
By using an AUTOLOAD subroutine, the P4.pm module allows you to run any P4 command without the authors having to write an actual subroutine to handle that specific&nbsp;P4 command. For example, you can do things such as
 
$p4->Info();
$p4->Counter("review 1001");
$p4->Where("foo.cpp");
 
 

From: p4perl-bouncesperforce.com [mailto:p4perl-bouncesperforce.com] On Behalf Of mehta suman
Sent: Tuesday, August 01, 2006 10:15 AM
To: p4perlperforce.com
Subject: [p4perl] force sync

where can I get detailed description of p4::Sync command.
Our requirement is to force sync to a particular label. How can do this?
 
Thanks in advance.
Suman

Groups are talking. We´re listening. Check out the handy changes to Yahoo! Groups.


Yahoo! Messenger with Voice. Make PC-to-Phone Calls to the US (and 30+ countries) for 2˘/min or less.
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )