GenSpecMgr subclass for Labels. Labels differ
slightly from the generic model in that we also archive the file list for
the label.
Constructor. Provide the client root and tagged and non-tagged P4 client
instances.
# File specsaver.rb, line 314
def initialize( root, p4t, p4u )
super( "label", root, p4t, p4u )
end
Override SpecMgr#update() so that we can archive the file list as well as
the spec
# File specsaver.rb, line 322
def update( since )
list_specs.each do
|l|
if ( changed?( l, since ) )
save_spec( "label", l )
save_files( l[ "label" ] )
end
end
submit( description() )
end
Protected Instance methods |
Method to save the file list for a label. Appends ".files" to the
label name and saves the output of "p4 files //...@label" there.
# File specsaver.rb, line 339
def save_files( label )
filename = @root + "/labels/" + label + ".files"
files = @p4t.run_files( "//...@#{label}" ).collect do
|l|
l[ "depotFile" ] + "#" + l[ "rev" ]
end
add_edit_file( filename, label )
write_ws_file( filename, files.join( "\n" ) )
end