Search in sources :

Example 6 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)

Example 7 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 8 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 9 with SVNWCClient

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

the class SvnKitAddClient method add.

/**
   * TODO: Implement correct support for includeIgnored parameter. Also check that correct depth will be used for all cases (when another
   * TODO: overload of doAdd() is used) as, for instance, SVNDepth.recurseFromDepth(EMPTY) = false, SVNDepth.fromRecursive(false) = FILES.
   */
@Override
public void add(@NotNull File file, @Nullable Depth depth, boolean makeParents, boolean includeIgnored, boolean force, @Nullable ProgressTracker handler) throws VcsException {
    try {
        SVNWCClient client = myVcs.getSvnKitManager().createWCClient();
        client.setEventHandler(toEventHandler(handler));
        client.doAdd(file, force, // directory should already be created
        false, // not used but will be passed as makeParents value
        makeParents, Depth.isRecursive(depth));
    } 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)

Example 10 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)

Aggregations

SVNWCClient (org.tmatesoft.svn.core.wc.SVNWCClient)13 SVNException (org.tmatesoft.svn.core.SVNException)6 VcsException (com.intellij.openapi.vcs.VcsException)4 SVNPropertyData (org.tmatesoft.svn.core.wc.SVNPropertyData)4 SvnBindException (org.jetbrains.idea.svn.commandLine.SvnBindException)2 SVNProperties (org.tmatesoft.svn.core.SVNProperties)2 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 File (java.io.File)1 OutputStream (java.io.OutputStream)1 NotNull (org.jetbrains.annotations.NotNull)1 SvnVcs (org.jetbrains.idea.svn.SvnVcs)1