[p4] p4ruby create new changelist

Peter Buckley 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
#{@changeDescription.join("\t")}")[0].split[1]
   p4.run_integ("-o","-c#{newChangeList}","-r","-b","My_Branchspec","//...@#{@integrationChangeList},@#{@integrationChangelist}")

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?

Thanks again,
Peter

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
> Description:
>        stuff...
>        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
> http://maillist.perforce.com/mailman/listinfo/perforce-user
>



-- 
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