/** * @return the repository root directory location url * @see #getRepositoryRoot(boolean) * * @deprecated use #getRepositoryRoot(boolean) instead */ public SVNURL getRepositoryRoot() { try { return getRepositoryRoot(false); } catch (SVNException e) { // will not be thrown. } return null; }
public static String getRelativePath(SVNURL repoURL, SVNRepository repository) throws SVNException { String repoPath = repoURL.getPath().substring(repository.getRepositoryRoot(false).getPath().length()); if (repoPath.length() > 0 && !repoPath.startsWith("/")) { repoPath = "/" + repoPath; } return repoPath; }
public static String getRelativePath(SVNURL repoURL, SVNRepository repository) throws SVNException { String repoPath = repoURL.getPath().substring(repository.getRepositoryRoot(false).getPath().length()); if (!repoPath.startsWith("/")) { repoPath = "/" + repoPath; } return repoPath; }
public static String getRelativePath(SVNURL repoURL, SVNRepository repository) throws SVNException { String repoPath = repoURL.getPath().substring(repository.getRepositoryRoot(true).getPath().length()); if(!repoPath.startsWith("/")) repoPath="/"+repoPath; return repoPath; }
public static String getRelativePath(SVNURL repoURL, SVNRepository repository) throws SVNException { String repoPath = repoURL.getPath().substring(repository.getRepositoryRoot(true).getPath().length()); if(!repoPath.startsWith("/")) repoPath="/"+repoPath; return repoPath; }
public static SVNPathRevision createWithRepository(SVNRepository svnRepository, SVNURL url, long revision) throws SVNException { SVNURL repositoryRoot = svnRepository.getRepositoryRoot(false); String repositoryUUID = svnRepository.getRepositoryUUID(false); return new SVNPathRevision(url, revision, repositoryRoot, repositoryUUID); }
public String getReposRootUrl() throws ClientException { try { final SVNURL repositoryRoot = svnRepository.getRepositoryRoot(false); return repositoryRoot.toString(); } catch (SVNException e) { throw ClientException.fromException(e); } }
/** * Repository UUID. Lazy computed and cached. */ public UUID getUUID(AbstractProject context) throws SVNException { if (repositoryUUID == null || repositoryRoot == null) { synchronized (this) { SVNRepository r = openRepository(context); r.testConnection(); // make sure values are fetched repositoryUUID = UUID.fromString(r.getRepositoryUUID(false)); repositoryRoot = r.getRepositoryRoot(false); } } return repositoryUUID; }
protected SVNURL ensureSessionURL(SVNRepository repository, SVNURL url) throws SVNException { SVNURL oldURL = repository.getLocation(); if (url == null) { url = repository.getRepositoryRoot(true); } if (!url.equals(oldURL)) { repository.setLocation(url, false); return oldURL; } return null; }
private void checkIfRepositoryIsAtRoot(SVNRepository repos, SVNURL url) throws SVNException { SVNURL reposRoot = repos.getRepositoryRoot(true); if (!reposRoot.equals(url)) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.IO_ERROR, "Session is rooted at ''{0}'' but the repos root is ''{1}''", new SVNURL[] { url, reposRoot }); SVNErrorManager.error(err, SVNLogType.FSFS); } }
protected static SVNURL ensureSessionURL(SVNRepository repository, SVNURL url) throws SVNException { SVNURL oldURL = repository.getLocation(); if (url == null) { url = repository.getRepositoryRoot(true); } if (!url.equals(oldURL)) { repository.setLocation(url, false); return oldURL; } return oldURL; }
protected SVNURL ensureSessionURL(SVNRepository repository, SVNURL url) throws SVNException { SVNURL oldURL = repository.getLocation(); if (url == null) { url = repository.getRepositoryRoot(true); } if (!url.equals(oldURL)) { repository.setLocation(url, false); return oldURL; } return null; }
private void checkIfRepositoryIsAtRoot(SVNRepository repos, SVNURL url) throws SVNException { SVNURL reposRoot = repos.getRepositoryRoot(true); if (!reposRoot.equals(url)) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.IO_ERROR, "Session is rooted at ''{0}'' but the repos root is ''{1}''", new SVNURL[] { url, reposRoot }); SVNErrorManager.error(err, SVNLogType.FSFS); } }
protected SVNURL ensureSessionURL(SVNRepository repository, SVNURL url) throws SVNException { SVNURL oldURL = repository.getLocation(); if (url == null) { url = repository.getRepositoryRoot(true); } if (!url.equals(oldURL)) { repository.setLocation(url, false); return oldURL; } return null; }
private void checkIfRepositoryIsAtRoot(SVNRepository repos, SVNURL url) throws SVNException { SVNURL reposRoot = repos.getRepositoryRoot(true); if (!reposRoot.equals(url)) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.IO_ERROR, "Session is rooted at ''{0}'' but the repos root is ''{1}''", new SVNURL[] { url, reposRoot }); SVNErrorManager.error(err); } }
private void checkIfRepositoryIsAtRoot(SVNRepository repos, SVNURL url) throws SVNException { SVNURL reposRoot = repos.getRepositoryRoot(true); if (!reposRoot.equals(url)) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.IO_ERROR, "Session is rooted at ''{0}'' but the repos root is ''{1}''", new SVNURL[] { url, reposRoot }); SVNErrorManager.error(err, SVNLogType.FSFS); } }
@Override protected SVNCommitInfo run() throws SVNException { SVNCommitInfo info = doRun(); if (info != null) { Collection<SvnTarget> targets = getOperation().getTargets(); if (targets != null && targets.size() != 0) { SvnTarget firstTarget = targets.iterator().next(); SVNRepository repository = getRepositoryAccess().createRepository(firstTarget.getURL(), null, true); SVNURL repositoryRoot = repository.getRepositoryRoot(true); getOperation().receive(SvnTarget.fromURL(repositoryRoot), info); } } return info; }
public String getReposRelativePath(String urlString) throws ClientException { try { final SVNURL url = SVNURL.parseURIEncoded(urlString); final SVNURL repositoryRoot = svnRepository.getRepositoryRoot(false); return SVNPathUtil.getPathAsChild(repositoryRoot.getPath(), url.getPath()); } catch (SVNException e) { throw ClientException.fromException(e); } }
public SVNWCDb.ReposInfo fetchReposInfo(SVNURL url, SVNURL lastRepos, String lastUuid) throws SVNException { if (lastRepos != null && SVNPathUtil.isAncestor(lastRepos.toString(), url.toString())) { SVNWCDb.ReposInfo reposInfo = new SVNWCDb.ReposInfo(); reposInfo.reposRootUrl = lastRepos.toString(); reposInfo.reposUuid = lastUuid; return reposInfo; } SVNRepository repository = getRepositoryAccess().createRepository(url, null, true); SVNWCDb.ReposInfo reposInfo = new SVNWCDb.ReposInfo(); reposInfo.reposRootUrl = repository.getRepositoryRoot(true).toString(); reposInfo.reposUuid = repository.getRepositoryUUID(true); return reposInfo; }
private void fetchReposInfo(SVNEntry entry, RepositoryInfo lastRepositoryInfo) throws SVNException { /* The same info is likely to retrieved multiple times (e.g. externals) */ if (lastRepositoryInfo.repositoryRootUrl != null && SVNURLUtil.isAncestor(lastRepositoryInfo.repositoryRootUrl, getEntryURL(entry))) { entry.setRepositoryRootURL(lastRepositoryInfo.repositoryRootUrl); entry.setUUID(lastRepositoryInfo.UUID); return; } SvnRepositoryAccess repAccess = new SvnOldRepositoryAccess(getOperation()); SVNRepository repository = repAccess.createRepository(getEntryURL(entry), null, true); entry.setRepositoryRootURL(repository.getRepositoryRoot(true)); entry.setUUID(repository.getRepositoryUUID(true)); lastRepositoryInfo.repositoryRootUrl = getEntryRepositoryRootURL(entry); lastRepositoryInfo.UUID = entry.getUUID(); }