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;
}
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");
}
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);
}
}
Aggregations