Search in sources :

Example 1 with SVNRemoteRepository2

use of org.omegat.core.team2.impl.SVNRemoteRepository2 in project omegat by omegat-org.

the class SVNRemoteRepository2IT method prepareFilesInLocalRepository.

private void prepareFilesInLocalRepository(String url) throws Exception {
    Path tempSVNClientDir = Files.createTempDirectory("omegat-team-svnc");
    SVNRemoteRepository2 rr2 = new SVNRemoteRepository2();
    RepositoryDefinition repositoryDefinition = new RepositoryDefinition();
    repositoryDefinition.setType("SVN");
    repositoryDefinition.setUrl(url);
    ProjectTeamSettings projectTeamSettings = new ProjectTeamSettings(tempSVNClientDir.toFile());
    File svnCheckoutDir = new File(tempSVNClientDir.toFile(), "mysvnrepo");
    rr2.init(repositoryDefinition, svnCheckoutDir, projectTeamSettings);
    rr2.switchToVersion(null);
    String newFile = createFileInSubdir(svnCheckoutDir, "asubrepo");
    rr2.addForCommit(newFile);
    rr2.commit(null, "init");
    FileUtils.deleteDirectory(tempSVNClientDir.toFile());
}
Also used : Path(java.nio.file.Path) SVNRemoteRepository2(org.omegat.core.team2.impl.SVNRemoteRepository2) RepositoryDefinition(gen.core.project.RepositoryDefinition) File(java.io.File)

Aggregations

RepositoryDefinition (gen.core.project.RepositoryDefinition)1 File (java.io.File)1 Path (java.nio.file.Path)1 SVNRemoteRepository2 (org.omegat.core.team2.impl.SVNRemoteRepository2)1