specmgr.cpp #24

  • //
  • guest/
  • perforce_software/
  • p4ruby/
  • main/
  • specmgr.cpp
  • Commits
# Change User Description Committed
#24 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
#23 14660 tony Update P4Ruby's spec maps for 2014.1.
#22 14653 jmistry Merging p12.2 changes to main

Integration only change.
#21 14649 jmistry Pull 12.1 fixes to main

Integration only change
#20 14632 jmistry Update P4Ruby spec manager to 12.1 specs.
#19 14624 jmistry Pull p11.1 changes back to main
#18 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.
#17 14615 psoccard Propagated spec field update
#16 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.
#15 14602 jmistry Update specdefs in SpecMgr to 2011.1

User visible change, to be documented in the release notes.
#14 14596 jmistry Include 'extraTag' val in P4::Spec

The tagged output of a stream spec includes an 'extraTag<n>' field. 
This change ensures that the field pointed to by 'extraTag' (such as
'firmerThanParent') is added to the P4::Spec object and it points
to the correct value.

Test case updated to check for 'firmerThanParent' in stream P4::Spec.
The test case needs to disconnect/connect, otherwise P4.run_streams
returns with the warning 'No such streams'.
#13 14592 Sven Erik Knop Enable P4-Ruby to compile and test with Ruby 1.9.

The current solution is far from ideal because it is not possible to compile
and test both Ruby 1.8 and Ruby 1.9 in parallel. The Makefile writes both
artifacts and binaries to the same location.

This means a user/tester/builder needs to choose on Ruby platform or ensure
'make clean' is called first.

Many of the test cases also still fail in Ruby 1.9. We also need to investigate
the Unicode story with Ruby 1.9 and see if the lessons learned from Python 3
can be applied somehow.

Infrastructure change, no functional change yet.
#12 14550 tony Remove redundant SpecMgr instance spotted by Sven Erik.
#11 14549 tony Followup to 191623, which inadvertently caused P4#parse_spec to return
a ruby hash instead of a P4::Spec object. This change corrects that.

Bug fix to earlier unreleased bug fix.
#10 14544 tony Enable P4Ruby to handle jobspec fields with names that end in
numbers. Previously these were mistaken for entries in list
fields (wlist, llist).

This change introduces SpecDataRuby, a subclass of SpecData that
reads from/writes to Ruby P4::Spec objects. That makes it a snap
to parse and format specs using the same code the server does,
and that fixes this bug very neatly, and probably makes it faster
too.

I've also replaced the manual parsing of the specdef strings with
an implementation that uses the Spec, and SpecElem classes. That's
also going to be more reliable in the long run.

This change will be ported to P4Perl, P4Python, and should probably
also go into the upcoming P4PHP.

User-visible bug fix documented in p4rubynotes.txt
#9 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
#8 14529 tony Pull 2007.3 p4-ruby changes back to main.

Integration only change
#7 14521 tony Update copyright notices in all applicable P4Ruby files.
#6 14517 tony Dodge Windows porting issue by renaming 'struct spec' to
'struct defaultspec' because Windows' lame-o compiler can't
disambiguate 'struct spec' and 'class Spec' because its namespace
appears to be case folding.
#5 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.
#4 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.
#3 14503 tony Followon to previous change.
Remove overloaded SpecMgr::SpecToString()
as, now that ClientUserRuby knows which command we're running, we can
dispense with it.
#2 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.
#1 14480 tony Add P4Ruby 1.5944 to main as start-point for the first
productized release of P4Ruby