use of org.tmatesoft.svn.core.wc2.SvnCommit 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.SvnCommit in project GMM by Katharsas.
the class SVNTest method testCommitFile.
/**
* Add a test file to working copy and commit it.
*/
public void testCommitFile() throws IOException, SVNException {
// add file
final String newFileName = "TestFile_" + DateTime.now().toString().replace(':', '-');
final Path newFile = workingCopyPath.resolve(newFileName);
Files.createFile(newFile);
final SvnScheduleForAddition add = svnOperationFactory.createScheduleForAddition();
add.setSingleTarget(SvnTarget.fromFile(newFile.toFile()));
add.setAddParents(true);
add.run();
final SvnCommit commit = svnOperationFactory.createCommit();
// only changes below this path will be commited
commit.setSingleTarget(workingCopy);
// TODO needed or default?
commit.setDepth(SVNDepth.INFINITY);
commit.setCommitMessage("Added file: " + newFileName);
commit.run();
}
use of org.tmatesoft.svn.core.wc2.SvnCommit in project GMM by Katharsas.
the class SvnPlugin method commit.
private void commit(String message) {
final SvnCommit ops = svnOperationFactory.createCommit();
// only changes below this path will be committed
ops.setSingleTarget(workingCopy);
// TODO needed or default?
ops.setDepth(SVNDepth.INFINITY);
ops.setCommitMessage(message);
tryRun(ops);
}
Aggregations