[p4ruby] p4ruby problem acc. to integrate

Tony Smith tony at smee.org
Tue Oct 9 02:42:28 PDT 2007


Hi Martin,

> yes, adding "p4.api = 57" does help, which means my small test tool does
> report now
> ...
> //Allplan/Products/MAIN/NemAll_Data/NemAll_DataFertigteil/FertSource/sqattr
>.cpp#3 - sync/integrate from
> //Allplan/Products/2005/LATEST/Libs_Allplan/Libs_Fertigteile/fertallg/sqatt
>r.cpp#2 ...
>
> Do you know the cause of this behaviour?

Yes - using p4.api=57 causes the server to treat your client like a 2004.1 
Perforce client and back then 'p4 integrate' didn't support tagged output. In 
P4Ruby, this means that you get a string instead of a Hash.

> The disadvantage of this modification "p4.api = 57" is that the tool needs
> now 16 instead of 11 seconds...

That's just because someone else was likely locking the tables and slowed you 
down (api=57 won't slow the server, or the client, down - if anything it 
should be a fraction faster)

I noticed that your script uses:

	  output += x["startFromRev"].to_s

and I think that's the problem: startFromRev needs to be incremented to be 
accurate as it's value is actually one less than the first revision in the 
range. So:

	startFromRev	= 1
	endFromRev	= 2

means #2,2 (or, as Perforce formats it, just #2)

So, in your script you should use x[ 'startFromRev' ] + 1.

Now, the next question is: why doesn't it work in your old environment? My 
theory there is that your old P4Ruby build was built with the 2004.2 API 
(i.e. api level 57), so it doesn't support tagged output on 'p4 integrate'. 
This ties up with your version number as P4Ruby 1.4841 was released on Mon 
Mar 07 2005, and 2004.2 was the current release at that time. 

You can test this theory by removing the code that handles string output in 
your script and running it in your old environment - if you get 'not handled 
yet!' in your output (the message in your 'else' block), then you know that 
the old P4Ruby environment was just getting a String from the server, and not 
a Hash.

Let me know if you need any more information.

Regards,

Tony



More information about the p4ruby mailing list