[p4ruby] Auto Submitting changes does not work for me

Jeff A. Bowles jab at pobox.com
Fri Jan 8 09:37:33 PST 2010


You might be mixing-and-matching two versions of the P4Ruby environment:
Tony's original, excellent work that's checked into the Perforce guest depot
and the P4.html documentation that you cite there;  the supported Perforce
offering, which packages Tony's work a bit and modified some of the
interfaces.

Pick the supported one; it'll be newer and provide you with someone to
telephone/email if you need assistance.

That said, this is in the release notes for the supported version:

	Deleted Methods
	---------------
	The following methods have been deleted from the P4 class and
	are no longer available:

	output			The output is returned by the run* methods	parse_forms		Form
parsing is now always on	tagged			See tagged? and tagged= below.
	
	Public Depot P4Ruby also contained compatibility interfaces
	for the following methods, all of which have been removed. In
	these cases, the method on the right-hand side has also been in
	Public Depot P4Ruby for some time, and most scripts use....

---
Jeff Bowles - jeff at vizim.com


On Fri, Jan 8, 2010 at 9:23 AM, Russ Lavoy <ussray_00 at yahoo.com> wrote:

> I am new to ruby and perforce and am having an issue here.  I have tried
> all variations of sample code and I just can't seem to get it to work.  I
> looked at the following links for help.  The server requires user name and
> password to login.
>
>
> http://www.perforce.com/perforce/doc.091/manuals/p4script/01_ruby.html#1053103
>
>
> http://public.perforce.com/guest/tony_smith/perforce/API/Ruby/main/doc/P4.html#input
>
> I just can't seem to get it to work.  Here is the code:
>
> <snip>
>
> require "P4"
> p4 = P4.new
> p4.port = "1.2.3.4:1666"
> p4.user = "puser"
> p4.client = "srv"
> p4.password = "passwd"
>
>
>  p4.debug=3
>  p4.connect
>  p4.run_login
>  p4.parse_forms
>
>  change = p4.run_change( "-o" ).shift
>  change[ "Description" ] = "Testing"
>
>  p4.input( p4.format_changelist(change) )
>  p4.run_change( "-i" )
>
>  changelist_num = p4.output.to_s.split(/\s+/)[1]
>
>  p4.run_edit("-c #{changelist_num} stuff.txt")
>
> </snip>
>
> When I run it I get the following error.
>
> <snip>
>
> [root at srv ~]# ruby test.rb
> [P4] Connecting to Perforce
> [P4] Received input for next command
> [P4] SetInput()
> [P4] Executing "p4 login"
> [P4] Prompt(): Enter password:
> [P4] InputData(). Using supplied input
> [P4] OutputInfo()
> ... User puser logged in.
> [P4] Cleaning up saved input
> test.rb:14: undefined method 'P4#parse_forms' (NoMethodError)
>
> </snip>
>
> If I remove the parse_forms I get something back...  But dies on another
> step.
>
> <snip>
>
> [P4] Connecting to Perforce
> [P4] Received input for next command
> [P4] SetInput()
> [P4] Executing "p4 login"
> [P4] Prompt(): Enter password:
> [P4] InputData(). Using supplied input
> [P4] OutputInfo()
> ... User puser logged in.
> [P4] Cleaning up saved input
> [P4] Executing "p4 change -o"
> [P4] OutputStat() - Converting to P4::Spec object
> ... Change -> new
> ... Client -> srv
> ... User -> puser
> ... Status -> new
> ... Description -> <enter description here>
>
> ... Files -> [0] = //depot/somefile
> /usr/lib/ruby/site_ruby/1.8/P4.rb:102:in `format_spec': [P4#format_spec] No
> spec definition for changelist objects. (P4Exception)
>        from /usr/lib/ruby/site_ruby/1.8/P4.rb:102:in `method_missing'
>        from test.rb:19
>
> </snip>
>
> Can I get some help with this?
>
>
>
> _______________________________________________
> p4ruby mailing list
> p4ruby at perforce.com
> http://maillist.perforce.com/mailman/listinfo/p4ruby
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://maillist.perforce.com/pipermail/p4ruby/attachments/20100108/6f68e505/attachment-0001.html>


More information about the p4ruby mailing list