Search in sources :

Example 6 with DefaultSVNOptions

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

the class Idea87218Test method main.

public static void main(String[] args) {
    try {
        SVNStatusClient client = new SVNStatusClient((ISVNRepositoryPool) null, new DefaultSVNOptions());
        File src = new File(ourWcPath, "file1.txt");
        SVNStatus status = client.doStatus(src, false);
        assert status != null && SVNStatusType.STATUS_NORMAL.equals(status.getNodeStatus());
        File dir = new File(ourWcPath, "unversioned");
        SVNStatus dirStatus = client.doStatus(dir, false);
        assert dirStatus != null && SVNStatusType.STATUS_UNVERSIONED.equals(dirStatus.getNodeStatus());
        File dst = new File(dir, "file1.txt");
        /*
      final SVNCopyClient copyClient = new SVNCopyClient((ISVNRepositoryPool)null, new DefaultSVNOptions());
      final SVNCopySource svnCopySource = new SVNCopySource(SVNRevision.UNDEFINED, SVNRevision.WORKING, src);
      copyClient.doCopy(new SVNCopySource[]{svnCopySource}, dst, true, false, true);
      */
        SVNMoveClient moveClient = new SVNMoveClient((ISVNRepositoryPool) null, new DefaultSVNOptions());
        moveClient.doMove(src, dst);
    } catch (SVNException e) {
        e.printStackTrace();
    }
}
Also used : DefaultSVNOptions(org.tmatesoft.svn.core.internal.wc.DefaultSVNOptions) SVNException(org.tmatesoft.svn.core.SVNException) File(java.io.File)

Example 7 with DefaultSVNOptions

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

the class Idea93475Test method main.

public static void main(String[] args) {
    try {
        SVNStatusClient client = new SVNStatusClient((ISVNRepositoryPool) null, new DefaultSVNOptions());
        File src = new File(ourWcPath, "cde\\text1.txt");
        assertStatus(client, src, SVNStatusType.STATUS_NORMAL);
        File src1 = new File(ourWcPath, "cde\\text2.txt");
        assertStatus(client, src, SVNStatusType.STATUS_NORMAL);
        File dir = new File(ourWcPath, "abc");
        assertStatus(client, dir, SVNStatusType.STATUS_ADDED);
        File dst = new File(dir, "text1.txt");
        File dst1 = new File(dir, "text2.txt");
        SVNMoveClient moveClient = new SVNMoveClient((ISVNRepositoryPool) null, new DefaultSVNOptions());
        moveClient.doMove(src, dst);
        moveClient.doMove(src1, dst1);
        assertStatus(client, dst, SVNStatusType.STATUS_ADDED);
        assertStatus(client, dst1, SVNStatusType.STATUS_ADDED);
        assert client.doStatus(dst, false).getCopyFromURL() != null;
        assert client.doStatus(dst1, false).getCopyFromURL() != null;
        // now rename the directory
        final File renamedDir = new File(ourWcPath, "abc_renamed");
        moveClient.doMove(dir, renamedDir);
        File dstInRenamed = new File(renamedDir, "text1.txt");
        File dst1InRenamed = new File(renamedDir, "text2.txt");
        assertStatus(client, dstInRenamed, SVNStatusType.STATUS_ADDED);
        assertStatus(client, dst1InRenamed, SVNStatusType.STATUS_ADDED);
        assert client.doStatus(dstInRenamed, false).getCopyFromURL() != null;
        assert client.doStatus(dst1InRenamed, false).getCopyFromURL() != null;
    } catch (SVNException e) {
        e.printStackTrace();
    }
}
Also used : DefaultSVNOptions(org.tmatesoft.svn.core.internal.wc.DefaultSVNOptions) SVNException(org.tmatesoft.svn.core.SVNException) File(java.io.File)

Aggregations

SVNException (org.tmatesoft.svn.core.SVNException)7 DefaultSVNOptions (org.tmatesoft.svn.core.internal.wc.DefaultSVNOptions)7 File (java.io.File)5 Test (org.junit.Test)3 SVNWCContext (org.tmatesoft.svn.core.internal.wc17.SVNWCContext)3 ISVNWCDb (org.tmatesoft.svn.core.internal.wc17.db.ISVNWCDb)3 SVNWCDb (org.tmatesoft.svn.core.internal.wc17.db.SVNWCDb)3 Nullable (org.jetbrains.annotations.Nullable)2 SVNCancelException (org.tmatesoft.svn.core.SVNCancelException)2 PathManager (com.intellij.openapi.application.PathManager)1 PluginPathManager (com.intellij.openapi.application.PluginPathManager)1 TimeoutUtil (com.intellij.util.TimeoutUtil)1 Semaphore (com.intellij.util.concurrency.Semaphore)1 AtomicReference (java.util.concurrent.atomic.AtomicReference)1 Assert (junit.framework.Assert)1 TestCase (junit.framework.TestCase)1 Before (org.junit.Before)1 SVNErrorCode (org.tmatesoft.svn.core.SVNErrorCode)1 org.tmatesoft.svn.core.wc (org.tmatesoft.svn.core.wc)1