3 =head1 NAME $RCSfile: Stream.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 02:00:58 $
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::Stream;
51 use Clearcase::UCM::Baseline;
54 my ($class, $stream, $pvob) = @_;
60 Construct a new Clearcase Stream object.
64 =for html <blockquote>
74 =for html </blockquote>
78 =for html <blockquote>
82 =item Clearcase Stream object
86 =for html </blockquote>
92 pvob => Clearcase::vobtag $pvob,
105 Returns the name of the stream
109 =for html <blockquote>
117 =for html </blockquote>
121 =for html <blockquote>
129 =for html </blockquote>
133 return $self->{name};
143 Returns the pvob of the stream
147 =for html <blockquote>
155 =for html </blockquote>
159 =for html <blockquote>
167 =for html </blockquote>
171 return $self->{pvob};
175 my ($self, $project, $pvob, $baseline, $opts) = @_;
181 Creates a new UCM Stream Object
185 =for html <blockquote>
189 =item UCM Project (required)
191 UCM Project this stream belongs to
193 =item PVOB (Required)
199 Baseline to set this stream to
203 Options: Additional options to use (e.g. -readonly)
207 =for html </blockquote>
211 =for html <blockquote>
217 Status from cleartool
225 =for html </blockquote>
229 # Fill in object members
230 $self->{project} = $project;
231 $self->{pvob} = $pvob;
235 $opts .= " -baseline $baseline"
238 $self->{readonly} = $opts =~ /-readonly/;
240 # TODO: This should call the exists function
241 # Return the stream name if the stream already exists
242 my ($status, @output) =
243 $Clearcase::CC->execute ('lsstream -short ' . $self->{name});
245 return ($status, @output)
248 # Need to create the stream
249 return $Clearcase::CC->execute
250 ("mkstream $opts -in " . $self->{project} .
251 "\@" . $self->{pvob} .
252 ' ' . $self->{name});
266 =for html <blockquote>
270 =item UCM Project (required)
272 UCM Project this stream belongs to
274 =item PVOB (Required)
280 Baseline to set this stream to
284 Options: Additional options to use (e.g. -readonly)
288 =for html </blockquote>
292 =for html <blockquote>
298 Status from cleartool
306 =for html </blockquote>
310 return $Clearcase::CC->execute
311 ('rmstream -f ' . $self->{name} . "\@" . $self->{pvob});
321 Returns baseline objects associated with the stream
325 =for html <blockquote>
333 =for html </blockquote>
337 =for html <blockquote>
343 An array of baseline objects for this stream
347 =for html </blockquote>
351 my $cmd = "lsbl -short -stream $self->{name}\@$self->{pvob}";
353 $Clearcase::CC->execute ($cmd);
355 return if $Clearcase::CC->status;
359 foreach ($Clearcase::CC->output) {
360 my $baseline = Clearcase::UCM::Baseline->new ($_, $self->{pvob});
362 push @baselines, $baseline;
372 =head2 ClearSCM Perl Modules
374 =for html <p><a href="/php/scm_man.php?file=lib/Clearcase.pm">Clearcase</a></p>
376 =for html <p><a href="/php/scm_man.php?file=lib/Clearcase/UCM/Baseline.pm">Clearcase::UCM::Baseline</a></p>
378 =head1 INCOMPATABILITIES
382 =head1 BUGS AND LIMITATIONS
384 There are no known bugs in this module.
386 Please report problems to Andrew DeFaria <Andrew@ClearSCM.com>.
388 =head1 LICENSE AND COPYRIGHT
390 Copyright (c) 2007, ClearSCM, Inc. All rights reserved.