2 messages in com.perforce.p4ruby[p4ruby] Unexpected errors (warning n...
FromSent OnAttachments
Robin Charlton08 Mar 2005 04:36 
Tony Smith08 Mar 2005 06:50 
Subject:[p4ruby] Unexpected errors (warning newbie)
From:Tony Smith (to@smee.org)
Date:03/08/2005 06:50:27 AM
List:com.perforce.p4ruby

On Tuesday 08 March 2005 12:33, Robin Charlton wrote:

Apologies if the answer to this question is trivial - I'm just starting out with ruby and p4 scripting....

No problem :)

Why I try and execute the following command at a dos command line it works fine, but when I execute it through the ruby P4 object errors are reported, as follows:

p4.run_integ("-d -t -f -n //Depot/Antics/Admin/General.dot //Depot/Antics/Admin/General2.dot")

Errors: Warnings: Usage: integrate [ -c changelist# -d -D<flag> -f -h -i -I -n -r -s -t from -v ] [ -b branch to... | from to ] Invalid option: - -t -f -n //Depot/Antics/Admin/General.dot //Depot/Antics/Admin/General2.dot. c:/ruby/lib/ruby/1.8/P4.rb:122:in `run': [P4#run] Errors during command execution( "p4 integ -d -t -f -n //Depot/Antics/Admin/General.dot //Depot/Antics/Admin/General2.dot" ) (P4Exception) from c:/ruby/lib/ruby/1.8/P4.rb:122:in `method_missing' from p4_refactor.rb:281

What's going on here?

You need to quote the arguments separately. This is so P4Ruby can support arguments with spaces in them. So you need to do something like this:

p4.run_integ( "-d", "-t", "-f", "-n", "//Depot/Antics/Admin/General.dot", "//Depot/Antics/Admin/General2.dot")

Tony