if (AccurevLauncher.runCommand("Reference tree update command", launcher, updatecmd, null,
scm.getOptionalLock(), accurevEnv, accurevWorkingSpace, listener, logger, true)) {
listener.getLogger().println("Update completed successfully.");
// Now get that into local filesystem
PopulateCmd pop = new PopulateCmd();
if ( pop.populate(scm, launcher, listener, server, accurevClientExePath, null, true, "from reftree", accurevWorkingSpace, accurevEnv) ) {
_startDateOfPopulate = pop.get_startDateOfPopulate();
} else {
return false;
}
if(scm.isCleanreftree()){
final Map<String, RefTreeExternalFile> externalFiles = getReftreesStatus(server, accurevEnv, accurevWorkingSpace, listener, accurevClientExePath, launcher);
File toBeDeleted;
listener.getLogger().println("externalFiles size -"+externalFiles.size());
Collection<RefTreeExternalFile> extObjects = externalFiles.values();
for (RefTreeExternalFile o : extObjects)
{
listener.getLogger().println("External File path -"+o.getLocation());
toBeDeleted= new File(o.getLocation());
if(toBeDeleted.exists())
{
toBeDeleted.delete();
}
}
}
} else {
{
listener.getLogger().println("Update failed...");
listener.getLogger().println("Run update -9 along with -r option");
final ArgumentListBuilder update9cmd = new ArgumentListBuilder();
update9cmd.add(accurevClientExePath);
update9cmd.add("update");
Command.addServer(update9cmd, server);
update9cmd.add("-r");
update9cmd.add(this._reftree);
update9cmd.add("-9");
if (!AccurevLauncher.runCommand("Reference tree update -9 command", launcher, update9cmd, null,
scm.getOptionalLock(), accurevEnv, accurevWorkingSpace, listener, logger, true)) {
return false;
}
else{
// Now get that into local filesystem
PopulateCmd pop = new PopulateCmd();
if ( pop.populate(scm, launcher, listener, server, accurevClientExePath, null, true, "from re-pop reftree", accurevWorkingSpace, accurevEnv) ) {
_startDateOfPopulate = pop.get_startDateOfPopulate();
} else {
return false;
}
if(scm.isCleanreftree()){