/******************************************************************************* Copyright (c) 1997-2004, Perforce Software, Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTR IBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL PERFORCE SOFTWARE, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *******************************************************************************/ /******************************************************************************* * Name : p4clientapi.cc * * Author : Tony Smith <tony@perforce.com> or <tony@smee.org> * * Description : Ruby bindings for the Perforce API. Main interface to the * Perforce API. * ******************************************************************************/ #include <ruby.h> #include "undefdups.h" #include <clientapi.h> #include <i18napi.h> #include <strtable.h> #include <spec.h> #include "extconf.h" #include "p4result.h" #include "p4rubydebug.h" #include "clientuserruby.h" #include "specmgr.h" #include "p4clientapi.h" /******************************************************************************* * Our Ruby classes. ******************************************************************************/ extern VALUE cP4; // Base P4 class extern VALUE eP4; // Exception class #define M_TAGGED 0x01 #define M_PARSE_FORMS 0x02 #define IS_TAGGED(x) (x & M_TAGGED ) #define IS_PARSE_FORMS(x) (x & M_PARSE_FORMS ) P4ClientApi::P4ClientApi() { initCount = 0; debug = 0; server2 = 0; mode = 0; depth = 0; exceptionLevel = 2; maxResults = 0; maxScanRows = 0; prog = "unnamed p4ruby script"; } P4ClientApi::~P4ClientApi() { if ( initCount ) { Error e; client.Final( &e ); // Ignore errors } } int P4ClientApi::SetCharset( const char *c ) { if( P4RDB_COMMANDS ) fprintf( stderr, "[P4] Setting charset: %s\n", c ); CharSetApi::CharSet cs = CharSetApi::Lookup( c ); if( cs < 0 ) { if( exceptionLevel ) { StrBuf m; m = "Unknown or unsupported charset: "; m.Append( c ); Except( "P4#charset=", m.Text() ); } return 0; } charset = c; client.SetTrans( cs, cs, cs, cs ); return 1; } void P4ClientApi::SetProg( const char *p ) { prog = p; } void P4ClientApi::SetDebug( int d ) { debug = d; ui.SetDebug( d ); } // // connect to the Perforce server. // VALUE P4ClientApi::Connect() { if ( P4RDB_COMMANDS ) fprintf( stderr, "[P4] Connecting to Perforce\n" ); if ( initCount ) { rb_warn( "P4#connect - Perforce client already connected!" ); return Qtrue; } Error e; specDict.Clear(); // Don't cache specs across connections client.Init( &e ); if ( e.Test() && exceptionLevel ) Except( "P4#connect", &e ); if ( e.Test() ) return Qfalse; initCount++; return Qtrue; } // // Disconnect session // VALUE P4ClientApi::Disconnect() { if ( P4RDB_COMMANDS ) fprintf( stderr, "[P4] Disconnect\n" ); if ( ! initCount ) { rb_warn( "P4#disconnect - not connected" ); return Qtrue; } Error e; client.Final( &e ); initCount--; return Qtrue; } void P4ClientApi::Tagged( int enable ) { if( enable ) mode |= M_TAGGED; else mode &= ~M_TAGGED; } void P4ClientApi::ParseForms() { client.SetProtocol( "specstring", "" ); mode |= M_PARSE_FORMS + M_TAGGED ; } void P4ClientApi::SetApiLevel( int level ) { StrBuf b; b << level; client.SetProtocol( "api", b.Text() ); } // // Run returns the results of the command. If the client has not been // connected, then an exception is raised but errors from Perforce // commands are returned via the Errors() and ErrorCount() interfaces // and not via exceptions because one failure in a command applied to many // files would interrupt processing of all the other files if an exception // is raised. // VALUE P4ClientApi::Run( const char *cmd, int argc, char * const *argv ) { // Save the entire command string for our error messages. Makes it // easy to see where a script has gone wrong. StrBuf cmdString; cmdString << "\"p4 " << cmd; for( int i = 0; i < argc; i++ ) cmdString << " " << argv[ i ]; cmdString << "\""; if ( P4RDB_COMMANDS ) fprintf( stderr, "[P4] Executing %s\n", cmdString.Text() ); if ( depth ) { rb_warn( "Can't execute nested Perforce commands." ); return Qfalse; } if ( ! initCount && exceptionLevel ) Except( "P4#run", "not connected." ); if ( ! initCount ) return Qfalse; #if P4APIVER_ID >= 513026 // ClientApi::SetProg() was introduced in 2004.2 client.SetProg( prog.Text() ); #endif if( mode & M_TAGGED ) client.SetVar( "tag" ); // Clear out any results from the previous command ui.Reset(); depth++; RunCmd( cmd, &ui, argc, argv ); depth--; P4Result &results = ui.GetResults(); if( ui.LastSpecDef().Length() ) specDict.SetVar( cmd, ui.LastSpecDef() ); if ( results.ErrorCount() && exceptionLevel ) Except( "P4#run", "Errors during command execution", cmdString.Text() ); if ( results.WarningCount() && exceptionLevel > 1 ) Except( "P4#run", "Warnings during command execution",cmdString.Text()); return results.GetOutput(); } // // RunCmd is a private function to work around an obscure protocol // bug in 2000.[12] servers. Running a "p4 -Ztag client -o" messes up the // protocol so if they're running this command then we disconnect and // reconnect to refresh it. For efficiency, we only do this if the // server2 protocol is either 9 or 10 as other versions aren't affected. // void P4ClientApi::RunCmd( const char *cmd, ClientUser *ui, int argc, char * const *argv ) { // If maxresults or maxscanrows is set, enforce them now if( maxResults ) client.SetVar( "maxResults", maxResults ); if( maxScanRows ) client.SetVar( "maxScanRows", maxScanRows ); client.SetArgv( argc, argv ); client.Run( cmd, ui ); // Have to request server2 protocol *after* a command has been run. I // don't know why, but that's the way it is. if ( ! server2 ) { StrPtr *pv = client.GetProtocol( "server2" ); if ( pv ) server2 = pv->Atoi(); } if ( IS_TAGGED(mode) && StrRef( cmd ) == "client" && server2 >= 9 && server2 <= 10 ) { if ( argc && ( StrRef( argv[ 0 ] ) == "-o" ) ) { if ( P4RDB_COMMANDS ) printf( "Resetting client to avoid 2000.[12] protocol bug\n" ); Error e; client.Final( &e ); client.Init( &e ); // Pass any errors down to the UI, so they'll get picked up. if ( e.Test() ) ui->HandleError( &e ); } } } // // Parses a string supplied by the user into a hash. To do this we need // the specstring from the server. We try to cache those as we see them, // but the user may not have executed any commands to allow us to cache // them so we may have to fetch the spec first. // VALUE P4ClientApi::ParseSpec( const char * type, const char *form ) { if( ! IS_PARSE_FORMS(mode) ) { if( exceptionLevel ) Except( "P4#parse_spec", "Use parse_forms mode to parse specs." ); return Qfalse; } StrPtr *specDef = FetchSpecDef( type ); if ( !specDef ) { if( exceptionLevel ) { StrBuf m; m = "No spec definition for "; m.Append( type ); m.Append( " objects." ); Except( "P4#parse_spec", m.Text() ); } else { return Qfalse; } } // Got a specdef so now we can attempt to parse it. Error e; SpecDataTable specData; #if P4APIVER_ID >= 513538 Spec s( specDef->Text(), "", &e ); #else Spec s( specDef->Text(), "" ); #endif SpecMgr m; if( !e.Test() ) s.ParseNoValid( form, &specData, &e ); if ( e.Test() ) { if( exceptionLevel ) { Except( "P4#parse_spec", &e ); } else { return Qfalse; } } // Now we've parsed it, convert it into a P4::Spec object. return m.DictToSpec( specData.Dict(), specDef ); } // // Converts a hash supplied by the user into a string using the specstring // from the server. We may have to fetch the specstring first. // VALUE P4ClientApi::FormatSpec( const char * type, VALUE hash ) { if( ! IS_PARSE_FORMS(mode) ) { if( exceptionLevel ) Except( "P4#format_spec", "Use parse_forms mode to format specs." ); return Qfalse; } StrPtr *specDef = FetchSpecDef( type ); Error e; if ( !specDef ) { if( exceptionLevel ) { StrBuf m; m = "No spec definition for "; m.Append( type ); m.Append( " objects." ); Except( "P4#format_spec", m.Text() ); } else { return Qfalse; } } // Got a specdef so now we can attempt to convert. StrBuf buf; SpecMgr m; if( m.HashToText( hash, &buf, specDef, &e ) ) return rb_str_new2( buf.Text() ); if( exceptionLevel ) { StrBuf m; m = "Error converting hash to a string."; if( e.Test() ) e.Fmt( m, EF_PLAIN ); Except( "P4#format_spec", m.Text() ); } return Qnil; } // // Returns a hash whose keys contain the names of the fields in a spec of the // specified type. Not yet exposed to Ruby clients, but may be in future. // VALUE P4ClientApi::SpecFields( const char * type ) { if( ! IS_PARSE_FORMS(mode) ) { if( exceptionLevel ) Except( "P4#spec_fields", "Use parse_forms mode to work with specs." ); return Qfalse; } StrPtr *specDef = FetchSpecDef( type ); if ( !specDef ) { if( exceptionLevel ) { StrBuf m; m = "No spec definition for "; m.Append( type ); m.Append( " objects." ); Except( "P4#spec_fields", m.Text() ); } else { return Qfalse; } } SpecMgr m; return m.SpecFields( specDef ); } // // Raises an exception or returns Qfalse on bad input // VALUE P4ClientApi::SetInput( VALUE input ) { if ( P4RDB_COMMANDS ) fprintf( stderr, "[P4] Received input for next command\n" ); if ( ! ui.SetInput( input ) ) { if ( exceptionLevel ) Except( "P4#input", "Error parsing supplied data." ); else return Qfalse; } return Qtrue; } void P4ClientApi::GCMark() { if ( P4RDB_GC ) fprintf( stderr, "[P4] Ruby asked us to do garbage collection\n" ); // We don't hold Ruby objects. But our UI does. ui.GCMark(); } void P4ClientApi::Except( const char *func, const char *msg ) { StrBuf m; StrBuf errors; StrBuf warnings; int terminate = 0; m << "[" << func << "] " << msg; // Now append any errors and warnings to the text ui.GetResults().FmtErrors( errors ); ui.GetResults().FmtWarnings( warnings ); if( errors.Length() ) { m << "\n" << errors; terminate++; } if( exceptionLevel > 1 && warnings.Length() ) { m << "\n" << warnings; terminate++; } if( terminate ) m << "\n\n"; rb_raise( eP4, m.Text() ); } void P4ClientApi::Except( const char *func, const char *msg, const char *cmd ) { StrBuf m; m << msg; m << "( " << cmd << " )"; Except( func, m.Text() ); } void P4ClientApi::Except( const char *func, Error *e ) { StrBuf m; e->Fmt( &m ); Except( func, m.Text() ); } // // Fetch a spec definition from the cache - faulting it if it's not there. // StrPtr * P4ClientApi::FetchSpecDef( const char *type ) { StrPtr *sd = specDict.GetVar( type ); if( sd ) return sd; // Fault. Now we have to do something nasty. We're in parse_forms mode, so // we can run a "p4 XXXX -o" and discard the result - the specdef should // now be in the cache. Some spec types require us to name the spec in // question. Since we don't know, we use a bogus name. We include the // word p4ruby in it so people know where to look if they spot it in // their logs. char * bogusSpec = "__p4ruby_bogus_spec__"; char * argv[3] = { "-o", 0, 0 }; int argc = 1; // // For specs of the following types we need the bogus spec name // StrRef t( type ); if( t == "branch" || t == "label" || t == "depot" || t == "group" ) argv[ argc++ ] = bogusSpec; Run( type, argc, argv ); sd = specDict.GetVar( type ); if( sd ) return sd; // OK, now we're hosed. Raise an exception if the exception level permits, // otherwise return null if( exceptionLevel ) Except( "P4#FetchSpecDef", "Error getting spec definition from server!" ); return 0; }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#46 | 14682 | Git Fusion |
Git Fusion branch management Imported from Git ghost-of-change-num: 960958 ghost-of-sha1: 005052ae424bd69f426f7209e741ca1c8c3253c7 ghost-precedes-sha1: ad052c71a568ef12165e143a6866ad9ceffbb4a1 parent-branch: None@960958 push-state: incomplete |
||
#45 | 14676 | tony |
Rework P4Ruby unit tests so they they are actually units. Now the test order is irrelevant as all tests are standalone. Tidied up the code formatting as well and removed all the tabs from the ruby sources files. Added a modeline for vim users so consistent indentation will be used. |
||
#44 | 14659 | tony |
Add ignore file support to P4Ruby. This change adds three new methods: P4#ignore_file - Return current ignore file P4#ignore_file= - Set ignore file name P4#ignored? - Test if a path is ignored It also removes the check which objected to the use of Ruby 2.0 since we now support it. Now we simply check that you're not using 2.1 (still a development release). |
||
#43 | 14656 | tony | Squelch annoying compiler warnings when building P4Ruby | ||
#42 | 14650 | jmistry |
Progress indicator for P4Ruby. There is a new class P4::Progress that is set up to be subclassed by a user. It has the following interface and P4Ruby expects the following class methods to be defined by the user (even if it's an empty implementation): class Progress: def init(type) end def description(description, units ) end def total( total ) end def update( position ) end def done( fail ) end end Users need to create a subclass of P4::Progress and assign an instance to P4 to enable the progress indicator: class MyProgress < P4::Progress def update(pos): # do something with the value here # other methods p4 = P4.new p4.progress = MyProgress.new New feature to be documented in the release notes. |
||
#41 | 14626 | jmistry |
raise exceptions in P4#run_resolve Any exceptions raised during the block passed to P4#run_resolve were silently swallowed. We still use 'rb_protect()' to run the block in the user's script; however, we now stash where the exception happened in 'rubyExcept' (a member of 'ClientUserRuby') instead of just a local variable. After running a command, I now run 'ClientUserRuby::RaiseRubyException()' - if an exception has been caught by 'rb_protect()' we now run 'rb_jump_tag()' to jump to the exception and raise it up. User visible change to be documented in release notes. |
||
#40 | 14624 | jmistry | Pull p11.1 changes back to main | ||
#39 | 14622 | jmistry |
Pull 10.2 changes to main Pick up missing changes in p10.2 and integrate to main. As part of the integrate I also moved the unit tests '16_streams.rb' and '17_streaming_handler.rb' because the integration introduced collisions with the unit test names. Updated MANIFEST with new names for unit tests and also added '98_unicode.rb', which was missing from it. |
||
#38 | 14611 | jmistry |
Support setting values in the registry through P4Ruby. The command P4.set_env( var, val ) will set a registry variably on platforms that support this action or through an exception on Unix. The command P4.set_env( var ) resets a registry variable. Updated unit test '02_environment.rb' to include registry set/check. User visible change to be documented in release notes. |
||
#37 | 14609 | jmistry |
Fix track error P4Ruby now raises a P4Exception, instead of a Ruby warning if a user tries to change track output after connecting. The test case has been updated to suppress this because we expect the error. Also removed debug message (accidently) left in streams test case. |
||
#36 | 14608 | jmistry |
Add encoding to Strings As part of adding Ruby 1.9 support we need to associate the encoding for Ruby's strings from the server. This approach is similar to Sven's (in changelist 257263), where everything but the 'content' charset was set to 'utf8'. The content charset is picked up from P4CHARSET and this is used to translate any file content. Also disabled the Ruby 1.9 warning for each compile. User visible change to be documented in release notes. |
||
#35 | 14594 | jmistry |
[P4Ruby] enable streams by default Fixed S_STREAMS bit mask to 0x0040 and changed the initial state S_INITIAL_STATE bit 0x0041 to enable streams by default. Added logic to set streams for API levels greater than 69 Add streams test case - tests the output of 'P4::run_depots' for different settings of 'P4::streams' and 'P4::api_level' |
||
#34 | 14593 | Sven Erik Knop |
P4Ruby implementation of OutputHandler. Also, debug is now treated as a normal attribute and can be read. Test cases still missing. New functionality, to be documented in release notes. |
||
#33 | 14586 | tony |
Streams method tidying. Change P4#streams into P4#streams? as it returns a boolean, and change the implementation to use SetVar() instead of SetProtocol() now that Mark's made it work for us. Change to undocumented functionality |
||
#32 | 14584 | psoccard | Added method to enable streams | ||
#31 | 14583 | psoccard | Added support for -Ztrack | ||
#30 | 14581 | Sven Erik Knop |
Fixed error handling in P4Ruby. The error message string did not get properly set in the exception and P4Message object. This is because theP4API Error class does not have a proper copy constructor. Since it has a decent assignment operator, I gave P4Error an Error field and removed the superclass, which solved the problem and also made the code more readable. I also moved the Reset of the Result object in P4ClientAPI before the connection check, so that 'not connected' can be shown in the exception instead of the previous exception in case the connection is lost. Bug fix to previously unreleased behaviour. |
||
#29 | 14579 | tony |
Make new class P4::Message for returning Error objects to the user. Currently handles errors and warnings, but could potentially be used for output too (might bloat people's code though). Essentially, if you're using a 2010.2 or later client, or if you've set your api_level to 68 or higher, the P4#errors and P4#warnings arrays will be populated with P4::Message objects instead of strings. Users of older API's, or those who set their api_level to 67 or lower in their scripts will get the old behaviour. P4::Message objects have the following methods: severity() - returns the severity generic() - returns the generic code to_s() - converts the message to a string inspect() - returns a string showing the message details. User-visible enhancement documented in p4rubynotes.txt |
||
#28 | 14571 | tony |
Tidy P4Ruby's connection state management. P4ClientApi was accumulating a lot of 'int' flags. This change combines them all into a bitmask with some methods to encapsulate the manipulation of the mask. I've also removed the code which worked around a very old and obscure protocol bug in 2000.1/2000.2 servers. Anyone using a server that old doesn't deserve the modern P4Ruby. To test P4#server_case_sensitive? I have adapted the test suite so that the server it runs uses the -C1 flag - so it's case-folding on all platforms. The reason for this is that it enables the tests to succeed on Windows and Mac OS where case-folding is the norm. Infrastructure change only. No functional change. |
||
#27 | 14570 | tony |
Add new P4#server_unicode? method to P4Ruby. This allows you to test for unicode mode servers once you've executed at least one Perforce command. That's because the server only sends the protocol block in response to the first command these days, and that's when we'll find out if unicode mode is enabled. |
||
#26 | 14564 | tony |
Revise change 214445 (bug fix for incorrectly handled disconnection by the server). The previous change reduced the initCount but in doing so, prevented ClientApi::Final() from being called. This change calls the Disconnect() method instead, and that takes care of both the ClientApi::Final() call, and the decrementing of the initCount User-visible bug fix, documented in p4rubynotes.txt |
||
#25 | 14562 | tony |
Followup to 21449: reset server2 variable on connect too, to ensure that old values aren't used between connect and the first command executed. Well spotted Sven! |
||
#24 | 14560 | tony |
Add a P4#server_case_sensitive? method that returns true if the server is base sensitive, and false otherwise. Raises a P4Exception if it's used before a command has been executed. User-visible enhancement documented in p4rubynotes.txt |
||
#23 | 14559 | tony |
Previously the initCount variable was not being decremented properly when the server disconnects and P4#connected? was called. Now P4#connected will correctly decrement the variable once it sees that the connection has been dropped. User-visible bug fix documented in p4rubynotes.txt |
||
#22 | 14558 | tony |
Add undoc'd P4#protocol( var, val) method for calling ClientApi::SetProtocol(). I would prefer to have named methods for the important protocol variables, or to wrap their use in other ways (see tag and specstring), but for tunables and other ad-hoc settings, sometimes direct access is required. User-visible change, not documented anywhere. |
||
#21 | 14543 | tony |
Pull P4CHARSET initialization fix from p08.2 Integration-only change |
||
#20 | 14541 | tony |
Copyright notice housekeeping: update all notices to 2008, and correct start date from 1997 to 2001 when P4Ruby was first released from the public depot. No functional change |
||
#19 | 14539 | tony |
Make sure P4Ruby picks up P4CHARSET from the environment. Previously, our cached copy of the charset was not being initialised, and that's why it wasn't being picked up. Rather than initialise it, I've chosen to simply eliminate the cached copy, and use ClientApi to store it. Simpler, and more reliable. User-visible bug fix documented in p4rubynotes.txt Note, as the job contains another request, it stays open for now. |
||
#18 | 14531 | tony |
Add P4#env() method to allow users to read the P4 object's environment using the same rules that P4 does. This allows values from P4CONFIG files to be picked up automatically. P4#cwd=() now calls Enviro::Config() to reload any config file when the user changes directory. User-visible enhancement documented in p4rubynotes.txt |
||
#17 | 14526 | tony |
Make P4#charset=( aString ) always raise an exception if the charset specified is invalid. Since the '=' methods always return their arguments, we don't have better way to say no than raising an exception. |
||
#16 | 14521 | tony | Update copyright notices in all applicable P4Ruby files. | ||
#15 | 14513 | tony |
Remove all compatibility code with versions of the API older than 2006.2 from both P4Perl and P4Ruby. We're insisting that people use a 2006.2 or later API for this first release, and will support the current API, and the previous two releases going forward. Also stripped out some reference Ruby code that was still lurking in P4Perl (commented out, obviously). Also ensured that both Makefile.PL and p4conf.rb insist on the minimum API level, and warn the user if they're attempting to build with an even newer release of the API. |
||
#14 | 14512 | tony |
Pass debug down to spec manager. Re-enables spec debugging. No functional change |
||
#13 | 14511 | tony |
Add P4#api_level method to get the current API level. User-visible new feature to be documented in Scripting Interfaces Guide. |
||
#12 | 14505 | tony |
Clear the specMgr on Disconnect() so that if they disconnect, and then switch to a different server and connect again using the same P4 instance (probably not a good idea), then at least we won't cache spec definitions across server connections. |
||
#11 | 14504 | tony |
Disambiguate my specs: rename AddSpec() to AddSpecDef() and HaveSpec() to HaveSpecDef() since those methods deal with manipulating the specdef cache rather than producing specs themselves. |
||
#10 | 14502 | tony |
Rework spec handling somewhat so that: (a) P4Ruby knows about the default spec types for 2007.2 so it doesn't have to connect to the server to parse and format specs, and nor does it have to do the ugly hack of running a 'p4 xxx -o' and discarding the result just to get the specDef. (b) If a user's got a custom spec then the spec cache will be updated if they fetch an object of that type. So basically, if the server's given us a specdef for a class of spec, we use it. Otherwise, we fall back on the builtin defaults This reworks SpecMgr quite a bit - renaming methods so it's clearer what they do, and making it own the spec cache. We also pass the SpecMgr object created by P4ClientApi down to ClientUserRuby now, so that whenever the server sends us a spec, we can update the cache. |
||
#9 | 14501 | tony |
Followup to change 138913: load the default ticket file, or the one specified in P4TICKETS at construction so that value is right from the start. I thought this wasn't possible in the current API because it's not in ClientApi, but using HostEnv and Enviro, it can be done easily. |
||
#8 | 14500 | tony |
Add P4#version= and P4#version methods to get/set the version of the program. User-visible change to be documented in Scripting Interface Guide |
||
#7 | 14498 | tony |
Add P4#ticket_file and P4#ticket_file= methods to get and set the ticket file. Note that P4#ticket_file will only return something if a value has been previously set using P4#ticket_file=(). There's no way, in the existing P4 API to get the current ticket file. User-visible change to be documented in Scripting Interfaces Guide |
||
#6 | 14494 | tony |
Add P4#maxlocktime=( int ) method to allow users to specify the maximum number of milliseconds for which locks may be held. |
||
#5 | 14493 | tony |
Turn on tagged mode by default, and make parse_forms mode always on (it only works when tagged mode is on too). Now users can turn tagged mode off if they want to by calling: p4.tagged = false and turn it back on by calling: p4.tagged = true You can test the current state of affairs using: p4.tagged? User-visible change to be documented in Scripting Interface Guide |
||
#4 | 14487 | tony |
Add P4#connected? to test whether or not the session (a) has been connected and (b) has not been dropped. Functional change to unreleased code. |
||
#3 | 14483 | tony |
Method name rationalisation, part 1. All the methods with names ending with '?' that do not return booleans now have the '?' dropped. This will be used to ensure consistency across the scripting interfaces. Added P4#prog() -> <string> to partner P4#prog=( <string> ) Removed some redundant aliases that we're dropping support for in future versions |
||
#2 | 14481 | tony | Update P4Ruby in main with fixes made to public depot | ||
#1 | 14480 | tony |
Add P4Ruby 1.5944 to main as start-point for the first productized release of P4Ruby |