Java Code Examples for org.tigris.subversion.svnclientadapter.ISVNClientAdapter#doImport()

The following examples show how to use org.tigris.subversion.svnclientadapter.ISVNClientAdapter#doImport() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ImportTestHidden.java    From netbeans with Apache License 2.0 6 votes vote down vote up
public void testImportFile(String fileToImport, String lastUrlPart) throws Exception {
    File file = createFile(fileToImport);
            
    assertTrue(file.exists());
    
    ISVNClientAdapter c = getNbClient();
    SVNUrl url = getRepoUrl().appendPath(getName()).appendPath(lastUrlPart);
    c.doImport(file, url, "imprd", false);

    assertTrue(file.exists());
    assertStatus(SVNStatusKind.UNVERSIONED, file);

    ISVNInfo info = getInfo(url);
    assertNotNull(info);        
    assertEquals(url.toString(), TestUtilities.decode(info.getUrl()).toString());
    assertNotifiedFiles(new File[] {file});    // XXX empty also in svnCA - why?! - no output from cli    
}
 
Example 2
Source File: ImportTestHidden.java    From netbeans with Apache License 2.0 6 votes vote down vote up
public void testImportFolder() throws Exception {                                        
    File folder = createFolder("folder");
            
    assertTrue(folder.exists());
    
    ISVNClientAdapter c = getNbClient();
    SVNUrl url = getTestUrl().appendPath(getName()); 
    c.mkdir(url, "mrkvadir");        
    url = url.appendPath(folder.getName());
    c.mkdir(url, "mrkvadir");        
    c.doImport(folder, url, "imprd", false);

    assertTrue(folder.exists());
    assertStatus(SVNStatusKind.UNVERSIONED, folder);
    
    ISVNInfo info = getInfo(url);
    assertNotNull(info);        
    assertEquals(url.toString(), TestUtilities.decode(info.getUrl()).toString());
    assertNotifiedFiles(new File[] {});        // XXX empty also in svnCA - why?! - no output from cli
}
 
Example 3
Source File: ImportCommand.java    From APICloud-Studio with GNU General Public License v3.0 6 votes vote down vote up
public void run(IProgressMonitor monitor) throws SVNException {       
	final IProgressMonitor subPm = Policy.infiniteSubMonitorFor(monitor, 100);
	ISVNClientAdapter svnClient = null;
       try {
   		subPm.beginTask(null, Policy.INFINITE_PM_GUESS_FOR_SWITCH);
           svnClient = folder.getRepository().getSVNClient();
           OperationManager.getInstance().beginOperation(svnClient, new OperationProgressNotifyListener(subPm, svnClient));
		svnClient.doImport(dir, folder.getUrl(), comment, recurse);
       } catch (SVNClientException e) {
           throw SVNException.wrapException(e);
       } finally {
       	folder.getRepository().returnSVNClient(svnClient);
           OperationManager.getInstance().endOperation();
           subPm.done();
       }
}
 
Example 4
Source File: ImportTestHidden.java    From netbeans with Apache License 2.0 5 votes vote down vote up
public void testImportFolderNonRecursivelly() throws Exception {                                        
    File folder = createFolder("folder");
    File folder1 = createFolder(folder, "folder1");
    File file = createFile(folder1, "file");
            
    assertTrue(folder.exists());
    assertTrue(folder1.exists());
    assertTrue(file.exists());
    
    ISVNClientAdapter c = getNbClient();
    SVNUrl url = getTestUrl().appendPath(getName());
    c.mkdir(url, "mrkvadir");        
    url = url.appendPath(folder.getName());
    c.mkdir(url, "mrkvadir");        
    c.doImport(folder, url, "imprd", false);

    assertTrue(folder.exists());
    assertTrue(folder1.exists());
    assertTrue(file.exists());
    assertStatus(SVNStatusKind.UNVERSIONED, folder);
    assertStatus(SVNStatusKind.UNVERSIONED, folder1);
    assertStatus(SVNStatusKind.UNVERSIONED, file);
    
    ISVNInfo info = getInfo(url);
    assertNotNull(info);        
    assertEquals(url.toString(), TestUtilities.decode(info.getUrl()).toString());
    
    SVNClientException ex = null;
    try {
        info = getInfo(url.appendPath(folder1.getName()));
    } catch (SVNClientException e) {
        ex = e;
    }
    assertNotNull(ex);
    assertNotifiedFiles(new File[] {});        // XXX empty also in svnCA - why?! - no output from cli
}
 
Example 5
Source File: ImportTestHidden.java    From netbeans with Apache License 2.0 5 votes vote down vote up
public void testImportFolderRecursivelly() throws Exception {                                        
    File folder = createFolder("folder");
    File folder1 = createFolder(folder, "folder1");
    File file = createFile(folder1, "file");
            
    assertTrue(folder.exists());
    assertTrue(folder1.exists());
    assertTrue(file.exists());
    
    ISVNClientAdapter c = getNbClient();
    SVNUrl url = getTestUrl().appendPath(getName());
    c.mkdir(url, "mrkvadir");        
    url = url.appendPath(folder.getName());
    c.doImport(folder, url, "imprd", true);

    assertTrue(folder.exists());
    assertTrue(folder1.exists());
    assertTrue(file.exists());
    assertStatus(SVNStatusKind.UNVERSIONED, folder);
    assertStatus(SVNStatusKind.UNVERSIONED, folder1);
    assertStatus(SVNStatusKind.UNVERSIONED, file);
    
    ISVNInfo info = getInfo(url);
    assertNotNull(info);        
    assertEquals(url.toString(), TestUtilities.decode(info.getUrl()).toString());
    
    url = url.appendPath(folder1.getName());
    info = getInfo(url);
    assertNotNull(info);        
    assertEquals(url.toString(), TestUtilities.decode(info.getUrl()).toString());
    
    url = url.appendPath(file.getName());
    info = getInfo(url);        
    assertNotNull(info);        
    assertEquals(url.toString(), TestUtilities.decode(info.getUrl()).toString());
    assertNotifiedFiles(new File[] {folder1, file}); 
}