org.tigris.subversion.svnclientadapter.ISVNClientAdapter Java Examples

The following examples show how to use org.tigris.subversion.svnclientadapter.ISVNClientAdapter. 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: SVNRepositoryLocation.java    From APICloud-Studio with GNU General Public License v3.0 6 votes vote down vote up
public ISVNRemoteFile getRemoteFile(SVNUrl url) throws SVNException{
	ISVNClientAdapter svnClient = getSVNClient();
	ISVNInfo info = null;
	try {
		if (this.getRepositoryRoot().equals(url))
		    return new RemoteFile(this, url, SVNRevision.HEAD);
		else
		    info = svnClient.getInfo(url, SVNRevision.HEAD, SVNRevision.HEAD);
	} catch (SVNClientException e) {
		throw new SVNException(
			"Can't get latest remote resource for "
				+ url);
	}

	if (info == null)
		return null; // no remote file
	else {
		return new RemoteFile(null, // we don't know its parent
		this,
			url,
			SVNRevision.HEAD,
			info.getLastChangedRevision(),
			info.getLastChangedDate(),
			info.getLastCommitAuthor());
	}		
}
 
Example #2
Source File: FileModificationManager.java    From APICloud-Studio with GNU General Public License v3.0 6 votes vote down vote up
private void autoShareProjectIfSVNWorkingCopy(IProject project) {
	ISVNClientAdapter client = null;
	try {
		client = SVNProviderPlugin.getPlugin().getSVNClient();
		SVNProviderPlugin.disableConsoleLogging();
		ISVNInfo info = client.getInfoFromWorkingCopy(project.getLocation().toFile());
		if (info != null) {
			SVNTeamProviderType.getAutoShareJob().share(project);
		}
	} catch (Exception e) {}
	finally {
	    SVNProviderPlugin.enableConsoleLogging();
	    if (client != null) {
	    	SVNProviderPlugin.getPlugin().getSVNClientManager().returnSVNClient(client);
	    }
	}
}
 
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: SvnClientFactory.java    From netbeans with Apache License 2.0 6 votes vote down vote up
public void setupCommandline () {
    if(!checkCLIExecutable()) return;
    
    factory = new ClientAdapterFactory() {
        @Override
        protected ISVNClientAdapter createAdapter() {
            return new CommandlineClient(); //SVNClientAdapterFactory.createSVNClient(CmdLineClientAdapterFactory.COMMANDLINE_CLIENT);
        }
        @Override
        protected SvnClientInvocationHandler getInvocationHandler(ISVNClientAdapter adapter, SvnClientDescriptor desc, SvnProgressSupport support, int handledExceptions) {
            return new SvnClientInvocationHandler(adapter, desc, support, handledExceptions, ConnectionType.cli);
        }
        @Override
        protected ISVNPromptUserPassword createCallback(SVNUrl repositoryUrl, int handledExceptions) {
            return null;
        }
        @Override
        protected ConnectionType connectionType() {
            return ConnectionType.cli;
        }
    };
    LOG.info("running on commandline");
}
 
Example #5
Source File: BaseFile.java    From APICloud-Studio with GNU General Public License v3.0 6 votes vote down vote up
public ISVNAnnotations getAnnotations(SVNRevision fromRevision,
		SVNRevision toRevision, boolean includeMergedRevisions, boolean ignoreMimeType) throws TeamException {
	ISVNClientAdapter svnClient = getRepository().getSVNClient();
	try {
		SVNRevision pegRevision = null;
		ISVNLocalResource localResource = SVNWorkspaceRoot.getSVNResourceFor(resource);
		if (localResource != null) {
			pegRevision = localResource.getRevision();
		}			
		return svnClient.annotate(
				localResourceStatus.getFile(), fromRevision, toRevision, pegRevision, ignoreMimeType, includeMergedRevisions);
	} catch (SVNClientException e) {
		throw new TeamException("Failed in BaseFile.getAnnotations()", e);
	}
	finally {
		getRepository().returnSVNClient(svnClient);
	}
}
 
Example #6
Source File: HistoryDialog.java    From APICloud-Studio with GNU General Public License v3.0 6 votes vote down vote up
private boolean tagsPropertySet(ISVNRemoteResource res) {
  	ISVNClientAdapter client = null;
try {
	client = SVNProviderPlugin.getPlugin().getSVNClient();
	ISVNProperty property = null;
       SVNProviderPlugin.disableConsoleLogging(); 
	property = client.propertyGet(res.getUrl(), "subclipse:tags"); //$NON-NLS-1$
       SVNProviderPlugin.enableConsoleLogging(); 
	if (property != null && property.getValue() != null) return true;
} catch (Exception e) {        
	SVNProviderPlugin.enableConsoleLogging(); 
} finally {
	SVNProviderPlugin.getPlugin().getSVNClientManager().returnSVNClient(client);
}
return false;
}
 
Example #7
Source File: RemoteResource.java    From APICloud-Studio with GNU General Public License v3.0 6 votes vote down vote up
public ISVNLogMessage[] getLogMessages(SVNRevision pegRevision,
		SVNRevision revisionStart, SVNRevision revisionEnd,
		boolean stopOnCopy, boolean fetchChangePath, long limit, boolean includeMergedRevisions)
		throws TeamException {
   	ISVNClientAdapter svnClient = repository.getSVNClient();
	try {
		return svnClient.getLogMessages(getUrl(),
				pegRevision, revisionStart, revisionEnd, stopOnCopy, fetchChangePath,
				limit, includeMergedRevisions);
	} catch (SVNClientException e) {
		throw new TeamException("Failed in RemoteResource.getLogMessages()",
				e);
	}
	finally {
		repository.returnSVNClient(svnClient);
	}
}
 
Example #8
Source File: RemoteFolder.java    From APICloud-Studio with GNU General Public License v3.0 6 votes vote down vote up
public void createRemoteFolder(String folderName, String message, IProgressMonitor monitor) throws SVNException {
        IProgressMonitor progress = Policy.monitorFor(monitor);
        progress.beginTask(Policy.bind("RemoteFolder.createRemoteFolder"), 100); //$NON-NLS-1$
        ISVNClientAdapter svnClient = null;
        try {
            svnClient = getRepository().getSVNClient();
            svnClient.mkdir( getUrl().appendPath(folderName), message);
            refresh();
            SVNProviderPlugin.getPlugin().getRepositoryResourcesManager().remoteResourceCreated(this, folderName);
        } catch (SVNClientException e) {
            throw SVNException.wrapException(e);
        } finally {
//        	getRepository().returnSVNClient(svnClient);
            progress.done();
        }
    }
 
Example #9
Source File: PropertyTestHidden.java    From netbeans with Apache License 2.0 6 votes vote down vote up
private void testPropertyListUrl(String filePath) throws Exception {
    createAndCommitParentFolders(filePath);
    File file = createFile(filePath);
    add(file);
    
    ISVNClientAdapter c = getNbClient();        
    c.propertySet(file, "p1", "v1", false);
    c.propertySet(file, "p2", "v2", false);
    c.propertySet(file, "p3", "v3", false);
    commit(file);
    
    assertPropertyStatus(SVNStatusKind.NORMAL, file);

    ISVNProperty[] props = c.getProperties(getFileUrl(file));
    Map<String, ISVNProperty> propMap = new HashMap<String, ISVNProperty>();
    for (ISVNProperty p : props) {
        propMap.put(p.getName(), p);                    
    }
    assertEquals(3, propMap.size());
    assertProperty("p1", "v1", propMap);        
    assertProperty("p2", "v2", propMap);        
    assertProperty("p3", "v3", propMap);        
}
 
Example #10
Source File: CatTestHidden.java    From netbeans with Apache License 2.0 6 votes vote down vote up
private void testCatURLPrevRev(String path) throws Exception {
    File file = createFile(path);
    write(file, 1);
    add(file);
    commit(file);

    File prevRevisionCopy = new File(file.getParentFile(), "prevRevisionCopy");
    FileUtils.copyFile(file, prevRevisionCopy);

    ISVNClientAdapter c = getNbClient();        
    SVNRevision prevrev = getRevision(file);
    write(file, 2);        
    commit(file);
    
    InputStream is1 = c.getContent(getFileUrl(file), prevrev);
    InputStream is2 = new FileInputStream(prevRevisionCopy);
    
    assertInputStreams(is2, is1);
}
 
Example #11
Source File: LogEntry.java    From APICloud-Studio with GNU General Public License v3.0 6 votes vote down vote up
/**
 * @param resource
 * @return rootURL
 */
private SVNUrl updateRootUrl(ISVNResource resource) {
	ISVNClientAdapter client = null;
    try {
        client = SVNProviderPlugin.getPlugin().getSVNClient();
        SVNProviderPlugin.disableConsoleLogging(); 
        ISVNInfo info = client.getInfo(resource.getUrl());
        SVNProviderPlugin.enableConsoleLogging(); 
        if (info.getRepository() == null)
            return resource.getUrl();
        else {
            // update the saved root URL
            resource.getRepository().setRepositoryRoot(info.getRepository());
            return info.getRepository();
        }
    } catch (Exception e) {
        SVNProviderPlugin.enableConsoleLogging(); 
        return resource.getUrl();
    } finally {
     SVNProviderPlugin.getPlugin().getSVNClientManager().returnSVNClient(client);
    }
}
 
Example #12
Source File: CatTestHidden.java    From netbeans with Apache License 2.0 6 votes vote down vote up
private void testCatFilePrevRev(String path) throws Exception {
    createAndCommitParentFolders(path);
    File file = createFile(path);
    write(file, 1);
    add(file);
    commit(file);

    File prevRevisionCopy = new File(file.getParentFile(), "prevRevisionCopy");
    FileUtils.copyFile(file, prevRevisionCopy);

    ISVNClientAdapter c = getNbClient();        
    SVNRevision prevrev = getRevision(file);
    write(file, 2);        
    commit(file);
    
    InputStream is1 = c.getContent(file, prevrev);
    InputStream is2 = new FileInputStream(prevRevisionCopy);
    
    assertInputStreams(is2, is1);
}
 
Example #13
Source File: CommitTestHidden.java    From netbeans with Apache License 2.0 6 votes vote down vote up
public void testCommitFolderNonRecursively() throws Exception {                
    File folder = createFolder("folder");
    File file = createFile(folder, "file");
            
    add(folder);               
    assertStatus(SVNStatusKind.ADDED, file);
    assertStatus(SVNStatusKind.ADDED, folder);

    SVNRevision revisionBefore = (SVNRevision.Number) getRevision(getRepoUrl());
    
    ISVNClientAdapter client = getNbClient();        
    long r = client.commit(new File[] {folder}, "commit", false);
    
    SVNRevision revisionAfter = (SVNRevision.Number) getRevision(getRepoUrl());
    
    assertTrue(file.exists());        
    assertStatus(SVNStatusKind.ADDED, file);                
    assertStatus(SVNStatusKind.NORMAL, folder);                
    assertNotSame(revisionBefore, revisionAfter);
    assertEquals(((SVNRevision.Number)revisionAfter).getNumber(), r);
    assertNotifiedFiles(new File[] {folder});
    
}
 
Example #14
Source File: AddTestHidden.java    From netbeans with Apache License 2.0 6 votes vote down vote up
public void testAddNoFile() throws Exception {
    File file = new File(getWC(), "fail");

    assertStatus(SVNStatusKind.NONE, file);

    ISVNClientAdapter c = getNbClient();

    SVNClientException e = null;
    try {
        c.addFile(file);
    } catch (SVNClientException ex) {
        e = ex;
    }
    if (isJavahl()) {
        assertNotNull(e);
        assertTrue(e.getMessage().indexOf("is not a working copy") > -1
                || e.getMessage().indexOf("not found") > -1);
    }

    assertNotifiedFiles(new File[]{});
}
 
Example #15
Source File: CommitTestHidden.java    From netbeans with Apache License 2.0 6 votes vote down vote up
private void testCommitFile(String path) throws Exception {
    createAndCommitParentFolders(path);
    File file = createFile(path);

    add(file);
    assertStatus(SVNStatusKind.ADDED, file);

    SVNRevision revisionBefore = (SVNRevision.Number) getRevision(getRepoUrl());

    ISVNClientAdapter client = getNbClient();

    long r = client.commit(new File[] {file}, "commit", true);

    SVNRevision revisionAfter = (SVNRevision.Number) getRevision(getRepoUrl());

    assertTrue(file.exists());
    assertStatus(SVNStatusKind.NORMAL, file);
    assertNotSame(revisionBefore, revisionAfter);
    assertEquals(((SVNRevision.Number)revisionAfter).getNumber(), r);
    assertNotifiedFiles(file);
}
 
Example #16
Source File: VersionsCacheTest.java    From netbeans with Apache License 2.0 6 votes vote down vote up
private void testContents (List<File> revisions, File file, boolean cacheFilled) throws Exception {
    ISVNClientAdapter client = getFullWorkingClient();
    long lastRev = client.getInfo(file).getLastChangedRevision().getNumber();
    VersionsCache cache = VersionsCache.getInstance();
    SVNUrl repoUrl = SvnUtils.getRepositoryRootUrl(file);
    SVNUrl resourceUrl = SvnUtils.getRepositoryUrl(file);
    Storage storage = StorageManager.getInstance().getStorage(repoUrl.toString());
    for (File golden : revisions) {
        File content;
        if (!cacheFilled) {
            content = storage.getContent(repoUrl.toString(), file.getName(), String.valueOf(lastRev));
            assertEquals(0, content.length());
        }
        content = cache.getFileRevision(repoUrl, resourceUrl, String.valueOf(lastRev), file.getName());
        assertFile(content, golden, null);
        content = cache.getFileRevision(repoUrl, resourceUrl, String.valueOf(lastRev), String.valueOf(lastRev), file.getName());
        assertFile(content, golden, null);
        content = storage.getContent(resourceUrl.toString() + "@" + lastRev, file.getName(), String.valueOf(lastRev));
        assertFile(content, golden, null);
        --lastRev;
    }
}
 
Example #17
Source File: ShowAnnotationOperation.java    From APICloud-Studio with GNU General Public License v3.0 6 votes vote down vote up
private String getSingleEntry(ISVNRemoteFile file, Long revLong) {
	ISVNClientAdapter client = null;
	try {
		client = file.getRepository().getSVNClient();
		SVNRevision revision = SVNRevision.getRevision(revLong.toString());
		ISVNLogMessage [] messages = client.getLogMessages(file.getRepository().getRepositoryRoot(), revision, revision, false);
		if (messages.length == 1)
			return messages[0].getMessage();
		else
			return null;
	} catch (Exception e) {
		return null;
	}
	finally {
		file.getRepository().returnSVNClient(client);
	}
}
 
Example #18
Source File: ResolveActionWithChoices.java    From APICloud-Studio with GNU General Public License v3.0 6 votes vote down vote up
private SVNTreeConflict getTreeConflict(final IResource resource) {
	BusyIndicator.showWhile(Display.getDefault(), new Runnable() {
		public void run() {
			ISVNClientAdapter client = null;
			try {
				client = SVNWorkspaceRoot.getSVNResourceFor(resource).getRepository().getSVNClient();
				ISVNStatus[] statuses = client.getStatus(resource.getLocation().toFile(), true, true, true);
				for (int i = 0; i < statuses.length; i++) {
					if (statuses[i].hasTreeConflict()) {
						treeConflict = new SVNTreeConflict(statuses[i]);
						break;
					}
				}
			} catch (Exception e) {
				SVNUIPlugin.log(IStatus.ERROR, e.getMessage(), e);
			}
			finally {
				SVNWorkspaceRoot.getSVNResourceFor(resource).getRepository().returnSVNClient(client);
			}
		}			
	});
	return treeConflict;
}
 
Example #19
Source File: DifferentWorkingDirsTestHidden.java    From netbeans with Apache License 2.0 6 votes vote down vote up
public void testDifferentWorkingDirs1() throws Exception {
    File folder1 = createFolder("folder1");
    File folder11 = createFolder(folder1, "folder11");
    File folder12 = createFolder(folder1, "folder12");

    File folder2 = createFolder("folder2");
    File folder21 = createFolder(folder2,"folder2");
    File folder211 = createFolder(folder21,"folder2");
    File folder2111 = createFolder(folder211,"folder2");

    ISVNClientAdapter c = getNbClient();
    for(File f : new File[] {folder1, folder11, folder12, folder2, folder21, folder211, folder2111}) {
        c.addDirectory(f, false);
    }

    c.commit(new File[] {folder1, folder11, folder12, folder2, folder21, folder211, folder2111}, "msg", false);

    assertNotifiedFiles(new File[] {folder1, folder11, folder12, folder2, folder21, folder211, folder2111});
}
 
Example #20
Source File: CopyTestHidden.java    From netbeans with Apache License 2.0 6 votes vote down vote up
private void testCopyURL2URLPrevRevision(String srcPath,
                                         String targetFileName) throws Exception {
    createAndCommitParentFolders(srcPath);
    File file = createFile(srcPath);
    write(file, 1);
    add(file);
    commit(file);
    SVNRevision prevRev = getRevision(file);
    write(file, 2);
    commit(getWC());

    File filecopy = createFile(renameFile(srcPath, targetFileName));
    filecopy.delete();

    ISVNClientAdapter c = getNbClient();
    c.copy(getFileUrl(file), getFileUrl(filecopy), "copy", prevRev);

    ISVNLogMessage[] logs = getLog(getFileUrl(filecopy));
    assertEquals(((SVNRevision.Number)prevRev).getNumber() ,logs[0].getChangedPaths()[0].getCopySrcRevision().getNumber());

    InputStream is = getContent(getFileUrl(filecopy));
    assertContents(is, 1);
    assertNotifiedFiles(new File[] {});
}
 
Example #21
Source File: CommitAction.java    From netbeans with Apache License 2.0 6 votes vote down vote up
/**
 * Returns log message for given revision
 * @param client
 * @param file
 * @param revision
 * @return log message
 * @throws org.tigris.subversion.svnclientadapter.SVNClientException
 */
private static ISVNLogMessage getLogMessage (ISVNClientAdapter client, File file, long revision) throws SVNClientException {
    SVNRevision rev = SVNRevision.HEAD;
    ISVNLogMessage log = null;
    try {
        rev = SVNRevision.getRevision(String.valueOf(revision));
    } catch (ParseException ex) {
        Subversion.LOG.log(Level.WARNING, "" + revision, ex);
    }
    if (Subversion.LOG.isLoggable(Level.FINER)) {
        Subversion.LOG.log(Level.FINER, "{0}: getting last commit message for svn hooks", CommitAction.class.getName());
    }
    // log has to be called directly on the file
    final SVNUrl fileRepositoryUrl = SvnUtils.getRepositoryUrl(file);
    ISVNLogMessage[] ls = client.getLogMessages(fileRepositoryUrl, rev, rev);
    if (ls.length > 0) {
        log = ls[0];
    } else {
        Subversion.LOG.log(Level.WARNING, "no logs available for file {0} with repo url {1}", new Object[]{file, fileRepositoryUrl});
    }
    return log;
}
 
Example #22
Source File: CheckoutTestHidden.java    From netbeans with Apache License 2.0 6 votes vote down vote up
private void testCheckoutFolder(String repoFolderName,
                                String targetFolderName) throws Exception {
    File cifolder = createFolder(repoFolderName);
    File folder1 = createFolder(cifolder, "folder1");
    File file = createFile(folder1, "file");

    importFile(cifolder);        

    File checkout = createFolder(targetFolderName);
    SVNUrl url = getTestUrl().appendPath(cifolder.getName());
    ISVNClientAdapter c = getNbClient();         
    c.checkout(url, checkout, SVNRevision.HEAD, true);
            
    File chFolder1 = new File(checkout, folder1.getName());
    File chFile = new File(chFolder1, file.getName());
    
    assertTrue(chFolder1.exists());
    assertTrue(chFile.exists());
    assertStatus(SVNStatusKind.NORMAL, checkout);                   
    assertStatus(SVNStatusKind.NORMAL, chFolder1);        
    assertStatus(SVNStatusKind.NORMAL, chFile);

    assertNotifiedFiles(new File[] {chFolder1, chFile});
}
 
Example #23
Source File: AddTestHidden.java    From netbeans with Apache License 2.0 6 votes vote down vote up
public void testAddNoDirectory() throws Exception {
    File file = new File(getWC(), "fail");

    assertStatus(SVNStatusKind.NONE, file);

    SVNClientException e = null;
    try {
        ISVNClientAdapter c = getNbClient();
        c.addDirectory(file, false);
    } catch (SVNClientException ex) {
        e = ex;
    }
    if (isJavahl()) {
        assertNotNull(e);
        assertTrue(e.getMessage().indexOf("is not a working copy") > -1 || e.getMessage().indexOf("not found") > -1);
    }

    assertNotifiedFiles(new File[] {});
}
 
Example #24
Source File: CopyTestHidden.java    From netbeans with Apache License 2.0 6 votes vote down vote up
private void testCopyURL2File(String srcPath, String targetFileName) throws Exception {
    createAndCommitParentFolders(srcPath);
    File file = createFile(srcPath);
    add(file);
    commit(file);

    File filecopy = createFile(renameFile(srcPath, targetFileName));
    filecopy.delete();

    ISVNClientAdapter c = getNbClient();
    c.copy(getFileUrl(file), filecopy, SVNRevision.HEAD);

    assertTrue(filecopy.exists());
    assertStatus(SVNStatusKind.ADDED, filecopy);
    if (isSvnkit()) {
        // svnkit does not notify about files
        assertNotifiedFiles(new File[] {});
    } else {
        assertNotifiedFiles(new File[] {filecopy});
    }
}
 
Example #25
Source File: ResolveTreeConflictWizard.java    From APICloud-Studio with GNU General Public License v3.0 6 votes vote down vote up
private ISVNLogMessage[] getLogMessages() throws Exception {
	if (logMessages == null) {
		ISVNClientAdapter svnClient = null;
		try {
			svnClient = svnResource.getRepository().getSVNClient();
			IProject project = treeConflict.getResource().getProject();
			ISVNLocalResource svnProject =  SVNWorkspaceRoot.getSVNResourceFor(project);
			SVNRevision revision1 = new SVNRevision.Number(treeConflict.getConflictDescriptor().getSrcLeftVersion().getPegRevision());
			SVNRevision revision2 = new SVNRevision.Number(treeConflict.getConflictDescriptor().getSrcRightVersion().getPegRevision());
			logMessages = svnClient.getLogMessages(svnProject.getUrl(), revision1, revision2, true); 
		} catch (Exception e) {
			throw e;
		}
		finally {
			svnResource.getRepository().returnSVNClient(svnClient);
		}
	}
	return logMessages;
}
 
Example #26
Source File: LocalFile.java    From APICloud-Studio with GNU General Public License v3.0 5 votes vote down vote up
public void addKeywords(SVNKeywords svnKeywords) throws SVNException {
	ISVNClientAdapter svnClient = null;
    try {
        svnClient = getRepository().getSVNClient();
        OperationManager.getInstance().beginOperation(svnClient);
        svnClient.addKeywords(getFile(), svnKeywords);
    } catch (SVNClientException e) {
        throw SVNException.wrapException(e); 
    } finally {
    	getRepository().returnSVNClient(svnClient);
        OperationManager.getInstance().endOperation();
    }        
}
 
Example #27
Source File: PropertyCompareRemoteResourceNode.java    From APICloud-Studio with GNU General Public License v3.0 5 votes vote down vote up
public void getProperties(boolean recursive) {
	ISVNClientAdapter svnClient = null;
	try {
		svnClient = remoteResource.getRepository().getSVNClient();
		properties = svnClient.getProperties(remoteResource.getUrl(), remoteResource.getRevision(), pegRevision, recursive);
	} catch (Exception e) {
		SVNUIPlugin.log(Status.ERROR, e.getMessage(), e);
	}
   	finally {
   		remoteResource.getRepository().returnSVNClient(svnClient);
   	}		
}
 
Example #28
Source File: BranchTagCommand.java    From APICloud-Studio with GNU General Public License v3.0 5 votes vote down vote up
public BranchTagCommand(ISVNClientAdapter svnClient, IResource[] resources, SVNUrl[] sourceUrls, SVNUrl destinationUrl, String message, boolean createOnServer, SVNRevision revision) {
    super();
    this.svnClient = svnClient;
    this.resources = resources;
    this.sourceUrls = sourceUrls;
    this.destinationUrl = destinationUrl;
    this.createOnServer = createOnServer;
    this.message = message;
    this.revision = revision;        
}
 
Example #29
Source File: PropertyTestHidden.java    From netbeans with Apache License 2.0 5 votes vote down vote up
public void testPropertySetGetDelRecursivelly() throws Exception {                                                
    File folder = createFolder("folder");        
    File file = createFolder(folder, "file");        
    File folder1 = createFolder(folder, "folder1");        
    File file1 = createFolder(folder1, "file1");        
    
    add(folder);
    add(file);
    add(folder1);
    add(file1);
    commit(getWC());
    
    ISVNClientAdapter c = getNbClient();        
    c.propertySet(folder, "p1", "v1", true);
    assertNotifiedFiles(folder, file, folder1, file1);

    assertPropertyStatus(SVNStatusKind.MODIFIED, file);
    assertPropertyStatus(SVNStatusKind.MODIFIED, folder);
    assertPropertyStatus(SVNStatusKind.MODIFIED, folder1);
    assertPropertyStatus(SVNStatusKind.MODIFIED, file1);
    
    assertProperty(c, file, "p1", "v1");
    assertProperty(c, folder, "p1", "v1");
    assertProperty(c, folder1, "p1", "v1");
    assertProperty(c, file1, "p1", "v1");                
    
    clearNotifiedFiles();
    c.propertyDel(folder, "p1", true);
    assertPropertyStatus(SVNStatusKind.NONE, folder);
    assertPropertyStatus(SVNStatusKind.NONE, file);
    assertPropertyStatus(SVNStatusKind.NONE, folder1);
    assertPropertyStatus(SVNStatusKind.NONE, file1);
    assertNotifiedFiles(folder, file, folder1, file1);
}
 
Example #30
Source File: AddTestHidden.java    From netbeans with Apache License 2.0 5 votes vote down vote up
public void testAddDirectory() throws Exception {
    File folder = createFolder("folder");

    assertStatus(SVNStatusKind.UNVERSIONED, folder);
    ISVNClientAdapter c = getNbClient();
    c.addDirectory(folder, false);
    assertStatus(SVNStatusKind.ADDED, folder);

    assertNotifiedFiles(folder);
}