protected SVNRepository ensureRepository(SVNRepository repository, SVNURL url) throws SVNException { if (repository != null) { try { ensureSessionURL(repository, url); return repository; } catch (SVNException e) { // } repository = null; } if (repository == null) { repository = createRepository(url, null, null, false); } return repository; }
protected SVNRepository ensureRepository(SVNRepository repository, SVNURL url) throws SVNException { if (repository != null) { try { ensureSessionURL(repository, url); return repository; } catch (SVNException e) { // } repository = null; } if (repository == null) { repository = createRepository(url, null, null, false); } return repository; }
protected SVNRepository ensureRepository(SVNRepository repository, SVNURL url) throws SVNException { if (repository != null) { try { ensureSessionURL(repository, url); return repository; } catch (SVNException e) { // } repository = null; } if (repository == null) { repository = createRepository(url, null, null, false); } return repository; }
protected Map getMergeInfo(SVNURL url, SVNRevision pegRevision, SVNURL repositoryRoot[]) throws SVNException { SVNRepository repository = null; try { repository = createRepository(url, null, null, true); long revisionNum = getRevisionNumber(pegRevision, repository, null); SVNURL reposRoot = repository.getRepositoryRoot(true); if (repositoryRoot != null && repositoryRoot.length > 0) { repositoryRoot[0] = reposRoot; } String relPath = getPathRelativeToRoot(null, url, reposRoot, null, null); return getReposMergeInfo(repository, relPath, revisionNum, SVNMergeInfoInheritance.INHERITED, false); } finally { if (repository != null) { repository.closeSession(); } } }
protected Map getMergeInfo(SVNURL url, SVNRevision pegRevision, SVNURL repositoryRoot[]) throws SVNException { SVNRepository repository = null; try { repository = createRepository(url, null, null, true); long revisionNum = getRevisionNumber(pegRevision, repository, null); SVNURL reposRoot = repository.getRepositoryRoot(true); if (repositoryRoot != null && repositoryRoot.length > 0) { repositoryRoot[0] = reposRoot; } String relPath = getPathRelativeToSession(url, null, repository); if (relPath == null) { repository.setLocation(url, false); relPath = ""; } return getReposMergeInfo(repository, relPath, revisionNum, SVNMergeInfoInheritance.INHERITED, false); } finally { if (repository != null) { repository.closeSession(); } } }
protected Map getMergeInfo(SVNURL url, SVNRevision pegRevision, SVNURL repositoryRoot[]) throws SVNException { SVNRepository repository = null; try { repository = createRepository(url, null, null, true); long revisionNum = getRevisionNumber(pegRevision, repository, null); SVNURL reposRoot = repository.getRepositoryRoot(true); if (repositoryRoot != null && repositoryRoot.length > 0) { repositoryRoot[0] = reposRoot; } String relPath = getPathRelativeToSession(url, null, repository); if (relPath == null) { repository.setLocation(url, false); relPath = ""; } return getReposMergeInfo(repository, relPath, revisionNum, SVNMergeInfoInheritance.INHERITED, false); } finally { if (repository != null) { repository.closeSession(); } } }
public Map getHistoryAsMergeInfo(SVNURL url, File path, SVNRevision pegRevision, long rangeYoungest, long rangeOldest, SVNRepository repos, SVNWCAccess access) throws SVNException { long[] pegRevNum = new long[1]; pegRevNum[0] = SVNRepository.INVALID_REVISION; url = deriveLocation(path, url, pegRevNum, pegRevision, repos, access); boolean closeSession = false; try { if (repos == null) { repos = createRepository(url, null, null, false); closeSession = true; } if (!SVNRevision.isValidRevisionNumber(rangeYoungest)) { rangeYoungest = pegRevNum[0]; } if (!SVNRevision.isValidRevisionNumber(rangeOldest)) { rangeOldest = 0; } Collection segments = repos.getLocationSegments("", pegRevNum[0], rangeYoungest, rangeOldest); return getMergeInfoFromSegments(segments); } finally { if (closeSession) { repos.closeSession(); } } }
protected Map getHistoryAsMergeInfo(SVNURL url, File path, SVNRevision pegRevision, long rangeYoungest, long rangeOldest, SVNRepository repos, SVNWCAccess access) throws SVNException { long[] pegRevNum = new long[1]; pegRevNum[0] = SVNRepository.INVALID_REVISION; url = deriveLocation(path, url, pegRevNum, pegRevision, repos, access); boolean closeSession = false; try { if (repos == null) { repos = createRepository(url, null, null, false); closeSession = true; } if (!SVNRevision.isValidRevisionNumber(rangeYoungest)) { rangeYoungest = pegRevNum[0]; } if (!SVNRevision.isValidRevisionNumber(rangeOldest)) { rangeOldest = 0; } Collection segments = repos.getLocationSegments("", pegRevNum[0], rangeYoungest, rangeOldest); return getMergeInfoFromSegments(segments); } finally { if (closeSession) { repos.closeSession(); } } }
public Map getHistoryAsMergeInfo(SVNURL url, File path, SVNRevision pegRevision, long rangeYoungest, long rangeOldest, SVNRepository repos, SVNWCAccess access) throws SVNException { long[] pegRevNum = new long[1]; pegRevNum[0] = SVNRepository.INVALID_REVISION; url = deriveLocation(path, url, pegRevNum, pegRevision, repos, access); boolean closeSession = false; try { if (repos == null) { repos = createRepository(url, null, null, false); closeSession = true; } if (!SVNRevision.isValidRevisionNumber(rangeYoungest)) { rangeYoungest = pegRevNum[0]; } if (!SVNRevision.isValidRevisionNumber(rangeOldest)) { rangeOldest = 0; } Collection segments = repos.getLocationSegments("", pegRevNum[0], rangeYoungest, rangeOldest); return getMergeInfoFromSegments(segments); } finally { if (closeSession) { repos.closeSession(); } } }
protected Map getMergeInfo(File path, SVNRevision pegRevision, SVNURL repositoryRoot[]) throws SVNException { SVNWCAccess wcAccess = createWCAccess(); try { SVNAdminArea adminArea = wcAccess.probeOpen(path, false, 0); SVNEntry entry = wcAccess.getVersionedEntry(path, false); long revNum[] = { SVNRepository.INVALID_REVISION }; SVNURL url = getEntryLocation(path, entry, revNum, SVNRevision.WORKING); SVNRepository repository = null; try { repository = createRepository(url, null, null, false); repository.assertServerIsMergeInfoCapable(path.toString()); } finally { repository.closeSession(); } SVNURL reposRoot = getReposRoot(path, null, pegRevision, adminArea, wcAccess); if (repositoryRoot != null && repositoryRoot.length > 0) { repositoryRoot[0] = reposRoot; } boolean[] indirect = { false }; return getWCOrRepositoryMergeInfo(path, entry, SVNMergeInfoInheritance.INHERITED, indirect, false, null); } finally { wcAccess.close(); } }
protected Map getMergeInfo(File path, SVNRevision pegRevision, SVNURL repositoryRoot[]) throws SVNException { SVNWCAccess wcAccess = createWCAccess(); try { SVNAdminArea adminArea = wcAccess.probeOpen(path, false, 0); SVNEntry entry = wcAccess.getVersionedEntry(path, false); long revNum[] = { SVNRepository.INVALID_REVISION }; SVNURL url = getEntryLocation(path, entry, revNum, SVNRevision.WORKING); SVNRepository repository = null; try { repository = createRepository(url, null, null, false); repository.assertServerIsMergeInfoCapable(path.toString()); } finally { repository.closeSession(); } SVNURL reposRoot = getReposRoot(path, null, pegRevision, adminArea, wcAccess); if (repositoryRoot != null && repositoryRoot.length > 0) { repositoryRoot[0] = reposRoot; } boolean[] indirect = { false }; return getWCOrRepositoryMergeInfo(path, entry, SVNMergeInfoInheritance.INHERITED, indirect, false, null); } finally { wcAccess.close(); } }
protected Map getMergeInfo(File path, SVNRevision pegRevision, SVNURL repositoryRoot[]) throws SVNException { SVNWCAccess wcAccess = createWCAccess(); try { SVNAdminArea adminArea = wcAccess.probeOpen(path, false, 0); SVNEntry entry = wcAccess.getVersionedEntry(path, false); long revNum[] = { SVNRepository.INVALID_REVISION }; SVNURL url = getEntryLocation(path, entry, revNum, SVNRevision.WORKING); SVNRepository repository = null; try { repository = createRepository(url, null, null, false); repository.assertServerIsMergeInfoCapable(path.toString()); } finally { repository.closeSession(); } SVNURL reposRoot = getReposRoot(path, null, pegRevision, adminArea, wcAccess); if (repositoryRoot != null && repositoryRoot.length > 0) { repositoryRoot[0] = reposRoot; } boolean[] indirect = { false }; return getWCOrRepositoryMergeInfo(path, entry, SVNMergeInfoInheritance.INHERITED, indirect, false, null); } finally { wcAccess.close(); } }
protected SVNLocationEntry getCopySource(File path, SVNURL url, SVNRevision revision) throws SVNException { long[] pegRev = { SVNRepository.INVALID_REVISION }; SVNRepository repos = createRepository(url, path, null, revision, revision, pegRev); SVNLocationEntry copyFromEntry = null; String targetPath = getPathRelativeToRoot(path, url, null, null, repos); CopyFromReceiver receiver = new CopyFromReceiver(targetPath); try { repos.log(new String[] { "" }, pegRev[0], 1, true, true, 0, false, new String[0], receiver); copyFromEntry = receiver.getCopyFromLocation(); } catch (SVNException e) { SVNErrorCode errCode = e.getErrorMessage().getErrorCode(); if (errCode == SVNErrorCode.FS_NOT_FOUND || errCode == SVNErrorCode.RA_DAV_REQUEST_FAILED) { return new SVNLocationEntry(SVNRepository.INVALID_REVISION, null); } throw e; } return copyFromEntry == null ? new SVNLocationEntry(SVNRepository.INVALID_REVISION, null) : copyFromEntry; }
protected SVNLocationEntry getCopySource(File path, SVNURL url, SVNRevision revision) throws SVNException { long[] pegRev = { SVNRepository.INVALID_REVISION }; SVNRepository repos = createRepository(url, path, null, revision, revision, pegRev); SVNLocationEntry copyFromEntry = null; String targetPath = getPathRelativeToRoot(path, url, null, null, repos); CopyFromReceiver receiver = new CopyFromReceiver(targetPath); try { repos.log(new String[] { "" }, pegRev[0], 1, true, true, 0, false, new String[0], receiver); copyFromEntry = receiver.getCopyFromLocation(); } catch (SVNException e) { SVNErrorCode errCode = e.getErrorMessage().getErrorCode(); if (errCode == SVNErrorCode.FS_NOT_FOUND || errCode == SVNErrorCode.RA_DAV_REQUEST_FAILED) { return new SVNLocationEntry(SVNRepository.INVALID_REVISION, null); } throw e; } return copyFromEntry == null ? new SVNLocationEntry(SVNRepository.INVALID_REVISION, null) : copyFromEntry; }
protected SVNLocationEntry getCopySource(File path, SVNURL url, SVNRevision revision) throws SVNException { long[] pegRev = { SVNRepository.INVALID_REVISION }; SVNRepository repos = createRepository(url, path, null, revision, revision, pegRev); SVNLocationEntry copyFromEntry = null; String targetPath = getPathRelativeToRoot(path, url, null, null, repos); CopyFromReceiver receiver = new CopyFromReceiver(targetPath); try { repos.log(new String[] { "" }, pegRev[0], 1, true, true, 0, false, new String[0], receiver); copyFromEntry = receiver.getCopyFromLocation(); } catch (SVNException e) { SVNErrorCode errCode = e.getErrorMessage().getErrorCode(); if (errCode == SVNErrorCode.FS_NOT_FOUND || errCode == SVNErrorCode.RA_DAV_REQUEST_FAILED) { return new SVNLocationEntry(SVNRepository.INVALID_REVISION, null); } throw e; } return copyFromEntry == null ? new SVNLocationEntry(SVNRepository.INVALID_REVISION, null) : copyFromEntry; }
SVNURL sourceReposRoot = null; try { repository = createRepository(url, null, null, true); sourceReposRoot = repository.getRepositoryRoot(true); mergeSources = normalizeMergeSources(srcPath, url, sourceReposRoot, pegRevision, rangesToMerge,
SVNURL sourceReposRoot = null; try { repository = createRepository(url, null, null, true); sourceReposRoot = repository.getRepositoryRoot(true); mergeSources = normalizeMergeSources(srcPath, url, sourceReposRoot, pegRevision, rangesToMerge,
SVNURL sourceReposRoot = null; try { repository = createRepository(url, null, null, true); sourceReposRoot = repository.getRepositoryRoot(true); mergeSources = normalizeMergeSources(srcPath, url, sourceReposRoot, pegRevision, rangesToMerge,
public Map calculateImplicitMergeInfo(SVNRepository repos, SVNURL url, long[] targetRev, long start, long end) throws SVNException { Map implicitMergeInfo = null; boolean closeSession = false; SVNURL sessionURL = null; try { if (repos != null) { sessionURL = ensureSessionURL(repos, url); } else { repos = createRepository(url, null, null, false); closeSession = true; } if (targetRev[0] < start) { getLocations(url, null, repos, SVNRevision.create(targetRev[0]), SVNRevision.create(start), SVNRevision.UNDEFINED); targetRev[0] = start; } implicitMergeInfo = getHistoryAsMergeInfo(url, null, SVNRevision.create(targetRev[0]), start, end, repos, null); if (sessionURL != null) { repos.setLocation(sessionURL, false); } } finally { if (closeSession) { repos.closeSession(); } } return implicitMergeInfo; }
public Map calculateImplicitMergeInfo(SVNRepository repos, SVNURL url, long[] targetRev, long start, long end) throws SVNException { Map implicitMergeInfo = null; boolean closeSession = false; SVNURL sessionURL = null; try { if (repos != null) { sessionURL = ensureSessionURL(repos, url); } else { repos = createRepository(url, null, null, false); closeSession = true; } if (targetRev[0] < start) { getLocations(url, null, repos, SVNRevision.create(targetRev[0]), SVNRevision.create(start), SVNRevision.UNDEFINED); targetRev[0] = start; } implicitMergeInfo = getHistoryAsMergeInfo(url, null, SVNRevision.create(targetRev[0]), start, end, repos, null); if (sessionURL != null) { repos.setLocation(sessionURL, false); } } finally { if (closeSession) { repos.closeSession(); } } return implicitMergeInfo; }