Search in sources :

Example 6 with SVNCommitInfo

use of org.tmatesoft.svn.core.SVNCommitInfo in project Gargoyle by callakrsos.

the class SVNCommit method modifyFileCommit.

/**
	 *
	 * 수정된 코드를 서버 반영시 사용.
	 *
	 *
	 * @작성자 : KYJ
	 * @작성일 : 2016. 7. 12.
	 * @param dirPath
	 *    remote server relative path.
	 * @param fileName
	 *     only SimpleFileName
	 * @param oldData
	 * @param newData
	 * @param commitMessage
	 * @return
	 * @throws SVNException
	 * @throws IOException
	 */
public SVNCommitInfo modifyFileCommit(String dirPath, String fileName, InputStream oldData, InputStream newData, String commitMessage) throws SVNException, IOException {
    ISVNEditor editor = getDefaultSVNEditor(commitMessage);
    SVNCommitInfo modifyFile = SVNCommitInfo.NULL;
    try {
        modifyFile = modifyFile(editor, dirPath, dirPath.concat("/").concat(fileName), oldData, newData);
    } finally {
        close(oldData);
        close(newData);
    }
    return modifyFile;
}
Also used : ISVNEditor(org.tmatesoft.svn.core.io.ISVNEditor) SVNCommitInfo(org.tmatesoft.svn.core.SVNCommitInfo)

Example 7 with SVNCommitInfo

use of org.tmatesoft.svn.core.SVNCommitInfo in project Gargoyle by callakrsos.

the class SVNImport method doImport.

/**
	 *  SVN Import Command 수행.
	 *
	 * @작성자 : KYJ
	 * @작성일 : 2016. 7. 11.
	 * @param checkoutedDir
	 * @param to
	 * @return
	 * @throws SVNException
	 */
private SVNCommitInfo doImport(File checkoutedDir, SVNURL to) throws SVNException {
    if (checkoutedDir.exists()) {
        SVNCommitClient commitClient = getSvnManager().getCommitClient();
        SVNCommitInfo doImport = commitClient.doImport(checkoutedDir, to, "Init Commit . SVN Import Command", new SVNProperties(), true, true, SVNDepth.INFINITY);
        LOGGER.debug(" Do SVN Import Command ");
        return doImport;
    }
    return SVNCommitInfo.NULL;
}
Also used : SVNCommitInfo(org.tmatesoft.svn.core.SVNCommitInfo) SVNProperties(org.tmatesoft.svn.core.SVNProperties) SVNCommitClient(org.tmatesoft.svn.core.wc.SVNCommitClient)

Example 8 with SVNCommitInfo

use of org.tmatesoft.svn.core.SVNCommitInfo in project Gargoyle by callakrsos.

the class CommandTest3 method commitTest.

/**
	 * SVN Commit Test.
	 *
	 * @작성자 : KYJ
	 * @작성일 : 2016. 7. 12.
	 * @throws SVNException
	 * @throws IOException
	 */
@Test
public void commitTest() throws SVNException, IOException {
    File[] commitTestFiles = getCommitTestFiles();
    FileInputStream inputStream = null;
    try {
        inputStream = new FileInputStream(commitTestFiles[0]);
        //			thirdPartManager.commit_new("/sql", commitTestFiles[0].getName(), inputStream, "test commit.");
        //			commitTestFiles = new File[] { new File("C:\\logs\\test\\deprecated_pass-batch-core\\sql\\text.txt") };
        SVNCommitInfo commit_modify = localServerManager.commit_modify("sql", "text.txt", inputStream, "test commit.");
        System.out.println(commit_modify.getAuthor());
        System.out.println(commit_modify.getNewRevision());
    } finally {
        if (inputStream != null)
            inputStream.close();
    }
}
Also used : SVNCommitInfo(org.tmatesoft.svn.core.SVNCommitInfo) File(java.io.File) FileInputStream(java.io.FileInputStream) Test(org.junit.Test)

Aggregations

SVNCommitInfo (org.tmatesoft.svn.core.SVNCommitInfo)8 File (java.io.File)3 Test (org.junit.Test)3 SVNException (org.tmatesoft.svn.core.SVNException)3 SVNCommitClient (org.tmatesoft.svn.core.wc.SVNCommitClient)3 FileInputStream (java.io.FileInputStream)2 SvnBindException (org.jetbrains.idea.svn.commandLine.SvnBindException)2 VcsException (com.intellij.openapi.vcs.VcsException)1 VirtualFile (com.intellij.openapi.vfs.VirtualFile)1 NotNull (org.jetbrains.annotations.NotNull)1 SVNProperties (org.tmatesoft.svn.core.SVNProperties)1 ISVNEditor (org.tmatesoft.svn.core.io.ISVNEditor)1 SVNCommitPacket (org.tmatesoft.svn.core.wc.SVNCommitPacket)1 SVNCopyClient (org.tmatesoft.svn.core.wc.SVNCopyClient)1 SVNCopySource (org.tmatesoft.svn.core.wc.SVNCopySource)1