3 =head1 NAME $RCSfile: Baseline.pm,v $
5 Object oriented interface to UCM Streams
13 Andrew DeFaria <Andrew@ClearSCM.com>
21 Fri May 14 18:16:16 PDT 2010
25 $Date: 2011/11/15 01:59:07 $
31 Provides access to information about Clearcase Elements.
33 my $stream= new Clearcase::UCM::Stream ($name, $pvob);
37 This module implements a UCM Stream object
41 The following routines are exported:
45 package Clearcase::UCM::Baseline;
53 my ($self, %opts) = @_;
58 if ($_ eq 'cq' or $_ eq 'cqe' or $_ eq 'force' or $_ eq 'nc') {
60 } elsif ($_ eq 'c' or $_ eq 'cfile') {
61 $opts .= "-$_ $opts{$_}";
70 my ($class, $baseline, $pvob) = @_;
76 Construct a new Clearcase Stream object.
80 =for html <blockquote>
90 =for html </blockquote>
94 =for html <blockquote>
98 =item Clearcase Stream object
102 =for html </blockquote>
121 Returns the name of the stream
125 =for html <blockquote>
133 =for html </blockquote>
137 =for html <blockquote>
145 =for html </blockquote>
149 return $self->{name};
159 Returns the pvob of the stream
163 =for html <blockquote>
171 =for html </blockquote>
175 =for html <blockquote>
183 =for html </blockquote>
187 return $self->{pvob};
191 my ($self, $view, $comment, $opts) = @_;
197 Creates a new UCM Baseline Object
201 =for html <blockquote>
207 Options: Additional options to use
211 =for html </blockquote>
215 =for html <blockquote>
221 Status from cleartool
229 =for html </blockquote>
235 $comment = Clearcase::_setComment $comment;
237 return $Clearcase::CC->execute(
238 "mkbl $comment $opts -view " . $view->tag . ' ' . $self->{name}
243 my ($self, $opts) = @_;
253 =for html <blockquote>
261 Options: Additional options to use (e.g. -c, -force, etc.)
265 =for html </blockquote>
269 =for html <blockquote>
275 Remember to check status method for error, and/or output method for output.
279 =for html </blockquote>
285 return $Clearcase::CC->execute(
286 "rmbl $opts -force " . $self->{name} . '@' . $self->{pvob}->name
297 Returns a hash of the attributes associated with a baseline
301 =for html <blockquote>
309 =for html </blockquote>
313 =for html <blockquote>
319 Hash of attributes for this baseline
323 =for html </blockquote>
327 return $self->Clearcase::attributes(
329 "$self->{name}\@" . $self->{pvob}->name
334 my ($self, $type, $baseline, %opts) = @_;
340 Returns a hash of information regarding the difference between two baselines or
341 a baseline and the stream (AKA "top of stream").
345 =for html <blockquote>
349 =item [activities|versions|baselines]
351 Must specify one of [activities|versions|baselines]. Information will be
352 returned based on this parameter.
354 =item $baseline or $stream
356 Specify the baseline or stream to compare to. If not specified a -predeccsor
357 diffbl will be done. If a stream use "stream:<stream>" otherwise use
358 "baseline:<baseline>" or simply "<baseline>".
366 =for html </blockquote>
370 =for html <blockquote>
376 Depending on whether activites, versions or baselines were specified, the
377 returned hash will be constructed with the key being the activity, version
378 string or baseline name as the key with additional information specified as the
383 =for html </blockquote>
387 unless ($type =~ /^activities$/i or
388 $type =~ /^versions$/i or
389 $type =~ /^baselines$/i) {
390 croak "Type must be one of activities, versions or baselines in "
391 . "Clearcase::UCM::Baseline::diff - not $type";
394 my $myBaseline = "$self->{name}\@$self->{pvob}";
396 my $cmd = "diffbl -$type";
399 if ($baseline =~ /(\S+):/) {
400 unless ($1 eq 'baseline' or $1 eq 'stream') {
401 croak "Baseline should be baseline:<baseline> or stream:<stream> or "
406 $baseline .= "\@$self->{pvob}" unless $baseline =~ /\@/;
408 $cmd .= " $myBaseline $baseline";
410 $cmd .= " -predeccsor";
413 $Clearcase::CC->execute($cmd);
415 return if $Clearcase::CC->status;
417 my @output = $Clearcase::CC->output;
422 next unless /^(\>\>|\<\<)/;
424 if (/(\>\>|\<\<)\s+(\S+)\@/) {
425 $info{$2} = Clearcase::UCM::Activity->new($2, $self->{pvob});
436 =head2 ClearSCM Perl Modules
438 =for html <p><a href="/php/scm_man.php?file=lib/Clearcase.pm">Clearcase</a></p>
440 =head1 INCOMPATABILITIES
444 =head1 BUGS AND LIMITATIONS
446 There are no known bugs in this module.
448 Please report problems to Andrew DeFaria <Andrew@ClearSCM.com>.
450 =head1 LICENSE AND COPYRIGHT
452 Copyright (c) 2007, ClearSCM, Inc. All rights reserved.