Change 4680

tony_smith (Tony Smith)
Tony Smith committed this change into //guest/tony_smith/perforce/API/Ruby
Request Review
Download .zip
Make P4Ruby return new P4::Spec objects instead of plain old
hashes when parse_forms mode is in use. A P4::Spec object is derived
from Hash so should be backwards compatible with previous code.

P4::Spec provides limited fieldname validation on forms and
accessor methods for quick and easy access to the fields in the
form. The accessor methods are all prefixed with '_' to avoid
colliding with methods from the Hash parent class. This is a little
ugly, but deriving from hash is a big win, so it's worth it.

This change also fixes a minor bug found along the way. Spec parsing
and formatting wouldn't work with labels, branches, depots and groups
unless you'd previously run a P4::fetch_label( <label> ),
P4::fetch_branch( <branch> ) etc. etc. This is because the spec
parsing code internally runs one of these commands in order to grab
the specdef from the server but it wasn't providing a spec name. i.e.
it was using 'p4 client -o' and assuming that this would work for
other types of spec too. It does, but not for all spec types. So,
now the spec parsing code will use a bogus name for the spec types
that require it.
  • Files 18
  • Comments 0
15 edited 3 added 0 deleted
current/P4Ruby.tar.gz#30
Loading...
main/Changes#36
Loading...
main/MANIFEST#5
Loading...
main/clientuserruby.cpp#13
Loading...
main/clientuserruby.h#14
Loading...
main/doc/P4.html#12
Loading...
main/doc/P4DepotFile.html#6
Loading...
main/doc/P4Exception.html#6
Loading...
main/doc/P4Integration.html#6
Loading...
main/doc/P4Revision.html#6
Loading...
main/doc/P4Spec.html#1
Loading...
main/doc/index.html#8
Loading...
main/lib/P4.rb#17
Loading...
main/p4clientapi.cpp#8
Loading...
main/p4clientapi.h#15
Loading...
main/p4rb_version.h#38
Loading...
main/specmgr.cpp#1
Loading...
main/specmgr.h#1
Loading...
Tip: Use n and p to cycle through the changes.