[p4] p4ruby create new changelist

Peter Buckley buckmeisterq at gmail.com
Fri Mar 6 09:18:01 PST 2009


I'm new to Ruby and OOP but having a *blast* using p4ruby to automate
some integration tasks. I'm stuck on something and I can't figure out
why, and wondering if anyone on the list has any ideas on where I
should investigate further to figure out my problem or maybe suggest a

My task is to integrate from one branch to another, and as I integrate
each change (singly) I search/replace from a template to create a new
change description (see code snippet, error, and template/description
examples below).

I'm having trouble entering a change description from the command line
that I don't have issues with from the p4win gui. Perforce seems to be
interpolating the lines that I've put in the description. How can I
appropriately comment or pass this to perforce on the command line and
still maintain my formatting for the description?


Here's the relevant code snippet from my class:

    @changeDescription = File.open(changeDescriptionFile,'rb').readlines
    p4.input = "Change: new\nDescription: #{@changeDescription}"
    newChangeList = p4.run_change("-i")[0].split[1]

And this is the error I get:

c:/ruby/lib/ruby/site_ruby/1.8/P4.rb:67:in `run': [P4#run] Errors
during command execution( "p4 change -i" ) (P4Exception)

	[Error]: Error in change specification.
Error detected at line 3.
Syntax error in '123456'.

	from c:/ruby/lib/ruby/site_ruby/1.8/P4.rb:67:in `method_missing'

Here's my template:

Integration of change:
>From one branch to another.
Please contact developer repltxtuser with any questions.
Original submission comments:

And this is a mock-up of what the new change description looks like:

Integration of change:
>From one branch to another.
Please contact developer Joe Smith with any questions.
Original submission comments:
Internal: branch1, branch2

Type: bugfix

 Bugfix Information
 user hit a button
 How Fixed:
 i created a new function
 How Tested:
 ran fine in debugger
 Root Problem:

The king’s heart is like a stream of water directed by the Lord; He
guides it wherever he pleases.

More information about the perforce-user mailing list