[p4] p4ruby create new changelist
buckmeisterq at gmail.com
Fri Mar 6 10:53:10 PST 2009
Excellent, thank you both!
I really got a good laugh at myself from your comment, Jeff - I was
about ready to stumble on those and just needed that extra push :-)
And Peter, here's what ended up working for me. I left out the leading
tab for description because it ended up indenting the first line,
purely an aesthetic choice. With Jeff's pointer to save_change I just
had to get the curly braces in the right place.
@changeDescription = File.open(changeDescriptionFile,'rb').readlines
newChangeList = p4.save_change("Change: new\nDescription:\n
And now it has dawned on me that fetch_change could be used instead of
my p4.run_describe command. But is there a practical difference?
On Fri, Mar 6, 2009 at 12:54 PM, Jeff A. Bowles <jeff.a.bowles at gmail.com> wrote:
> I assume that you are about ready to stumble into the "fetch_change /
> save_change" methods?
> -Jeff Bowles
On Fri, Mar 6, 2009 at 12:33 PM, Peter Stephenson <pws at csr.com> wrote:
> The problem's here: your description spans multiple lines, so the form
> will look like:
> Change: new
> Description: stuff...
> more stuff...
> whereas Perforce wants (note leading tabs):
> Change: new
> more stuff
> Try something like (remembering the newlines are already there):
> p4.input = "Change: new\nDescription:\n\t" + @changeDescription.join("\t")
> I haven't verified this works (but did check the Ruby syntax).
> Peter Stephenson <pws at csr.com> Software Engineer
> CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
> Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070
> perforce-user mailing list - perforce-user at perforce.com
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