/** * @return the UUID of a repository * @deprecated use {@link #getRepositoryUUID(boolean) } instead */ public String getRepositoryUUID() { try { return getRepositoryUUID(false); } catch (SVNException e) { } return myRepositoryUUID; }
/** * @return the UUID of a repository * @deprecated use {@link #getRepositoryUUID(boolean) } instead */ public String getRepositoryUUID() { try { return getRepositoryUUID(false); } catch (SVNException e) { } return myRepositoryUUID; }
/** * @return the UUID of a repository * @deprecated use {@link #getRepositoryUUID(boolean) } instead */ public String getRepositoryUUID() { try { return getRepositoryUUID(false); } catch (SVNException e) { } return myRepositoryUUID; }
/** * @return the UUID of a repository * @deprecated use {@link #getRepositoryUUID(boolean) } instead */ public String getRepositoryUUID() { try { return getRepositoryUUID(false); } catch (SVNException e) { } return myRepositoryUUID; }
public String getReposUUID() throws ClientException { try { return svnRepository.getRepositoryUUID(false); } catch (SVNException e) { throw ClientException.fromException(e); } }
public String getRepositoryUUID(boolean forceConnect) throws SVNException { return getRepository().getRepositoryUUID(forceConnect); }
/** * Repository UUID. Lazy computed and cached. */ public UUID getUUID(Job context, SCM scm) throws SVNException { if(repositoryUUID==null || repositoryRoot==null) { LOGGER.fine("UUID of " + remote + " not cached for " + context); synchronized (this) { // don't keep connections open for further use to prevent having too many open at the same time. SVNRepository r = openRepository(context, scm, false); if (r.getRepositoryUUID(false) == null) r.testConnection(); // make sure values are fetched repositoryUUID = UUID.fromString(r.getRepositoryUUID(false)); repositoryRoot = r.getRepositoryRoot(true); } } return repositoryUUID; }
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); }
/** * 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; }
/** * 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; }
public void run() throws SVNException { SVNRepository repository = getSVNLookEnvironment().getRepository(); String uuid = repository.getRepositoryUUID(true); getEnvironment().getOut().println(uuid); }
public void run() throws SVNException { SVNRepository repository = getSVNLookEnvironment().getRepository(); String uuid = repository.getRepositoryUUID(true); getEnvironment().getOut().println(uuid); }
@Override public String getRepositoryId() { String repositoryUUID; try { String encodedUrl = SVNEncodingUtil.autoURIEncode(addressSvn); SVNRepository repository = SVNRepositoryFactory.create(SVNURL.parseURIEncoded(encodedUrl)); ISVNAuthenticationManager svnAuthManager = SVNWCUtil.createDefaultAuthenticationManager(); repository.setAuthenticationManager(svnAuthManager); repositoryUUID = repository.getRepositoryUUID(true); } catch (SVNException e) { if (log.isDebugEnabled()) { log.debug("Can't get UUID", e); } return null; } return repositoryUUID; }
protected SVNRepository createRepository(SVNURL url, String uuid, boolean mayReuse) throws SVNException { SVNRepository repository = null; if (myRepositoryPool == null) { repository = SVNRepositoryFactory.create(url, null); } else { repository = myRepositoryPool.createRepository(url, mayReuse); } if (uuid != null) { String reposUUID = repository.getRepositoryUUID(true); if (!uuid.equals(reposUUID)) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.RA_UUID_MISMATCH, "Repository UUID ''{0}'' doesn''t match expected UUID ''{1}''", new Object[] { reposUUID, uuid }); SVNErrorManager.error(err, SVNLogType.WC); } } repository.setDebugLog(getDebugLog()); repository.setCanceller(getEventDispatcher()); return repository; }
protected SVNRepository createRepository(SVNURL url, String uuid, boolean mayReuse) throws SVNException { SVNRepository repository = null; if (myRepositoryPool == null) { repository = SVNRepositoryFactory.create(url, null); } else { repository = myRepositoryPool.createRepository(url, mayReuse); } if (uuid != null) { String reposUUID = repository.getRepositoryUUID(true); if (!uuid.equals(reposUUID)) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.RA_UUID_MISMATCH, "Repository UUID ''{0}'' doesn''t match expected UUID ''{1}''", new Object[] { reposUUID, uuid }); SVNErrorManager.error(err, SVNLogType.WC); } } repository.setDebugLog(getDebugLog()); repository.setCanceller(getEventDispatcher()); return repository; }
private SessionInfo openSourceRepository(SVNRepository targetRepos) throws SVNException { String fromURL = targetRepos.getRevisionPropertyValue(0, SVNRevisionProperty.FROM_URL); String fromUUID = targetRepos.getRevisionPropertyValue(0, SVNRevisionProperty.FROM_UUID); String lastMergedRev = targetRepos.getRevisionPropertyValue(0, SVNRevisionProperty.LAST_MERGED_REVISION); if (fromURL == null || fromUUID == null || lastMergedRev == null) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.IO_ERROR, "Destination repository has not been initialized"); SVNErrorManager.error(err); } SVNURL srcURL = SVNURL.parseURIDecoded(fromURL); SVNRepository srcRepos = createRepository(srcURL, false); checkIfRepositoryIsAtRoot(srcRepos, srcURL); String reposUUID = srcRepos.getRepositoryUUID(true); if (!fromUUID.equals(reposUUID)) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.IO_ERROR, "UUID of destination repository ({0}) does not match expected UUID ({1})", new String[] { reposUUID, fromUUID }); SVNErrorManager.error(err); } return new SessionInfo(srcRepos, Long.parseLong(lastMergedRev)); }
private String getUUIDFromPath(SVNWCAccess wcAccess, File path) throws SVNException { SVNEntry entry = wcAccess.getVersionedEntry(path, true); String uuid = null; if (entry.getUUID() != null) { uuid = entry.getUUID(); } else if (entry.getURL() != null) { SVNRepository repos = createRepository(entry.getSVNURL(), null, null, false); try { uuid = repos.getRepositoryUUID(true); } finally { repos.closeSession(); } } else { if (wcAccess.isWCRoot(path)) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.ENTRY_MISSING_URL, "''{0}'' has no URL", path); SVNErrorManager.error(err, SVNLogType.WC); } uuid = getUUIDFromPath(wcAccess, path.getParentFile()); } return uuid; }
private String getUUIDFromPath(SVNWCAccess wcAccess, File path) throws SVNException { SVNEntry entry = wcAccess.getVersionedEntry(path, true); String uuid = null; if (entry.getUUID() != null) { uuid = entry.getUUID(); } else if (entry.getURL() != null) { SVNRepository repos = createRepository(entry.getSVNURL(), null, null, false); try { uuid = repos.getRepositoryUUID(true); } finally { repos.closeSession(); } } else { if (wcAccess.isWCRoot(path)) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.ENTRY_MISSING_URL, "''{0}'' has no URL", path); SVNErrorManager.error(err, SVNLogType.WC); } uuid = getUUIDFromPath(wcAccess, path.getParentFile()); } return uuid; }
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(); }