|#2||16213||perforce_software||Move files to proper depot path to view files correctly from project page.|
This will be a source gem targeted at Linux. Windows support will come after automated builds of the C++ p4api are available for MinGW-w64.
For more information, please review the workshop project:
|#1||14756||tjuricek||p15.1 branch of p4ruby.|
Mirroring the current state of the workshop.
From this point, we will try to rebuild the history of p4-ruby in the workshop from this codeline.
Make P4Ruby aware that a charset of "none" means no charset at all.
Previously, using a P4Ruby >= 2014.2 against a server at least as new
could result in getting 'Unicode clients require a unicode-enabled server'
errors in appropriately. This was because we were treating 'none' as
a character set and enabling unicode mode on the client with that as
the charset to use for file content.
With the advent of .p4enviro files, this problem has been cropping up
frequently as that is the default value supplied when talking to a non-unicode
With this change, we now detect 'none' and use it to disable translation
as the user, and .p4enviro file no doubt intended.
2014.2.0.pre5 - Clearing the charset (calling ClientApi::SetTrans(0)) if the charset property is nil or none during construction.
Changed README to use the correct incantation of --with-p4api-dir. Additionally, fixed an issue using that option in lieu of the ftp.perforce.com download.
Also, removing any embedded distribution of the p4api. RubyGems sets a strict file size limit, which means we won't be able to distribute the C++ API embedded through their site.
Imported from Git
Author: Tristan Juricek <email@example.com> 1423518911 -0800
Committer: Tristan Juricek <firstname.lastname@example.org> 1423518911 -0800
Clear the charset setting by setting it to nil in ruby-land if the charset is detected to be 'none'.
If the user happens to have set the value to 'none' in a config file, or it's otherwise specified, it appears the underlying charset detection mechanism in the C++ API treats it as an encoding. So, by setting it to 'nil' directly in the ruby code, we'll make the correct call to SetCharset(0) as the user probably intends.
Imported from Git
Author: Tristan Juricek <email@example.com> 1423002926 -0800
Committer: Tristan Juricek <firstname.lastname@example.org> 1423002926 -0800
Set up call to 'rake cross native gem' as the main build step now.
This utilizes the 'cross compile' feature where we can build multiple versions of ruby under one gem package, though it's really going to be used for 'direct compilation'. The following variables need to be set to run the tools/build_p4ruby.sh now:
* RUBY_USE_VERSION - Should be the rvm version with the gem for publishing to geminabox
* RUBY_CC_VERSION - The colon (:) delimited string of ruby versions to build - each version should be installed via RVM and registered in ~/.rake_compiler/config.yml
* P4RUBY_CROSS_PLATFORM - The platform ID we are building on, needs to be set, e.g., 'x86_64-linux', 'i686-linux', 'x86_64-darwin-11'. Note that OS X uses the darwin 'version'.
Imported from Git
Author: Tristan Juricek <email@example.com> 1421184895 -0800
Committer: Tristan Juricek <firstname.lastname@example.org> 1421184895 -0800
Git Fusion branch management
Imported from Git
Fix p4ruby test run so it also includes the current directory in the
library search path. This helps us pick up the P4.so we're testing.
Also fixed some minor gripes and backed out a previous change that
obviously didn't work under 1.8
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.
YAC to P4#run_tickets
Change in format to return an array of keyed hashes.
'Ticket' => 'D6EBA4584B635E19EA579E33EB0195DA',
'User' => 'pallen',
'Host' => 'localhost:2003'
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):
def description(description, units )
def total( total )
def update( position )
def done( fail )
Users need to create a subclass of P4::Progress and assign an instance to P4
to enable the progress indicator:
class MyProgress < P4::Progress
# do something with the value here
# other methods
p4 = P4.new
p4.progress = MyProgress.new
New feature to be documented in the release notes.
Follow-on to change 500964
Forgot to submit unit test updates. Also, instead of returning nil for a directory or non-existent file, it seems more consistent to return an empty array.
rename to P4#run_tickets
Also, instead of each line being an element in the array, the array contains
a single Hash, with each ticket entry as a separate element in the hash.
Ensure iterator args are passed on
Forgot to pass on any arguments that the user may have supplied to their call
to 'each_<spec>'. Fixed this and also added a test for it.
Generic each_* methods
Simple method to iterate over a particular type of spec
This is a convenient wrapper for the pattern:
clients = p4.run_clients
client = p4.fetch_client( c['client'] )
<do something with spec>
NOTE: It's not possible to implicitly pass a block to a
delegate method, so I've implemented it here directly. Could use
Proc.new.call, but it looks like there is a serious performance
impact with that method.
job056520 : spec iterator implementation
Implement P4#tickets for P4Ruby
P4#tickets checks P4#ticket_file, if it's a directory or does not exist it just
returns 'nil'. Otherwise it iterates over the file and inserts each line into
an array of hashes. Each hash is a single ticket entry:
key: ticket key (hostname:port=user)
value: ticket value
Update unit test to test new functionality.
Fix P4.run_submit( P4::Spec )
Ruby 1.9 changed Array.flatten, so that it called 'to_ary'. This
caused problems for P4Ruby (with Ruby 1.9) and would cause
P4.run_submit, P4.run_shelve, etc to fail with:
`method_missing': undefined method `to_ary' for object of class P4::Spec (RuntimeError)
if it was passed a P4::Spec object as an argument.
P4::Spec now checks (in 'method_missing') if it's trying to run
'to_ary', and it raises 'NoMethodError' if it is.
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.
Added P4#run_shelve and P4#delete_shelve as special cases - similar to P4Python.
P4#run_shelve allows passing in of a hash, assumed to be a changelist (i.e
shelvelist) spec, similar to P4#run_submit.
P4#delete_shelve adds an extra "-c" to the arguments before the shelve list number
if "-c" is not already in the argument list.
User-visible changes to be documented in the release notes.
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
Add P4#inspect method so you get some information about the object
when using irb.
User-visible change, not documented anywhere (unsupported).
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
Pull 2007.3 p4-ruby changes back to main.
Integration only change
|#9||14521||tony||Update copyright notices in all applicable P4Ruby files.|
Make P4::Revision attributes numbers if they're entirely
composed of numbers (saves the user doing it).
Rename P4Ruby's P4DepotFile, P4Revision, and P4Integration classes
to be P4::DepotFile, P4::Revision and P4::Integration respectively.
Also changed P4Ruby's P4::Revision class to store arbitrary
attributes of revisions, which should help with server compatibility.
Note that P4Perl's already did that, so this just ports those changes
Also, changed the method name in P4Perl's class from
as that's a better name for it. P4Ruby's equivalent is called
User-visible change to be documented in Scripting Interfaces Guide
Fix old call to exception_level? that should have been changed
to 'exception_level' a while back.
Bug fix to previous unreleased change
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:
User-visible change to be documented in Scripting Interface Guide
Rename P4#input to P4#input=, and fix all pre-existing calls. The
main existing callers are p4.run_password, p4.run_submit and
and p4.run_login. There was also a bug with p4.run_password() which
meant that you couldn't change a user's password if they hadn't
already set one. Fixed that while I was there and added a test
case to check that password setting, use and clearing works.
Rename P4#submit_spec to P4#run_submit. So now run_submit
can take a variety of arguments, but if any of them are Hash
or P4::Spec objects then they get converted into strings and
a '-i' gets added to the submit args.
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
Add P4Ruby 1.5944 to main as start-point for the first
productized release of P4Ruby