|
List Info
Thread: force sync
|
|
| force sync |

|
2006-08-01 14:15:21 |
|
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 32;
Groups are talking. We´re listening. Check out the handy changes to Yahoo! Groups. |
| force sync |

|
2006-08-01 15:46:11 |
|
| 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 object oriented
syntax) 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>)
Is translated as:
P4::Run("<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 P4 command. For example, you can do
things such as
$p4->Info();
$p4->Counter("review 1001");
$p4->Where("foo.cpp");
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. |
| force sync |

|
2006-08-02 05:17:14 |
|
Thanks for your prompt response.. Could you please also tell me what command gets run at perforce commandline when we issue P4::Run("<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.weintraub bofasecurities.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 object oriented syntax) 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>) Is translated as: P4::Run("<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 P4 command. For example, you can do things such as $p4->Info(); $p4->Counter("review 1001"); $p4->Where("foo.cpp"); 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 |
| force sync |

|
2006-08-02 09:59:43 |
On Wednesday 02 August 2006 06:17, mehta suman wrote:
> Thanks for your prompt response..
>
> Could you please also tell me what command gets run
at perforce
> commandline when we issue
P4::Run("<cmd>",
"<parameters>); from perl.
>
> is this converted in to below command?
> p4 <cmd> <parameters>
Strictly speaking the syntax is (and is documented to be)
P4::Run( "<cmd>", [
"<parameter>" ... ] )
and this gets converted into:
p4 <cmd> [ <parameter> ... ]
> 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.
That's because it should be:
$p4->Run( "sync", "-f",
"//depot/automation/color/inxIDColor1.js" );
Hope that helps,
Tony
_______________________________________________
p4perl mailing list
p4perl perforce.com
http://maillist.perforce.com/mailman/listinfo/p4perl
|
|
| force sync |

|
2006-08-02 10:27:18 |
|
Thanks a lot.. that worked.. Suman Tony Smith <tony smee.org> wrote: On Wednesday 02 August 2006 06:17, mehta suman wrote: > Thanks for your prompt response.. > > Could you please also tell me what command gets run at perforce > commandline when we issue P4::Run("", "); from perl. > > is this converted in to below command? > p4
Strictly speaking the syntax is (and is documented to be)
P4::Run( "", [ "" ... ] )
and this gets converted into:
p4 [ ... ]
> 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.
That's because it should
be:
$p4->Run( "sync", "-f", "//depot/automation/color/inxIDColor1.js" );
Hope that helps,
Tony
Want to be your own boss? Learn how on Yahoo! Small Business.
|
| force sync |

|
2006-08-02 14:21:17 |
|
| P4/Perl doesn't run commands from the command line.
Instead, it uses the P4 C++ API. You can think of
$p4->Run("sync", "-f
//depot/automation/color/inxIDColor1.js);
as running the command
$ p4 sync -f
//depot/automation/color/inxIDColor1.js,
but it really doesn't. It's like P4V showing you the
resulting p4 command in the log window. But, like the P4/Perl interface, P4V
doesn't run the command.
This is a bit different from what I wrote earlier on how
"$p4->Sync("-f //depot/automation/color/inxIDColor1.js")" really only runs
"$p4->Run(sync, "-f //depot/automation/color/inxIDColor1.js"); because of the
AUTOLOAD subroutine. P4::Sync() is only an alias of P4::Run("sync"), but still
no actual P4 command gets executed.
As to why your command isn't working, you should call
P4::Errors() and P4::Warnings() right after your call to P4::Sync() or
P4::Run(). This will list any warnings or errors generated by the command. There
is also a P4::ErrorCount() too.
Thanks for your prompt response..
Could you please also tell me what command gets run at perforce
commandline when we issue P4::Run("<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.weintraub bofasecurities.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 object
oriented syntax) 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>)
Is translated as:
P4::Run("<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 P4 command. For example, you
can do things such as
$p4->Info();
$p4->Counter("review 1001");
$p4->Where("foo.cpp");
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
Yahoo! Messenger with Voice. Make
PC-to-Phone Calls to the US (and 30+ countries) for 2˘/min or less.
|
[1-6]
|
|