Subversion Repositories DevTools

Rev

Rev 1308 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1308 Rev 1312
Line 10... Line 10...
10
 
10
 
11
package Codestriker::Repository::ClearCaseDynamic;
11
package Codestriker::Repository::ClearCaseDynamic;
12
 
12
 
13
use strict;
13
use strict;
14
use File::Spec;
14
use File::Spec;
-
 
15
use Carp;
15
 
16
 
16
# Put this in an eval block so that this becomes an optional dependency for
17
# Put this in an eval block so that this becomes an optional dependency for
17
# those people who don't use this module.
18
# those people who don't use this module.
18
eval("use ClearCase::CtCmd");
19
eval("use ClearCase::CtCmd");
19
 
20
 
Line 60... Line 61...
60
 
61
 
61
	# Check the result of the setview command.
62
	# Check the result of the setview command.
62
	if ($status) {
63
	if ($status) {
63
	    $error_msg = "Failed to open view: " . $self->{dynamic_view_name} .
64
	    $error_msg = "Failed to open view: " . $self->{dynamic_view_name} .
64
		": $error_msg\n";
65
		": $error_msg\n";
65
	    print STDERR "$error_msg\n";
66
	    croak ("$error_msg\n");
66
	    return $error_msg;
67
	    return $error_msg;
67
	}
68
	}
68
    }
69
    }
69
 
70
 
70
    # Execute the remaining code in an eval block to ensure the endview
71
    # Execute the remaining code in an eval block to ensure the endview
Line 89... Line 90...
89
    };
90
    };
90
    if ($@) {
91
    if ($@) {
91
	# Something went wrong in the above code, record the error message
92
	# Something went wrong in the above code, record the error message
92
	# and continue to ensure the view is closed.
93
	# and continue to ensure the view is closed.
93
	$error_msg = $@;
94
	$error_msg = $@;
94
	print STDERR "$error_msg\n";
95
	croak "$error_msg\n";
95
    }
96
    }
96
 
97
 
97
    # Close the view.
98
    # Close the view.
98
    {
99
    {
99
	(my $status, my $stdout, $error_msg) =
100
	(my $status, my $stdout, $error_msg) =
100
	    $clearcase->exec('endview', $self->{dynamic_view_name});
101
	    $clearcase->exec('endview', $self->{dynamic_view_name});
101
	if ($status) {
102
	if ($status) {
102
	    $error_msg = "Failed to close view: " . $self->{dynamic_view_name} .
103
	    $error_msg = "Failed to close view: " . $self->{dynamic_view_name} .
103
		": $error_msg\n";
104
		": $error_msg\n";
104
	    print STDERR "$error_msg\n";
105
	    croak "$error_msg\n";
105
	}
106
	}
106
    }
107
    }
107
 
108
 
108
    return $error_msg;
109
    return $error_msg;
109
}
110
}