Details
-
New Feature
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
None
-
Windows
Description
When using the ClearCase UCM integration of the SCM module the stream's foundation contains a set of baselines that can be analysed for components.
It's possible to find out which project the stream belong to and the in the project setting read the policy of the project - including the modifiable components.
For each component it's possible to get it's components root-dir.
SO based on that analysis it's possible to NOT REQUIRE the job to explicitly list the load rules to use, but simply give the user three options:
1) Type load rules manaully (as is today)
2) Automatically load modifiable components from the foundation (new)
3) Automatically load all components from the foundation (new)
Options 2+3 would probably cover 95+% of all valid scenarios.
...And users would never have to type in a single load rule - ever again
We already have this setup in perl code - we're willing to migrate to Java and add it to the module - Please give feed back if you would like to see this feature - or if we're the only ones hating to type in load rules in Hudson Jobs?
Hi - It's me again.
Just wanted to attach this snippet of code - it's how we do it in our perl script:
Yes it's in perl and java isn't perl ...but it's really all about cleartool commands - isn't it?
sub get_load_rules($){
=pod
=head2 get_load_rules($fullyqualified__stream)
Find and return the load rules for the stream.
Return:
Load rules.
=cut
my $fq_stream = shift;
my @comps;
if ($sw_loadall){
my $cmd = "cleartool desc -fmt %[latest_bls]p $fq_stream";
#output is a white-space separated list of bls
foreach my $bl (split(/\s+/,execute($cmd))) { chomp($bl); $cmd = "cleartool desc -fmt \%[component]p baseline:$bl\@".DEFAULT_PVOB; $_ = execute($cmd); #At this point $_ caches the component $cmd = "cleartool desc -fmt \"\%[root_dir]p \" component:$_\@".DEFAULT_PVOB; $_ = execute($cmd); # Now $_ contains the root dir+the component name ...almost there now s/^\\//; # Get rid of the backslash from the root-dir which isn't used in load rules (they are relative) push @comps, $_; }
;
} else {
my $project = execute("cleartool desc -fmt %[project]p $fq_stream");
foreach my $comp (split(/\s+/,execute("cleartool desc -fmt %[mod_comps]p project:$project@".DEFAULT_PVOB)))
{ $_ = execute("cleartool desc -fmt \"\%[root_dir]p \" component:$comp\@".DEFAULT_PVOB); s/^\\//; push @comps, $_; };
}
my $retval = join ("", @comps);
return $retval;
};