use of org.tmatesoft.svn.core.wc2.SvnOperationFactory in project intellij-community by JetBrains.
the class SvnKitManager method createOperationFactory.
@NotNull
public SvnOperationFactory createOperationFactory() {
SvnOperationFactory result = new OperationFactory();
result.setOptions(getSvnOptions());
result.setRepositoryPool(getPool());
result.setAuthenticationManager(getAuthenticationManager());
return result;
}
use of org.tmatesoft.svn.core.wc2.SvnOperationFactory in project spring-cloud-config by spring-cloud.
the class SVNKitEnvironmentRepositoryIntegrationTests method updateRepoForUpdate.
private void updateRepoForUpdate(String uri) throws SVNException, FileNotFoundException, IOException {
SvnOperationFactory svnFactory = new SvnOperationFactory();
final SvnCheckout checkout = svnFactory.createCheckout();
checkout.setSource(SvnTarget.fromURL(SVNURL.parseURIEncoded(uri)));
checkout.setSingleTarget(SvnTarget.fromFile(this.workingDir));
checkout.run();
// update bar.properties
File barProps = new File(this.workingDir, "trunk/bar.properties");
StreamUtils.copy("foo: foo", Charset.defaultCharset(), new FileOutputStream(barProps));
// commit to repo
SvnCommit svnCommit = svnFactory.createCommit();
svnCommit.setCommitMessage("update bar.properties");
svnCommit.setSingleTarget(SvnTarget.fromFile(barProps));
svnCommit.run();
}
use of org.tmatesoft.svn.core.wc2.SvnOperationFactory in project spring-cloud-config by spring-cloud.
the class SvnKitEnvironmentRepository method update.
private String update(SvnOperationFactory svnOperationFactory, String label) throws SVNException {
logger.debug("Repo already checked out - updating instead.");
try {
final SvnUpdate update = svnOperationFactory.createUpdate();
update.setSingleTarget(SvnTarget.fromFile(getWorkingDirectory()));
long[] ids = update.run();
StringBuilder version = new StringBuilder();
for (long id : ids) {
if (version.length() > 0) {
version.append(",");
}
version.append(id);
}
return version.toString();
} catch (Exception e) {
String message = "Could not update remote for " + label + " (current local=" + getWorkingDirectory().getPath() + "), remote: " + this.getUri() + ")";
if (logger.isDebugEnabled()) {
logger.debug(message, e);
} else if (logger.isWarnEnabled()) {
logger.warn(message);
}
}
final SVNStatus status = SVNClientManager.newInstance().getStatusClient().doStatus(getWorkingDirectory(), false);
return status != null ? status.getRevision().toString() : null;
}
use of org.tmatesoft.svn.core.wc2.SvnOperationFactory in project spring-cloud-config by spring-cloud.
the class SvnKitEnvironmentRepository method checkout.
private String checkout(SvnOperationFactory svnOperationFactory) throws SVNException {
logger.debug("Checking out " + getUri() + " to: " + getWorkingDirectory().getAbsolutePath());
final SvnCheckout checkout = svnOperationFactory.createCheckout();
checkout.setSource(SvnTarget.fromURL(SVNURL.parseURIEncoded(getUri())));
checkout.setSingleTarget(SvnTarget.fromFile(getWorkingDirectory()));
Long id = checkout.run();
if (id == null) {
return null;
}
return id.toString();
}
use of org.tmatesoft.svn.core.wc2.SvnOperationFactory in project omegat by omegat-org.
the class ConvertProject26to37team method getSVNTmxVersion.
/**
* Get version of "omegat/project_save.tmx" in SVN.
*/
private static String getSVNTmxVersion(File wc) throws Exception {
final SvnOperationFactory of = new SvnOperationFactory();
final SvnGetInfo infoOp = of.createGetInfo();
infoOp.setSingleTarget(SvnTarget.fromFile(new File(wc, "omegat/project_save.tmx")));
infoOp.setDepth(SVNDepth.EMPTY);
SvnInfo info = infoOp.run();
long r = info.getRevision();
return Long.toString(r);
}
Aggregations