Hi,
There is one requirement in which i have to deploy the missing version to data base.
For that i have return one tool in perl
I am using iwrevert clt for the same. The issue is iwrevert command is working fine but it return nothing in both the cases even if it is able to revert version of file and if it is not. i have tried to use eval also to catch the status but no luck.
Can u please suggest how i can capture the status of it?
Code :
####################################################################################################################################
# Function: revertVersion
# Description: Used to revert the required version
# Arguments: String Version number
# Output: Boolean Revertion status
####################################################################################################################################
sub revertVersion{
my ($filePath,$version,$microsite) =
@_;
$filePath = trim($filePath);
my $iwRevertCmd;
my $iwRevertStatus;
my $revisionString = "/main/manual_content/cml/$microsite/$version";
$filePath = '/iwmnt' . $filePath;
$logger->debug("filePath :: $filePath");
$logger->debug("revisionString :: $revisionString");
$iwRevertCmd = "/teamsite/iw-home/bin/iwrevert $filePath $revisionString";
$logger->debug("iwRevertCmd :: $iwRevertCmd");
eval
{`$iwRevertCmd`;};
if( $@ =~ /is not a valid revision string/)
{
$logger->debug("Execution of command failed because:\n\t::errstr+\n$
@);
$iwRevertStatus = 1;
}
else
{
$logger->debug("Execution of command Successful \n\t");
$iwRevertStatus = 0;
}
$logger->debug("iwRevertStatus :: $iwRevertStatus");
return $iwRevertStatus;
}