use of org.tmatesoft.svn.core.wc2.SvnInfo in project GMM by Katharsas.
the class SvnPlugin method initializeWorkingCopy.
/**
* @return Current revision of local working copy.
*/
private void initializeWorkingCopy(File workingCopyFile) {
final String workingCopyString = workingCopyFile.toString();
if (workingCopyFile.exists()) {
if (workingCopyFile.isDirectory()) {
final SvnGetInfo operation = svnOperationFactory.createGetInfo();
operation.setSingleTarget(workingCopy);
SvnInfo info = null;
try {
info = operation.run();
} catch (final SVNException e) {
}
if (info != null) {
logger.info("Located existing working copy at path '" + workingCopyString + "'.");
verifyExistingWorkingCopy();
} else {
logger.warn("Could not locate working copy at path '" + workingCopyString + "'! Creating new one.");
if (workingCopyFile.list().length > 0) {
throw new ConfigurationException("Cannot create new working copy because directory is not empty! Path: '" + workingCopyString + "'");
}
createNewWorkingCopy();
}
} else {
throw new ConfigurationException("Path to working copy is not a directory! Path:'" + workingCopyString + "'");
}
} else {
logger.warn("Could not locate SVN working copy at path '" + workingCopyString + "'! Creating new one.");
fileService.createDirectory(workingCopyFile.toPath());
createNewWorkingCopy();
}
}
use of org.tmatesoft.svn.core.wc2.SvnInfo in project GMM by Katharsas.
the class SvnPlugin method retrieveRevision.
/**
* @return Current revision of remote repository or working copy.
*/
private long retrieveRevision(SvnTarget target) {
final SvnGetInfo operation = svnOperationFactory.createGetInfo();
operation.setSingleTarget(target);
final SvnInfo info = tryRun(operation);
return info.getRevision();
}
Aggregations