X-Git-Url: https://defaria.com/gitweb/?a=blobdiff_plain;f=lib%2FClearcase%2FVobs.pm;h=ad175f4b982e7d48df1ecbad10aa9aec967e9809;hb=0c802537ec02d6cfea4c41b3138535c09a319489;hp=0f2d85fb6c3633f5d2f97988fcf970ed5f847eb3;hpb=bdb1e0c845a6921e22d52fbff3404d5c1dfae520;p=clearscm.git diff --git a/lib/Clearcase/Vobs.pm b/lib/Clearcase/Vobs.pm index 0f2d85f..ad175f4 100644 --- a/lib/Clearcase/Vobs.pm +++ b/lib/Clearcase/Vobs.pm @@ -72,12 +72,12 @@ use Clearcase; use Display; use OSDep; -sub new () { - my ($class) = @_; +sub new (;$) { + my ($class, $host, $region) = @_; =pod -=head2 new (tag) +=head2 new (host) Construct a new Clearcase Vobs object. @@ -87,7 +87,10 @@ Parameters: =over -=item none +=item host + +If host is specified then limit the vob list to only those vobs on that host. If +host is not specified then all vobs are considered =back @@ -107,18 +110,13 @@ Returns: =cut - my ($status, @output) = $Clearcase::CC->execute ("lsvob -short"); + my $cmd = 'lsvob -short'; + $cmd .= " -host $host" if $host; + $cmd .= " -region $region" if $region; - return if $status; + my ($status, @output) = $Clearcase::CC->execute ($cmd); - # Strip $VOBTAG_PREFIX - foreach (@output) { - if ($ARCHITECTURE eq 'windows' or $ARCHITECTURE eq 'cygwin') { - s/\\//; - } else { - s/$Clearcase::VOBTAG_PREFIX//; - } # if - } # foreach + return if $status; return bless { vobs => \@output