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, $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 .= ' -stream ' . $self->name . '@' . $self->{pvob}->name;
329 return $Clearcase::CC->execute("rebase $opts");
333 my ($self, $baseline) = @_;
339 Recommends a baseline in a UCM Stream
343 =for html <blockquote>
349 Baseline to recommend
353 =for html </blockquote>
357 =for html <blockquote>
363 Status from cleartool
371 =for html </blockquote>
375 return $Clearcase::CC->execute(
376 "chstream -recommended $baseline " . $self->name . '@' . $self->{pvob}->tag
387 Changes stream to not have a recommended baseline
391 =for html <blockquote>
399 =for html </blockquote>
403 =for html <blockquote>
409 Status from cleartool
417 =for html </blockquote>
421 return $Clearcase::CC->execute(
422 'chstream -nrecommended ' . $self->name . '@' . $self->{pvob}->tag
433 Returns baseline objects associated with the stream
437 =for html <blockquote>
445 =for html </blockquote>
449 =for html <blockquote>
455 An array of baseline objects for this stream
459 =for html </blockquote>
463 my $cmd = "lsbl -short -stream $self->{name}\@$self->{pvob}";
465 $Clearcase::CC->execute ($cmd);
467 return if $Clearcase::CC->status;
471 for ($Clearcase::CC->output) {
472 my $baseline = Clearcase::UCM::Baseline->new ($_, $self->{pvob});
474 push @baselines, $baseline;
487 Return true if the stream exists - false otherwise
491 =for html <blockquote>
499 =for html </blockquote>
503 =for html <blockquote>
511 =for html </blockquote>
515 my ($status, @output) = $Clearcase::CC->execute(
516 'lsstream ' . $self->{name} . '@' . $self->{pvob}->name
526 =head2 ClearSCM Perl Modules
528 =for html <p><a href="/php/scm_man.php?file=lib/Clearcase.pm">Clearcase</a></p>
530 =for html <p><a href="/php/scm_man.php?file=lib/Clearcase/UCM/Baseline.pm">Clearcase::UCM::Baseline</a></p>
531 =for html <p><a href="/php/scm_man.php?file=lib/Clearcase/UCM/Project.pm">Clearcase::UCM::Project</a></p>
533 =head1 INCOMPATABILITIES
537 =head1 BUGS AND LIMITATIONS
539 There are no known bugs in this module.
541 Please report problems to Andrew DeFaria <Andrew@ClearSCM.com>.
543 =head1 LICENSE AND COPYRIGHT
545 Copyright (c) 2007, ClearSCM, Inc. All rights reserved.