Search in sources :

Example 1 with SVNWCClient

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

the class SvnKitLockClient method getClient.

@NotNull
private SVNWCClient getClient(@Nullable ProgressTracker handler) {
    SVNWCClient client = myVcs.getSvnKitManager().createWCClient();
    client.setEventHandler(toEventHandler(handler));
    return client;
}
Also used : SVNWCClient(org.tmatesoft.svn.core.wc.SVNWCClient) NotNull(org.jetbrains.annotations.NotNull)

Example 2 with SVNWCClient

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

the class SvnKitRevertClient method revert.

@Override
public void revert(@NotNull Collection<File> paths, @Nullable Depth depth, @Nullable ProgressTracker handler) throws VcsException {
    SVNWCClient client = myVcs.getSvnKitManager().createWCClient();
    client.setEventHandler(toEventHandler(handler));
    try {
        client.doRevert(ArrayUtil.toObjectArray(paths, File.class), toDepth(depth), null);
    } catch (SVNException e) {
        throw new VcsException(e);
    }
}
Also used : VcsException(com.intellij.openapi.vcs.VcsException) SVNWCClient(org.tmatesoft.svn.core.wc.SVNWCClient) SVNException(org.tmatesoft.svn.core.SVNException) File(java.io.File)

Example 3 with SVNWCClient

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

the class SvnRollbackTest method setProperty.

private void setProperty(final File file, final String name, final String value) throws SVNException {
    final SVNWCClient client = myVcs.getSvnKitManager().createWCClient();
    client.doSetProperty(file, (path, properties) -> {
        final SVNProperties result = new SVNProperties();
        result.put(name, SVNPropertyValue.create(value));
        return result;
    }, true, SVNDepth.EMPTY, null, null);
}
Also used : SVNProperties(org.tmatesoft.svn.core.SVNProperties) SVNWCClient(org.tmatesoft.svn.core.wc.SVNWCClient)

Example 4 with SVNWCClient

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

the class SvnRollbackTest method getProperty.

private String getProperty(File file, String name) throws SVNException {
    final SVNWCClient client = myVcs.getSvnKitManager().createWCClient();
    final SVNPropertyData data = client.doGetProperty(file, name, SVNRevision.UNDEFINED, SVNRevision.WORKING);
    return data == null ? null : new String(data.getValue().getBytes());
}
Also used : SVNPropertyData(org.tmatesoft.svn.core.wc.SVNPropertyData) SVNWCClient(org.tmatesoft.svn.core.wc.SVNWCClient)

Example 5 with SVNWCClient

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

the class SvnMergeInfoTest method assertMergeInfo.

private void assertMergeInfo(@NotNull File file, @NotNull String... values) throws SVNException {
    // TODO: Replace with ClientFactory model
    final SvnVcs vcs = SvnVcs.getInstance(myProject);
    final SVNWCClient wcClient = vcs.getSvnKitManager().createWCClient();
    final SVNPropertyData data = wcClient.doGetProperty(file, "svn:mergeinfo", SVNRevision.UNDEFINED, SVNRevision.WORKING);
    assert data != null && data.getValue() != null;
    boolean result = false;
    for (String value : values) {
        result |= value.equals(data.getValue().getString());
    }
    assert result;
}
Also used : SVNPropertyData(org.tmatesoft.svn.core.wc.SVNPropertyData) SVNWCClient(org.tmatesoft.svn.core.wc.SVNWCClient) SvnVcs(org.jetbrains.idea.svn.SvnVcs)

Aggregations

SVNWCClient (org.tmatesoft.svn.core.wc.SVNWCClient)18 SVNException (org.tmatesoft.svn.core.SVNException)10 VcsException (com.intellij.openapi.vcs.VcsException)4 File (java.io.File)4 SVNPropertyData (org.tmatesoft.svn.core.wc.SVNPropertyData)4 SvnBindException (org.jetbrains.idea.svn.commandLine.SvnBindException)2 SVNProperties (org.tmatesoft.svn.core.SVNProperties)2 SVNClientManager (org.tmatesoft.svn.core.wc.SVNClientManager)2 SVNInfo (org.tmatesoft.svn.core.wc.SVNInfo)2 SVNLogClient (org.tmatesoft.svn.core.wc.SVNLogClient)2 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 OutputStream (java.io.OutputStream)1 MalformedURLException (java.net.MalformedURLException)1 URISyntaxException (java.net.URISyntaxException)1 URL (java.net.URL)1 Path (java.nio.file.Path)1 Paths (java.nio.file.Paths)1 Instant (java.time.Instant)1 HashSet (java.util.HashSet)1 Map (java.util.Map)1