P4Ruby Changelog

What's new in P4Ruby 2012.2

Aug 8, 2013
  • New functionality:
  • Added P4#run_tickets() method to list local tickets. Note that P4.run('tickets') still gives the old error message "Must upgrade to 2004.2 p4 to access tickets."
  • Support for the new progress indicator API. P4Ruby supplies a new progress attribute, which can take an instance of P4::Progress class or subclass. Progress information is currently only supported for submits and 'sync -q'. Details can be found in the documentation.
  • New convenience method P4#each_() that allows easy iteration through some or all spec objects such as clients or changes. Details can be found in the documentation.
  • Bugs fixed:
  • Building P4Ruby with MinGW could generate the link error.
  • g++: unrecognized option '-static-libstdc++'
  • This has been fixed.
  • P4#parse_client could raise the exception "Unknown field name 'StreamAtChange'." when parsing a stream client workspace. Internal spec definition has been updated to resolve this.

New in P4Ruby 2012.1 (Aug 8, 2013)

  • New functionality:
  • P4Ruby supports SSL connections if compiled with SSL support. Instructions on how to compile with SSL support can be found at the top of this document under "Building P4Ruby from Source" and in the documentation.
  • P4.identify will report the version of the OpenSSL library used to build the Perforce C++ API (not the version P4Ruby is linked against).
  • P4Ruby will now only build a 64-bit version of the library on Darwin.
  • Enable "action resolve" to support resolves of branches, deletes and file types. The existing P4::MergeData class has been extended and the additional attributes will be populated for an 'action resolve'. Details of the
  • additional attributes can be found in the documentation.
  • Bugs fixed:
  • Accessing the base_name attribute of a P4::MergeData object resulted in a segmentation fault when resolving binary files. This has now been fixed and all empty fields will return Nil.
  • Exceptions thrown during P4.run_resolve are now raised up to the user. If an exception is encountered during the block's execution, P4Ruby will skip the remaining files.

New in P4Ruby 2011.1 (Aug 8, 2013)

  • New functionality in 2011.1
  • #405913 *
  • New method P4#messages() returns all messages from the server as objects. Script writers can test the severity of the messages to know if they are output messages (E_INFO), warnings (E_WARN), or errors (E_FAILED/E_FATAL).
  • P4#errors() and P4#warnings still return the errors and warnings as strings for backwards compatibility.
  • P4::Message objects have the following methods:
  • P4::Message#severity- Returns the severity of the message, which may be one of the following values:
  • E_EMPTY# nothing yet
  • E_INFO# something good happened
  • E_WARN# something not good happened
  • E_FAILED# user did something wrong
  • E_FATAL# system broken -- nothing can continue
  • P4::Message#generic- Returns the generic class of the error, which may be one of the following values:
  • EV_NONE# misc
  • EV_USAGE# request not consistent with dox
  • EV_UNKNOWN# using unknown entity
  • EV_CONTEXT# using entity in wrong context
  • EV_ILLEGAL# trying to do something you can't
  • EV_NOTYET# something must be corrected first
  • EV_PROTECT# protections prevented operation
  • EV_EMPTY# action returned empty results
  • EV_FAULT# inexplicable program fault
  • EV_CLIENT# client side program errors
  • EV_ADMIN# server administrative action required
  • EV_CONFIG# client configuration inadequate
  • EV_UPGRADE# client or server too old to interact
  • EV_COMM# communications error
  • EV_TOOBIG# not even Perforce can handle this much
  • P4::Message#msgid- Return the unique ID of the message.
  • P4::Message#to_s- Convert the object to a string
  • P4::Message#inspect- Debugging support
  • P4Ruby supports setting values in the registry (on those
  • platforms that support it).
  • The command P4#set_env( var, val ) will set a registry variable on platforms that support this action or raise a P4Exception for those that don't.
  • The command P4#set_env( var, "" ) unsets a registry variable.
  • P4Ruby now supports Ruby 1.9
  • P4Ruby can now be compiled with the Mingw compiler using the MinGW P4Api build.
  • Enable streams in P4Ruby by default. With this change, streams specific specs such as streams depots are listed. Disable the listing of streams specific specs by either setting the api_level to a value below 70 or by disabling stream handling explicitly through the P4.streams attribute:
  • p4.streams = false
  • P4Ruby supports a callback interface by providing a P4#handler attribute. Set P4#handler to an instance of a subclass of P4::OutputHandler to enable callbacks. When a handler is defined, P4Ruby will invoke the handler for every response it receives from the Perforce Server immediately instead of collecting all results together in an array first. This can be used to make applications more scalable and more responsive if large results are expected.
  • See the documentation for details on the OutputHandler class.
  • Bugs fixed:
  • Running 'print' on a file that started with '---' would cause an exception in Ruby. This is now fixed. There is still an oddity when p4.track = 1 and a user runs p4.run_print() on a file that only has lines starting with '--- '. In that case, the output of the print is lost. Disable tracking by setting p4.track = 0 (the default) will solve this problem.
  • Info messages now shown in P4#Messages.
  • On Windows Vista, Windows 7, or Windows 2008, a client running as Administrator would fail to properly process file names in non-ASCII character sets (such as Shift-JIS).
  • Extra dot at the end of the extracted directory path has been removed.
  • P4#identify() reports the platform on AMD64 as X86_64 in line with all other Perforce products.
  • Updated the stored spec templates for client, change, group, spec and user. Added spec template for new spec type streams. These are required, for example, for form-triggers that do not connect to the server first.
  • Include 'extraTag' fields in P4::Spec objects
  • P4#identify() now reports P4Ruby as P4RUBY in line with all other Perforce products. It will also include the build number of the Perforce C/C++ API that it is built with.