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 Streams.
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 my ($class, $name, $pvob) = @_;
57 Construct a new Clearcase Stream object.
61 =for html <blockquote>
75 =for html </blockquote>
79 =for html <blockquote>
83 =item Clearcase Stream object
87 =for html </blockquote>
106 Returns the name of the stream
110 =for html <blockquote>
118 =for html </blockquote>
122 =for html <blockquote>
130 =for html </blockquote>
134 return $self->{name};
144 Returns the pvob of the stream
148 =for html <blockquote>
156 =for html </blockquote>
160 =for html <blockquote>
168 =for html </blockquote>
172 return $self->{pvob};
176 my ($self, $project, $opts) = @_;
182 Creates a new UCM Stream Object
186 =for html <blockquote>
192 Project that this stream will be created in
196 Options: Additional options to use (e.g. -baseline/-readonly)
200 =for html </blockquote>
204 =for html <blockquote>
210 Status from cleartool
218 =for html </blockquote>
222 return (0, ()) if $self->exists;
226 $self->{readonly} = $opts =~ /-readonly/;
228 return $Clearcase::CC->execute(
229 "mkstream $opts -in "
230 . $project->name . '@' . $self->{pvob}->tag . ' '
231 . $self->name . '@' . $self->{pvob}->tag
246 =for html <blockquote>
252 =for html </blockquote>
256 =for html <blockquote>
262 Status from cleartool
270 =for html </blockquote>
274 return $Clearcase::CC->execute
275 ('rmstream -f ' . $self->{name} . '@' . $self->{pvob}->name);
279 my ($self, $baseline, $opts) = @_;
289 =for html <blockquote>
295 Baseline to rebase to
303 =for html </blockquote>
307 =for html <blockquote>
313 Status from cleartool
321 =for html </blockquote>
327 $opts .= ' -baseline ' . $baseline .
328 ' -stream ' . $self->name . '@' . $self->{pvob}->name;
330 return $Clearcase::CC->execute("rebase $opts");
334 my ($self, $baseline) = @_;
340 Recommends a baseline in a UCM Stream
344 =for html <blockquote>
350 Baseline to recommend
354 =for html </blockquote>
358 =for html <blockquote>
364 Status from cleartool
372 =for html </blockquote>
376 return $Clearcase::CC->execute(
377 "chstream -recommended $baseline " . $self->name . '@' . $self->{pvob}->tag
388 Returns baseline objects associated with the stream
392 =for html <blockquote>
400 =for html </blockquote>
404 =for html <blockquote>
410 An array of baseline objects for this stream
414 =for html </blockquote>
418 my $cmd = "lsbl -short -stream $self->{name}\@$self->{pvob}";
420 $Clearcase::CC->execute ($cmd);
422 return if $Clearcase::CC->status;
426 for ($Clearcase::CC->output) {
427 my $baseline = Clearcase::UCM::Baseline->new ($_, $self->{pvob});
429 push @baselines, $baseline;
442 Return true if the stream exists - false otherwise
446 =for html <blockquote>
454 =for html </blockquote>
458 =for html <blockquote>
466 =for html </blockquote>
470 my ($status, @output) = $Clearcase::CC->execute(
471 'lsstream ' . $self->{name} . '@' . $self->{pvob}->name
481 =head2 ClearSCM Perl Modules
483 =for html <p><a href="/php/scm_man.php?file=lib/Clearcase.pm">Clearcase</a></p>
485 =for html <p><a href="/php/scm_man.php?file=lib/Clearcase/UCM/Baseline.pm">Clearcase::UCM::Baseline</a></p>
486 =for html <p><a href="/php/scm_man.php?file=lib/Clearcase/UCM/Project.pm">Clearcase::UCM::Project</a></p>
488 =head1 INCOMPATABILITIES
492 =head1 BUGS AND LIMITATIONS
494 There are no known bugs in this module.
496 Please report problems to Andrew DeFaria <Andrew@ClearSCM.com>.
498 =head1 LICENSE AND COPYRIGHT
500 Copyright (c) 2007, ClearSCM, Inc. All rights reserved.