[p4ruby] Re: P4Ruby and login tickets

Tony Smith tony at smee.org
Fri Feb 4 01:19:40 PST 2005


Hi Johan,

> answers inlined.

Mine too.

> > > I'm using p4d 2003.2 (FreeBSD) in combination with p4 2004.2 at the
> > > client side (WinXP), and p4 login isn't officially support

<snip>

> D:\Data\ruby\logcvt>ruby -r P4 -e 'puts P4.identify'
>
> P4/Ruby Build Summary:
>
>                   Author : Tony Smith <tony at smee.org> or
> <tony at perforce.com>
>                  Version : 1.4251
>     Perforce API Version : 2003.2

> D:\Data\ruby\logcvt>p4 -V
> Perforce - The Fast Software Configuration Management System.
> Copyright 1995, 2004 Perforce Software.  All rights reserved.
> Rev. P4/NTX86/2004.2/69465 (2004/09/27).

OK, that's your problem. Between 2003.2 and 2004.2 the way tickets were stored 
was changed (this was all undoc'd in 2003.2 remember). In 2003.2 the P4PASSWD 
variable would be updated to contain the value of the ticket, and that's what 
the Perforce API (and hence P4Ruby) supplies when asked to provide a ticket 
to the server.

In 2004.2, tickets are placed in a ticket file in your 'home' directory.

So, when you mix your client versions what happens is this: you login using 
'p4 login' and the ticket gets written to your ticket file; then later you 
try to use this ticket with P4Ruby and that doesn't find the ticket, but uses 
the value of the P4PASSWD variable - which I guess is incorrect.

So, the solution is to either upgrade your P4Ruby to a 2004.2 build, or 
downgrade your P4 client to a 2003.2 build.

> > > Also, did you consider making P4Ruby available as a RubyGem?
> >
> > I can't say I've given it much thought, but I'll certainly
> > look into it.
> > Thanks for the nudge!
>
> You're welcome. While I've got you 'on-line', what would you think
> about:
>
> 1. Provide a way to retrieve the current exception level.
> 2. Providing named constants for the exception levels.
> 3. Provide P4.at_exception_level(level) { ... } for things that need a
> temporarily lowered/raised exception level - example:
>
> ...
> P4.at_exception_level(P4::RAISE_ERRORS_ONLY) {
>   changes = p4.run_changes("...")
> }

All excellent ideas - I'll look into those.

Thanks again.

Tony



More information about the p4ruby mailing list