Release Notes for P4Perl, the Perl interface to the Perforce SCM System GA Release 2008.1 July 01, 2008 Introduction This document lists all user-visible changes to P4Perl from release 2007.3, the first supported P4Perl release. Perforce numbers releases YYYY.R/CCCCC, e.g. 2002.1/30547. YYYY is the year; R is the release of that year; CCCCC is the bug fix change level. Each bug fix in these release notes is marked by its change number. Any build includes (1) all bug fixes of all previous releases and (2) all bug fixes of the current release up to the bug fix change level. To determine the version of your P4Perl, issue the following command: perl -MP4 -e "print P4::Identify()" Installing P4Perl Windows users can download an installer for P4Perl from the Perforce FTP site. Users on other platforms must build from source. Building P4Perl from Source 1. Download a suitable Perforce API build from the Perforce FTP site. 2. Extract the API tarfile into an empty directory. 3. Issue the following commands: perl Makefile.PL --apidir make (on UNIX) nmake (on Windows) make test (on UNIX) nmake test (on Windows) NOTE: The test harness requires that 'p4d' be installed and in the PATH 4. To install P4Perl, run the following command. On UNIX systems, this step must be run as root: make install (on UNIX) nmake install (on Windows) Compatibility Statements 1. Server Compatibility Unless stated otherwise you can use any release of P4Perl with any release of the Perforce server later than 2001.1 2. API Compatibility The 2008.1 release of P4Perl supports the 2008.1 Perforce API. Older releases (down to 2006.2) might work but are not supported. 3. Perl compatibility The 2008.1 release of P4Perl is compatible with Perl 5.8 when built from source. The build included in the Windows installer is compatible with ActivePerl 5.8.8 build 822. 4. Platform compatibility While P4Perl is generally portable, this release is certified only on the following platforms: Linux 2.6 x86 Solaris 10 x86 NT x86 FreeBSD 6 x86 Mac OSX 10.5 x86 5. Compiler Compatibility To build P4Perl from source, you MUST use a version of Perl that has been compiled with the same compiler used to build the Perforce C++ API: for most platforms, use gcc/g++. Attempting to use a different compiler or a different version of the compiler will probably result in linker errors due to differences in name handling between compilers. On Windows platforms, Visual Studio 2003 must be used to compile P4Perl. Most Windows users can use the Windows Installer available from the Perforce web site. 6. Compatibility with Previous Releases There are no previous releases of P4Perl from Perforce Software Inc. 7. Compatibility with P4Perl from the Public Depot Perforce P4Perl is significantly different from the version of P4Perl in the Perforce Public Depot. There have been numerous improvements, and several interface changes intended to make P4Perl consistent with the other scripting interfaces. If you are migrating from the Public Depot version of P4Perl, edit your scripts to ensure that they comply with the new interface. The differences are detailed below. Deleted Methods The following methods have been deleted from the P4 class and are no longer available: Dropped() - Use IsConnected() Final() - Use Disconnect() Init() - Use Connect() IsParseForms() - Form parsing is now always on MergeErrors() - Errors and warnings are now separate ParseForms() - Form parsing is now always on Tag() - Tagged mode is on by default [see Tagged()] New Methods The following methods are new to P4Perl. GetApiLevel() - Returns the API compatibility level P4ConfigFile() - Returns the path of the P4CONFIG file IsConnected() - Returns true if the client is connected Debug() - Sets the debug level GetMaxResults() - Returns the current maxresults limit GetMaxScanRows() - Returns the current maxscanrows limit GetMaxLockTime() - Returns the current maxlocktime limit SetMaxLockTime() - Sets the current maxlocktime limit GetProg() - Returns the name of the program (if set) ServerLevel() - Returns the (numeric) level of the server GetTicketFile() - Returns the path to the current ticket file SetTicketFile() - Sets the path to the current ticket file GetVersion() - Returns the version of the script SetVersion() - Sets the version of the script Renamed Methods In the Public Depot version of P4Perl, any method that was not known was assumed to be a Perforce command and executed accordingly. For example, you were able to issue a 'p4 info' command as follows: $p4->Info(); This approach caused problems with keywords like 'client', which is both a command, and a setting in the client environment (P4CLIENT). To resolve this ambiguity and to make P4Perl consistent with other Perforce scripting interfaces, this convention has been changed. In Perforce P4Perl, methods with names prefixed with 'Run' are assumed to be Perforce commands. For example: $p4->RunInfo(); Tagged Mode and Form Parsing In the Public Depot version of P4Perl, tagged output and form parsing mode were off by default but most scripts turned them on immediately. In Perforce P4Perl, both form parsing and tagged output are on by default. Form parsing cannot be explicitly disabled, but tagged output may be turned on and off at will by using: $p4->Tagged( 0 ); # Disabled $p4->Tagged( 1 ); # Enabled Because form parsing does not work when tagged output is disabled, this method can be used to disable form parsing. Calling Tagged() without a parameter is no longer valid. Most users can simply delete any old calls to Tagged() from their scripts. Previously it was not possible to disable tagged output after enabling it. Key to symbols used in change notes below. * -- requires new P4Perl ** -- requires P4Perl built with new P4API *** -- requires new p4d server program -------------------------------------------------------------------------------- Release 2008.1 New Functionality in 2008.1 # 152357 * The 'P4::GetEnv( $var )' method has been added to the P4 class. This instance method enables the caller to interrogate the Perforce environment, including reading Perforce variables from P4CONFIG files and, on Windows, the registry. P4::SetCwd() now loads any P4CONFIG file settings that are appropriate to the new working directory. (SIR #25063) # 151525 * P4Perl now returns P4::Spec objects from all methods that parse Perforce forms. A P4::Spec object is a blessed hash reference, so most existing code is unaffected. Code that iterates over all members of the hash must skip the new '_fields_' member. This member variable is used to store a list of field names that are valid in forms of that type. This approach enables accessor methods for the fields in the form. Simply call a method with the name of the field you want to get or set prefixed with an underscore (_). For example: $client->_Root(); # Get client root $client->_Root( $newroot ); # Set client root Updating the hash directly is still supported and is equivalent to using the method-based interface. # 158308 * P4Perl now supports Mac OS X 10.5. (SIR #29309) -------------------------------------------------------------------------------- Bugs Fixed since first release (2007.3/147242) #150578 * The presence of deleted revisions in a file's history might cause the fileSize and digest attributes to be incorrect for other revisions in the output of P4::RunFilelog(). This problem occurred because a digest and file size were allocated to the deleted revision. This problem has been corrected. (Bug #28760)