use Clearcase;
use Display;
-sub new ($) {
- my ($class, $tag) = @_;
+sub new ($;$) {
+ my ($class, $tag, $region) = @_;
=pod
my $self = bless { tag => $tag }, $class;
- $self->updateViewInfo;
+ $self->updateViewInfo ($region);
return $self;
} # new
return $self->{tag};
} # tag
-# Alias name to tag
-sub name() {
- goto &tag;
-} # name
-
sub text_mode () {
my ($self) = @_;
} # exists
sub create (;$$$) {
- my ($self, $host, $vws, $opts) = @_;
+ my ($self, $host, $vws, $region) = @_;
=pod
=cut
+ $region ||= $Clearcase::CC->region;
+
if ($self->exists) {
- $self->updateViewInfo;
+ $self->updateViewInfo ($region);
return (0, ())
} # if
my ($status, @output);
- $opts ||= '';
-
if ($host && $vws) {
- ($status, @output) = $Clearcase::CC->execute(
- "mkview -tag $self->{tag} $opts " .
- "-host $host -hpath $vws -gpath $vws $vws"
- );
+ ($status, @output) =
+ $Clearcase::CC->execute ("mkview -tag $self->{tag} -region $region "
+ . "-host $host -hpath $vws -gpath $vws $vws");
} else {
# Note this requires that -stgloc's work and that using -auto is not a
# problem.
- ($status, @output) = $Clearcase::CC->execute(
- "mkview -tag $self->{tag} $opts -stgloc -auto"
- );
+ ($status, @output) =
+ $Clearcase::CC->execute ("mkview -tag $self->{tag} -stgloc -auto");
} # if
- $self->updateViewInfo;
+ $self->updateViewInfo ($region);
return ($status, @output);
} # create
-# TODO Is this used?
sub createUCM ($$) {
- my ($self, $stream, $pvob) = @_;
+ my ($self, $stream, $pvob, $region) = @_;
=pod
=cut
- return (0, ()) if $self->exists;
+ $region ||= $Clearcase::CC->region;
+
+ return (0, ())
+ if $self->exists;
# Update object members
- $self->{pvob} = $pvob;
+ $self->{stream} = $stream;
+ $self->{pvob} = $pvob;
# Need to create the view
my ($status, @output) =
return ($status, @output)
if $status;
- $self->updateViewInfo;
+ $self->updateViewInfo ($region);
return ($status, @output);
} # createUCM
=cut
- return (0, ()) unless $self->exists;
+ return (0, ())
+ unless $self->exists;
my ($status, @output);
if ($self->dynamic) {
- $self->stop;
-
($status, @output) = $Clearcase::CC->execute (
"rmview -force -tag $self->{tag}"
);
return ($status, @output);
} # set
-sub updateViewInfo () {
- my ($self) = @_;
+sub updateViewInfo ($$) {
+ my ($self, $region) = @_;
+
+ $region ||= $Clearcase::CC->region;
my ($status, @output) = $Clearcase::CC->execute (
- "lsview -long -properties -full $self->{tag}"
+ "lsview -region $region -long -properties -full $self->{tag}"
);
# Assuming this view is an empty shell of an object that the user may possibly