Search in sources :

Example 1 with SVNDiffClient

use of org.tmatesoft.svn.core.wc.SVNDiffClient in project intellij-community by JetBrains.

the class SvnKitMergeClient method createClient.

@NotNull
private SVNDiffClient createClient(@Nullable DiffOptions diffOptions, @Nullable ProgressTracker handler) {
    SVNDiffClient client = myVcs.getSvnKitManager().createDiffClient();
    client.setMergeOptions(toDiffOptions(diffOptions));
    client.setEventHandler(toEventHandler(handler));
    return client;
}
Also used : SVNDiffClient(org.tmatesoft.svn.core.wc.SVNDiffClient) NotNull(org.jetbrains.annotations.NotNull)

Example 2 with SVNDiffClient

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

the class SVNDiff method diff.

/********************************
	 * 작성일 : 2016. 5. 5. 작성자 : KYJ
	 *
	 *
	 * @param path1
	 * @param rivision1
	 * @param path2
	 * @param rivision2
	 * @return
	 * @throws SVNException
	 * @throws UnsupportedEncodingException
	 ********************************/
public String diff(String path1, SVNRevision rivision1, String path2, SVNRevision rivision2) throws SVNException, Exception {
    SVNDiffClient diffClient = getSvnManager().getDiffClient();
    //		StringOutputStream result = new StringOutputStream();
    ByteArrayOutputStream out = new ByteArrayOutputStream();
    //		SVNURL svnURL = getSvnURL();
    //		String repositoryPath = getRepository().getRepositoryPath(path1);
    SVNURL location = getRepository().getLocation();
    String decodedString = location.toDecodedString();
    String uriEncodedPath = location.getURIEncodedPath();
    String rootUrl = decodedString.replaceAll(uriEncodedPath, "");
    SVNURL svnUrl1 = SVNURL.parseURIEncoded(rootUrl + "/" + path1);
    SVNURL svnUrl2 = SVNURL.parseURIEncoded(rootUrl + "/" + path2);
    diffClient.doDiff(svnUrl1, rivision1, svnUrl2, rivision2, SVNDepth.UNKNOWN, true, out);
    return out.toString("UTF-8");
}
Also used : SVNURL(org.tmatesoft.svn.core.SVNURL) ByteArrayOutputStream(java.io.ByteArrayOutputStream) SVNDiffClient(org.tmatesoft.svn.core.wc.SVNDiffClient)

Example 3 with SVNDiffClient

use of org.tmatesoft.svn.core.wc.SVNDiffClient in project intellij-community by JetBrains.

the class SvnKitMergeClient method merge.

public void merge(@NotNull SvnTarget source, @NotNull File destination, boolean dryRun, boolean reintegrate, @Nullable DiffOptions diffOptions, @Nullable ProgressTracker handler) throws VcsException {
    assertUrl(source);
    SVNDiffClient client = createClient(diffOptions, handler);
    try {
        if (reintegrate) {
            client.doMergeReIntegrate(source.getURL(), source.getPegRevision(), destination, dryRun);
        } else {
            client.doMerge(source.getURL(), source.getPegRevision(), ALL_REVISIONS_RANGE, destination, SVNDepth.UNKNOWN, true, false, dryRun, false);
        }
    } catch (SVNException e) {
        throw new VcsException(e);
    }
}
Also used : VcsException(com.intellij.openapi.vcs.VcsException) SVNException(org.tmatesoft.svn.core.SVNException) SVNDiffClient(org.tmatesoft.svn.core.wc.SVNDiffClient)

Aggregations

SVNDiffClient (org.tmatesoft.svn.core.wc.SVNDiffClient)3 VcsException (com.intellij.openapi.vcs.VcsException)1 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 NotNull (org.jetbrains.annotations.NotNull)1 SVNException (org.tmatesoft.svn.core.SVNException)1 SVNURL (org.tmatesoft.svn.core.SVNURL)1