Java源码示例:org.tigris.subversion.svnclientadapter.SVNUrl

示例1
private void revert(File file, String revision) {
    final Context ctx = new Context(file);

    final SVNUrl url;
    try {
        url = SvnUtils.getRepositoryRootUrl(file);
    } catch (SVNClientException ex) {
        SvnClientExceptionHandler.notifyException(ex, true, true);
        return;
    }
    final RepositoryFile repositoryFile = new RepositoryFile(url, url, SVNRevision.HEAD);

    final RevertModifications revertModifications = new RevertModifications(repositoryFile, revision);
    if(!revertModifications.showDialog()) {
        return;
    }

    RequestProcessor rp = Subversion.getInstance().getRequestProcessor(url);
    SvnProgressSupport support = new SvnProgressSupport() {
        @Override
        public void perform() {
            RevertModificationsAction.performRevert(revertModifications.getRevisionInterval(), revertModifications.revertNewFiles(), !revertModifications.revertRecursively(), ctx, this);
        }
    };
    support.start(rp, url, NbBundle.getMessage(AnnotationBar.class, "MSG_Revert_Progress")); // NOI18N
}
 
示例2
@Override
public boolean areCollocated(File a, File b) {
    File fra = getTopmostManagedAncestor(a);
    File frb = getTopmostManagedAncestor(b);
    if (fra == null || !fra.equals(frb)) return false;
    try {
        SVNUrl ra = SvnUtils.getRepositoryRootUrl(a);
        if(ra == null) {
            // this might happen. there is either no svn client available or
            // no repository url stored in the metadata (svn < 1.3).
            // one way or another, can't do anything reasonable at this point
            Subversion.LOG.log(Level.WARNING, "areCollocated returning false due to missing repository url for {0} {1}", new Object[] {a, b});
            return false;
        }
        SVNUrl rb = SvnUtils.getRepositoryRootUrl(b);
        SVNUrl rr = SvnUtils.getRepositoryRootUrl(fra);
        return ra.equals(rb) && ra.equals(rr);
    } catch (SVNClientException e) {
        if (!WorkingCopyAttributesCache.getInstance().isSuppressed(e)) {
            Subversion.LOG.log(Level.INFO, null, e);
        }
        Subversion.LOG.log(Level.WARNING, "areCollocated returning false due to catched exception " + a + " " + b);
        // root not found
        return false;
    }
}
 
示例3
/**
 * Validates the contents of the editable fields and set page completion
 * and error messages appropriately. Call each time folder name or parent url
    * is modified
 */
private void validateFields() {
	if (resourceNameText.getText().length() == 0) {
		setErrorMessage(null);
		setPageComplete(false);
		return;
	}
	try {
		new SVNUrl(Util.appendPath(urlParentText.getText(), resourceNameText.getText()));
	} catch (MalformedURLException e) {
		setErrorMessage(Policy.bind("MoveRemoteResourceWizardMainPage.invalidUrl")); //$NON-NLS-1$);
		setPageComplete(false);
		return;
	}
	setErrorMessage(null);
	setPageComplete(true);
}
 
示例4
@NbBundle.Messages("CTL_Action_Cancel=Cancel")
public static boolean handleAuth (SVNUrl url) {
    SvnKenaiAccessor support = SvnKenaiAccessor.getInstance();
    String sUrl = url.toString();
    if(support.isKenai(sUrl)) {
        return support.showLogin() && support.getPasswordAuthentication(sUrl, true) != null;
    } else {
        Repository repository = new Repository(Repository.FLAG_SHOW_PROXY, org.openide.util.NbBundle.getMessage(SvnClientExceptionHandler.class, "MSG_Error_ConnectionParameters"));  // NOI18N
        repository.selectUrl(url, true);

        JButton retryButton = new JButton(org.openide.util.NbBundle.getMessage(SvnClientExceptionHandler.class, "CTL_Action_Retry"));           // NOI18N
        String title = org.openide.util.NbBundle.getMessage(SvnClientExceptionHandler.class, "MSG_Error_AuthFailed");
        Object option = repository.show(
                title, 
                new HelpCtx("org.netbeans.modules.subversion.client.SvnClientExceptionHandler"), //NOI18N
                new Object[] { retryButton,
                    Bundle.CTL_Action_Cancel()
                }, retryButton);

        boolean ret = (option == retryButton);
        if(ret) {
            SvnModuleConfig.getDefault().insertRecentUrl(repository.getSelectedRC());
        }
        return ret;
    }
}
 
示例5
protected void execute(IAction action) throws InvocationTargetException, InterruptedException {
    if (action != null && !action.isEnabled()) { 
    	action.setEnabled(true);
    } 
    else {
     IResource[] resources = getSelectedResources();
    	BranchTagWizard wizard = new BranchTagWizard(resources);
    	SizePersistedWizardDialog dialog = new SizePersistedWizardDialog(getShell(), wizard, "BranchTag"); //$NON-NLS-1$
    	wizard.setParentDialog(dialog);
    	if (dialog.open() == WizardDialog.OK) {	
    		SVNUrl[] sourceUrls = wizard.getUrls();
    		SVNUrl destinationUrl = wizard.getToUrl();
    		String message = wizard.getComment();
    		boolean createOnServer = wizard.isCreateOnServer();
         BranchTagOperation branchTagOperation = new BranchTagOperation(getTargetPart(), getSelectedResources(), sourceUrls, destinationUrl, createOnServer, wizard.getRevision(), message);
         branchTagOperation.setMakeParents(wizard.isMakeParents());
         branchTagOperation.setMultipleTransactions(wizard.isSameStructure());
         branchTagOperation.setNewAlias(wizard.getNewAlias());
         branchTagOperation.switchAfterTagBranchOperation(wizard.isSwitchAfterBranchTag());
         branchTagOperation.setSvnExternals(wizard.getSvnExternals());
         branchTagOperation.run();        		
    	}
    }
}
 
示例6
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");
}
 
示例7
public void copy(File srcPath, SVNUrl destUrl, String message)
		throws SVNClientException {
	try {
		String fixedMessage = fixSVNString(message);
		if (fixedMessage == null)
			fixedMessage = "";
		notificationHandler.setCommand(ISVNNotifyListener.Command.COPY);
		String src = fileToSVNPath(srcPath, false);
		String dest = destUrl.toString();
		notificationHandler.logCommandLine("copy " + src + " " + dest);
		notificationHandler.setBaseDir(SVNBaseDir.getBaseDir(srcPath));
		List<CopySource> copySources = new ArrayList<CopySource>();
		copySources.add(new CopySource(src, Revision.WORKING,
				Revision.WORKING));
		svnClient.copy(copySources, dest, true, true, true, null,
				new JhlCommitMessage(fixedMessage), null);
		// last parameter is not used
	} catch (ClientException e) {
		notificationHandler.logException(e);
		throw new SVNClientException(e);
	}
}
 
示例8
public RepositoryFile(SVNUrl repositoryUrl, String[] pathSegments, SVNRevision revision) throws MalformedURLException {
    this(repositoryUrl, revision);
    this.pathSegments = pathSegments;    
    repositoryRoot = pathSegments == null;        
    
    if(!repositoryRoot) {
        StringBuffer sb = new StringBuffer();
        for (int i = 0; i < pathSegments.length; i++) {
            sb.append(pathSegments[i]);
            if(i<pathSegments.length-1) {
            sb.append("/"); // NOI18N
            }            
        }
        path = sb.toString();        
        fileUrl = repositoryUrl.appendPath(path);        
    }
}
 
示例9
public void propertySet(SVNUrl url, SVNRevision.Number baseRev,
		String propertyName, String propertyValue, String message)
		throws SVNClientException {
	try {
		notificationHandler.setCommand(ISVNNotifyListener.Command.PROPSET);
		if (propertyName.startsWith("svn:")) {
			// Normalize line endings in property value
			svnClient.propertySetRemote(url.toString(),
					baseRev.getNumber(), propertyName,
					fixSVNString(propertyValue).getBytes(),
					new JhlCommitMessage(message), false, null,
					new JhlCommitCallback());
		} else {
			svnClient.propertySetRemote(url.toString(),
					baseRev.getNumber(), propertyName,
					propertyValue.getBytes(),
					new JhlCommitMessage(message), false, null,
					new JhlCommitCallback());
		}
	} catch (ClientException e) {
		notificationHandler.logException(e);
		throw new SVNClientException(e);
	}
}
 
示例10
public void testProcessRecentFolders_NoBranchInHistory_OnTrunk () throws Exception {
    JComboBox combo = new JComboBox();
    JTextComponent comp = (JTextComponent) combo.getEditor().getEditorComponent();
    Map<String, String> items;
    // combo items should be sorted by name
    
    // file on trunk, no branch in history
    items = CopyDialog.setupModel(combo, new RepositoryFile(new SVNUrl("file:///home"), "trunk/subfolder/folder", SVNRevision.HEAD), recentUrlsWithoutBranches, false);
    assertModel(items, combo, Arrays.asList(new String[] {
        "trunk/subfolder/folder", null,
        "----------", null,
        MORE_BRANCHES, null,
        "----------", null,
        "Project/src/folder", null,
        "Project2/src/folder", null,
        "trunk/Project/src/folder", null
    }));
    // least recently used is preselected
    assertEquals("branches/[BRANCH_NAME]/subfolder/folder", comp.getText());
    // no branch - no selection
    assertEquals("[BRANCH_NAME]", comp.getSelectedText());
}
 
示例11
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});
}
 
示例12
public RepositoryFile(SVNUrl repositoryUrl, SVNUrl fileUrl, SVNRevision revision) {       
    this(repositoryUrl, revision);
    this.fileUrl = fileUrl;        
    repositoryRoot = fileUrl == null;   
    
    if(!repositoryRoot) {            
        String[] fileUrlSegments = fileUrl.getPathSegments();
        int fileSegmentsLength = fileUrlSegments.length;
        int repositorySegmentsLength = repositoryUrl.getPathSegments().length;
        pathSegments = new String[fileSegmentsLength - repositorySegmentsLength];
        StringBuffer sb = new StringBuffer();
        for (int i = repositorySegmentsLength; i < fileSegmentsLength; i++) {
            pathSegments[i-repositorySegmentsLength] = fileUrlSegments[i];
            sb.append(fileUrlSegments[i]);
            if(i-repositorySegmentsLength < pathSegments.length-1) {
                sb.append("/"); // NOI18N
            }
        }    
        path = sb.toString();
    }                
}
 
示例13
public InputStream getContent(SVNUrl url, SVNRevision revision,
		SVNRevision pegRevision) throws SVNClientException {
	try {
		notificationHandler.setCommand(ISVNNotifyListener.Command.CAT);
		String commandLine = "cat -r " + revision + " " + url;
		if (pegRevision != null) {
			commandLine = commandLine + "@" + pegRevision;
		}
		notificationHandler.logCommandLine(commandLine);
		notificationHandler.setBaseDir();

		byte[] contents = svnClient.fileContent(url.toString(),
				JhlConverter.convert(revision),
				JhlConverter.convert(pegRevision));
		InputStream input = new ByteArrayInputStream(contents);
		return input;
	} catch (ClientException e) {
		notificationHandler.logException(e);
		throw new SVNClientException(e);
	}
}
 
示例14
public void mkdir(SVNUrl url, boolean makeParents, String message)
		throws SVNClientException {
	try {
		String fixedMessage = fixSVNString(message);

		if (fixedMessage == null)
			fixedMessage = "";
		notificationHandler.setCommand(ISVNNotifyListener.Command.MKDIR);
		Set<String> target = new HashSet<String>();
		target.add(url.toString());
		if (makeParents)
			notificationHandler.logCommandLine("mkdir --parents -m \""
					+ getFirstMessageLine(fixedMessage) + "\" " + target);
		else
			notificationHandler.logCommandLine("mkdir -m \""
					+ getFirstMessageLine(fixedMessage) + "\" " + target);
		notificationHandler.setBaseDir();
		svnClient.mkdir(target, makeParents, null, new JhlCommitMessage(
				fixedMessage), null);
	} catch (ClientException e) {
		notificationHandler.logException(e);
		throw new SVNClientException(e);
	}
}
 
示例15
public SVNUrl getDestinationUrl(String sourceUrl) {
	if (!multipleTransactions) {
		if (sourceUrls.length == 1) {
			return destinationUrl;
		} else {
			String uncommonPortion = sourceUrl.substring(getCommonRoot().length());
			String toUrl = destinationUrl.toString() + uncommonPortion;
			try {
	return new SVNUrl(toUrl);
} catch (MalformedURLException e) {
	return destinationUrl;
}   			
		}
	}
	else return (SVNUrl)urlMap.get(sourceUrl);
}
 
示例16
protected void showLog() {
 ISVNRemoteResource remoteResource = null;
    try {
        remoteResource = SVNWorkspaceRoot.getSVNResourceFor(resources[0]).getRepository().getRemoteFile(new SVNUrl(commonRoot));
    } catch (Exception e) {
        MessageDialog.openError(getShell(), Policy.bind("MergeDialog.showLog"), e.toString()); //$NON-NLS-1$
        return;
    }
    if (remoteResource == null) {
        MessageDialog.openError(getShell(), Policy.bind("MergeDialog.showLog"), Policy.bind("MergeDialog.urlError") + " " + commonRoot); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
        return;	            
    }	
    HistoryDialog dialog = new HistoryDialog(getShell(), remoteResource);
    if (dialog.open() == HistoryDialog.CANCEL) return;
    ILogEntry[] selectedEntries = dialog.getSelectedLogEntries();
    if (selectedEntries.length == 0) return;
    revisionText.setText(Long.toString(selectedEntries[selectedEntries.length - 1].getRevision().getNumber()));
    setPageComplete(canFinish());
}
 
示例17
private Setup createSetup (SVNDiffSummary summary, File file, SVNUrl leftUrl, SVNRevision leftRevision,
        SVNUrl rightUrl, String rightRevision) {
    FileInformation fi = null;
    Setup localSetup = wcSetups.get(file);
    boolean deleted = summary.getDiffKind() == SVNDiffKind.DELETED;
    boolean added = summary.getDiffKind() == SVNDiffKind.ADDED;
    if (localSetup != null) {
        // local file, diffing WC
        fi = cache.getStatus(file);
        if (added && (fi.getStatus() & FileInformation.STATUS_IN_REPOSITORY) == 0) {
            // don't override added status with modified
            fi = null;
        } else {
            deleted = (fi.getStatus() & (FileInformation.STATUS_VERSIONED_DELETEDLOCALLY
                    | FileInformation.STATUS_VERSIONED_REMOVEDLOCALLY)) != 0;
            added = (fi.getStatus() & (FileInformation.STATUS_VERSIONED_ADDEDLOCALLY
                    | FileInformation.STATUS_NOTVERSIONED_NEWLOCALLY)) != 0;
        }
    }
    if (fi == null) {
        fi = new RevisionsFileInformation(summary);
    }
    wcSetups.remove(file);
    Setup setup = new Setup(file, repositoryUrl,
            leftUrl, added ? null : leftRevision.toString(),
            SVNUrlUtils.getRelativePath(repositoryUrl, leftUrl) + "@" + leftRevision,
            rightUrl, deleted ? null : rightRevision,
            Setup.REVISION_CURRENT.equals(rightRevision)
            ? file.getName() + "@" + rightRevision
            : SVNUrlUtils.getRelativePath(repositoryUrl, rightUrl) + "@" + rightRevision,
            fi);
    setup.setNode(new DiffNode(setup, new SvnFileNode(file), FileInformation.STATUS_ALL));
    return setup;
}
 
示例18
private void notifyChanges (HashMap<Long, Notification> notifications, SVNUrl repositoryUrl) {
    for (Map.Entry<Long, Notification> e : notifications.entrySet()) {
        Notification notification = e.getValue();
        File[] files = notification.getFiles();
        Long revision = notification.getRevision();
        notifyFileChange(files, files[0].getParentFile(), repositoryUrl.toString(), revision == null ? null : revision.toString());
    }
}
 
示例19
/**
 * Returns repository root url for the given file or null if the repository is unknown or does not belong to allowed urls.
 * Currently allowed repositories are kenai repositories.
 * @param file
 * @return
 */
private SVNUrl getRepositoryRoot (File file) {
    SVNUrl repositoryUrl = null;
    SVNUrl url = getRepositoryUrl(file);
    if (url != null && kenaiAccessor.isKenai(url.toString()) && kenaiAccessor.isLogged(url.toString())) {
        repositoryUrl = url;
    }
    return repositoryUrl;
}
 
示例20
@Override
public ISVNProperty[] getProperties(SVNUrl url) throws SVNClientException {
    ListPropertiesCommand cmd = new ListPropertiesCommand(url, false);
    exec(cmd);
    List<String> names = cmd.getPropertyNames();
    List<ISVNProperty> props = new ArrayList<ISVNProperty>(names.size());
    for (String name : names) {
        ISVNProperty prop = propertyGet(url, name);
        if (prop != null) {
            props.add(prop);
        }
    }
    return props.toArray(new ISVNProperty[props.size()]);
}
 
示例21
private boolean setProxy(SVNUrl url, Ini.Section nbGlobalSection) {
    String host =  SvnUtils.ripUserFromHost(url.getHost());        
    Ini.Section svnGlobalSection = svnServers.get(GLOBAL_SECTION);
    URI uri = null;
    boolean passwordAdded = false;
    try {
        uri = new URI(url.toString());
    } catch (URISyntaxException ex) {
        Subversion.LOG.log(Level.INFO, null, ex);
        return passwordAdded;
    }
    String proxyHost = NetworkSettings.getProxyHost(uri);
    // check DIRECT connection
    if(proxyHost != null && proxyHost.length() > 0) {
        String proxyPort = NetworkSettings.getProxyPort(uri);
        assert proxyPort != null;
        nbGlobalSection.put("http-proxy-host", proxyHost);                     // NOI18N
        nbGlobalSection.put("http-proxy-port", proxyPort);                     // NOI18N

        // and the authentication
        String username = NetworkSettings.getAuthenticationUsername(uri);
        if(username != null) {
            String password = getProxyPassword(NetworkSettings.getKeyForAuthenticationPassword(uri));

            nbGlobalSection.put("http-proxy-username", username);                               // NOI18N
            nbGlobalSection.put("http-proxy-password", password);                               // NOI18N
            passwordAdded = true;
        }
    }
    // check if there are also some no proxy settings
    // we should get from the original svn servers file
    mergeNonProxyKeys(host, svnGlobalSection, nbGlobalSection);
    return passwordAdded;
}
 
示例22
public SVNUrl getUrl() {
	try {
           return (_s.getUrl() != null) ? new SVNUrl(_s.getUrl()) : null;
       } catch (MalformedURLException e) {
           //should never happen.
           return null;
       }
}
 
示例23
private static SvnClient getClient(SVNUrl url, String username, String password) {       
    try {
        if(username != null) {
            password = password != null ? password : "";                    // NOI18N
            return getSubversion().getClient(url, username, password.toCharArray());
        } else {
            return getSubversion().getClient(url);
        }
    } catch (SVNClientException ex) {
        SvnClientExceptionHandler.notifyException(ex, false, true);
    }        
    return null;
}
 
示例24
@Override
public ISVNProperty[] getProperties(SVNUrl url, SVNRevision revision, SVNRevision pegRevision, boolean recursive) throws SVNClientException {
    ListPropertiesCommand cmd = new ListPropertiesCommand(url, revision.toString(), recursive);
    exec(cmd);
    List<String> names = cmd.getPropertyNames();
    List<ISVNProperty> props = new ArrayList<ISVNProperty>(names.size());
    for (String name : names) {
        ISVNProperty prop = propertyGet(url, name);
        if (prop != null) {
            props.add(prop);
        }
    }
    return props.toArray(new ISVNProperty[props.size()]);
}
 
示例25
private void testUpdateFilePrevRevision(String folder1Name,
                                        String folder2Name,
                                        String fileName) throws Exception {
    File wc1 = createFolder(folder1Name);
    File file1 = createFile(wc1, fileName);
    write(file1, 1);
    importFile(wc1);
                    
    assertStatus(SVNStatusKind.NORMAL, wc1);
    assertStatus(SVNStatusKind.NORMAL, file1);
                                    
    File wc2 = createFolder(folder2Name);
    File file2 = new File(wc2, fileName);
    
    SVNUrl url = getTestUrl().appendPath(wc1.getName());
    ISVNClientAdapter c = getNbClient();         
    c.checkout(url, wc2, SVNRevision.HEAD, true);
    assertStatus(SVNStatusKind.NORMAL, file2);
    assertContents(file2, 1);
            
    SVNRevision prevRev = (SVNRevision.Number) getRevision(getRepoUrl());
    
    write(file2, 2);
    assertStatus(SVNStatusKind.MODIFIED, file2);
    commit(file2);
    assertStatus(SVNStatusKind.NORMAL, file2);

    clearNotifiedFiles();             
    long r = c.update(file1, prevRev, false);
    
    SVNRevision revisionAfter = (SVNRevision.Number) getRevision(getRepoUrl());
            
    assertNotSame(r, ((SVNRevision.Number)revisionAfter).getNumber());
    assertEquals(((SVNRevision.Number)prevRev).getNumber(), r);
    assertStatus(SVNStatusKind.NORMAL, file1);
    assertContents(file1, 1);        
    assertNotifiedFiles(new File[] { /*file1*/ }); // XXX no output from cli!
}
 
示例26
public void getLogMessages(SVNUrl url, SVNRevision pegRevision,
		SVNRevision revisionStart, SVNRevision revisionEnd,
		boolean stopOnCopy, boolean fetchChangePath, long limit,
		boolean includeMergedRevisions, String[] requestedProperties,
		ISVNLogMessageCallback worker) throws SVNClientException {

	String target = url.toString();
	notificationHandler.setBaseDir();
	this.getLogMessages(target, pegRevision, revisionStart, revisionEnd,
			stopOnCopy, fetchChangePath, limit, includeMergedRevisions,
			requestedProperties, worker);
}
 
示例27
private void testMkdirUrl(String urlLastPathSegment) throws Exception {
                    
    ISVNClientAdapter c = getNbClient();        
    SVNUrl url = getRepoUrl().appendPath(urlLastPathSegment);
    c.mkdir(url, "trkvadir");

    ISVNInfo info = getInfo(url);
    assertNotNull(info);        
    assertEquals(url.toString(), TestUtilities.decode(info.getUrl()).toString());
    assertNotifiedFiles(new File[] {});        
}
 
示例28
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}); 
}
 
示例29
ISVNProperty propertyGet(PropertyGetCommand cmd, final String name, final SVNUrl url, final File file) throws SVNClientException {
    exec(cmd);
    final byte[] bytes = cmd.getOutput();
    if(bytes == null || bytes.length == 0) {
        return null;
    }
    return new ISVNProperty() {
        @Override
        public String getName() {
            return name;
        }
        @Override
        public String getValue() {
            return new String(bytes);
        }
        @Override
        public File getFile() {
            return file;
        }
        @Override
        public SVNUrl getUrl() {
            return url;
        }
        @Override
        public byte[] getData() {
            return bytes;
        }
    };
}
 
示例30
public ISVNProperty[] getPropertiesIncludingInherited(SVNUrl path,
		boolean includeEmptyProperties, boolean includeClosestOnly,
		List<String> filterProperties) throws SVNClientException {
	ISVNProperty[] properties = getPropertiesIncludingInherited(
			path.toString(), false);
	return filterProperties(properties, includeEmptyProperties,
			includeClosestOnly, filterProperties);
}