protected int getFileRevisionsImpl(String path, long startRevision, long endRevision, boolean includeMergedRevisions, ISVNFileRevisionHandler handler) throws SVNException { try { openRepository(); path = getRepositoryPath(path); long latestRevision = INVALID_REVISION; if (isInvalidRevision(startRevision)) { latestRevision = myFSFS.getYoungestRevision(); startRevision = latestRevision; } if (isInvalidRevision(endRevision)) { if (isInvalidRevision(latestRevision)) { latestRevision = myFSFS.getYoungestRevision(); } endRevision = latestRevision; } FSFileRevisionsFinder finder = new FSFileRevisionsFinder(myFSFS); int fileRevsNumber = finder.getFileRevisions(path, startRevision, endRevision, includeMergedRevisions, handler); return fileRevsNumber; } finally { closeRepository(); } }
protected int getFileRevisionsImpl(String path, long startRevision, long endRevision, boolean includeMergedRevisions, ISVNFileRevisionHandler handler) throws SVNException { try { openRepository(); path = getRepositoryPath(path); long latestRevision = INVALID_REVISION; if (isInvalidRevision(startRevision)) { latestRevision = myFSFS.getYoungestRevision(); startRevision = latestRevision; } if (isInvalidRevision(endRevision)) { if (isInvalidRevision(latestRevision)) { latestRevision = myFSFS.getYoungestRevision(); } endRevision = latestRevision; } FSFileRevisionsFinder finder = new FSFileRevisionsFinder(myFSFS); int fileRevsNumber = finder.getFileRevisions(path, startRevision, endRevision, includeMergedRevisions, handler); return fileRevsNumber; } finally { closeRepository(); } }
protected int getFileRevisionsImpl(String path, long startRevision, long endRevision, boolean includeMergedRevisions, ISVNFileRevisionHandler handler) throws SVNException { try { openRepository(); path = getRepositoryPath(path); long latestRevision = INVALID_REVISION; if (isInvalidRevision(startRevision)) { latestRevision = myFSFS.getYoungestRevision(); startRevision = latestRevision; } if (isInvalidRevision(endRevision)) { if (isInvalidRevision(latestRevision)) { latestRevision = myFSFS.getYoungestRevision(); } endRevision = latestRevision; } FSFileRevisionsFinder finder = new FSFileRevisionsFinder(myFSFS); int fileRevsNumber = finder.getFileRevisions(path, startRevision, endRevision, includeMergedRevisions, handler); return fileRevsNumber; } finally { closeRepository(); } }
private void ensureRevisionsExists(long revision) throws SVNException { if (FSRepository.isInvalidRevision(revision)) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NO_SUCH_REVISION, "Invalid revision number ''{0}''", new Long(revision)); SVNErrorManager.error(err, SVNLogType.FSFS); } if (revision <= myYoungestRevisionCache) { return; } getYoungestRevision(); if (revision <= myYoungestRevisionCache) { return; } SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NO_SUCH_REVISION, "No such revision {0}", new Long(revision)); SVNErrorManager.error(err, SVNLogType.FSFS); }
private void ensureRevisionsExists(long revision) throws SVNException { if (FSRepository.isInvalidRevision(revision)) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NO_SUCH_REVISION, "Invalid revision number ''{0}''", new Long(revision)); SVNErrorManager.error(err, SVNLogType.FSFS); } if (revision <= myYoungestRevisionCache) { return; } getYoungestRevision(); if (revision <= myYoungestRevisionCache) { return; } SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NO_SUCH_REVISION, "No such revision {0}", String.valueOf(revision)); SVNErrorManager.error(err, SVNLogType.FSFS); }
private void ensureRevisionsExists(long revision) throws SVNException { if (FSRepository.isInvalidRevision(revision)) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NO_SUCH_REVISION, "Invalid revision number ''{0}''", new Long(revision)); SVNErrorManager.error(err, SVNLogType.FSFS); } if (revision <= myYoungestRevisionCache) { return; } getYoungestRevision(); if (revision <= myYoungestRevisionCache) { return; } SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NO_SUCH_REVISION, "No such revision {0}", new Long(revision)); SVNErrorManager.error(err, SVNLogType.FSFS); }
public void lock(Map pathsToRevisions, String comment, boolean force, ISVNLockHandler handler) throws SVNException { try { openRepository(); for (Iterator paths = pathsToRevisions.keySet().iterator(); paths.hasNext();) { String path = (String) paths.next(); Long revision = (Long) pathsToRevisions.get(path); String reposPath = getRepositoryPath(path); long curRevision = (revision == null || isInvalidRevision(revision.longValue())) ? myFSFS.getYoungestRevision() : revision.longValue(); SVNLock lock = null; SVNErrorMessage error = null; try { lock = myFSFS.lockPath(reposPath, null, getUserName(), comment, null, curRevision, force); } catch (SVNException svne) { error = svne.getErrorMessage(); if (!FSErrors.isLockError(error)) { throw svne; } } if (handler != null) { handler.handleLock(reposPath, lock, error); } } } finally { closeRepository(); } }
public void lock(Map pathsToRevisions, String comment, boolean force, boolean isDAVComment, ISVNLockHandler handler) throws SVNException { try { openRepository(); for (Iterator paths = pathsToRevisions.keySet().iterator(); paths.hasNext();) { String path = (String) paths.next(); Long revision = (Long) pathsToRevisions.get(path); String reposPath = getRepositoryPath(path); long curRevision = (revision == null || isInvalidRevision(revision.longValue())) ? myFSFS.getYoungestRevision() : revision.longValue(); SVNLock lock = null; SVNErrorMessage error = null; try { lock = myFSFS.lockPath(reposPath, null, getUserName(), comment, null, curRevision, force, isDAVComment); } catch (SVNException svne) { error = svne.getErrorMessage(); if (!FSErrors.isLockError(error)) { throw svne; } } if (handler != null) { handler.handleLock(reposPath, lock, error); } } } finally { closeRepository(); } }
public void addDir(String path, String copyFromPath, long copyFromRevision) throws SVNException { DirBaton parentBaton = (DirBaton) myDirsStack.peek(); String fullPath = SVNPathUtil.getAbsolutePath(SVNPathUtil.append(myBasePath, path)); boolean isCopied = false; if (copyFromPath != null && FSRepository.isInvalidRevision(copyFromRevision)) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_GENERAL, "Got source path but no source revision for ''{0}''", fullPath); SVNErrorManager.error(err, SVNLogType.FSFS); } else if (copyFromPath != null) { SVNNodeKind kind = myTxnRoot.checkNodeKind(fullPath); if (kind != SVNNodeKind.NONE && !parentBaton.isCopied()) { SVNErrorManager.error(FSErrors.errorOutOfDate(fullPath, kind), SVNLogType.FSFS); } copyFromPath = myRepository.getRepositoryPath(copyFromPath); FSRevisionRoot copyRoot = myFSFS.createRevisionRoot(copyFromRevision); myCommitter.makeCopy(copyRoot, copyFromPath, fullPath, true); isCopied = true; } else { myCommitter.makeDir(fullPath); } DirBaton dirBaton = new DirBaton(SVNRepository.INVALID_REVISION, fullPath, isCopied); myDirsStack.push(dirBaton); }
public void addDir(String path, String copyFromPath, long copyFromRevision) throws SVNException { DirBaton parentBaton = (DirBaton) myDirsStack.peek(); String fullPath = SVNPathUtil.getAbsolutePath(SVNPathUtil.append(myBasePath, path)); boolean isCopied = false; if (copyFromPath != null && FSRepository.isInvalidRevision(copyFromRevision)) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_GENERAL, "Got source path but no source revision for ''{0}''", fullPath); SVNErrorManager.error(err, SVNLogType.FSFS); } else if (copyFromPath != null) { SVNNodeKind kind = myTxnRoot.checkNodeKind(fullPath); if (kind != SVNNodeKind.NONE && !parentBaton.isCopied()) { SVNErrorManager.error(FSErrors.errorOutOfDate(fullPath, kind), SVNLogType.FSFS); } copyFromPath = myRepository.getRepositoryPath(copyFromPath); FSRevisionRoot copyRoot = myFSFS.createRevisionRoot(copyFromRevision); myCommitter.makeCopy(copyRoot, copyFromPath, fullPath, true); isCopied = true; } else { myCommitter.makeDir(fullPath); } DirBaton dirBaton = new DirBaton(SVNRepository.INVALID_REVISION, fullPath, isCopied); myDirsStack.push(dirBaton); }
public void addDir(String path, String copyFromPath, long copyFromRevision) throws SVNException { DirBaton parentBaton = (DirBaton) myDirsStack.peek(); String fullPath = SVNPathUtil.concatToAbs(myBasePath, path); boolean isCopied = false; if (copyFromPath != null && FSRepository.isInvalidRevision(copyFromRevision)) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_GENERAL, "Got source path but no source revision for ''{0}''", fullPath); SVNErrorManager.error(err); } else if (copyFromPath != null) { SVNNodeKind kind = myTxnRoot.checkNodeKind(fullPath); if (kind != SVNNodeKind.NONE && !parentBaton.isCopied()) { SVNErrorManager.error(FSErrors.errorOutOfDate(fullPath, myTxnRoot.getTxnID())); } copyFromPath = myRepository.getRepositoryPath(copyFromPath); FSRevisionRoot copyRoot = myFSFS.createRevisionRoot(copyFromRevision); myCommitter.makeCopy(copyRoot, copyFromPath, fullPath, true); isCopied = true; } else { myCommitter.makeDir(fullPath); } DirBaton dirBaton = new DirBaton(FSRepository.SVN_INVALID_REVNUM, fullPath, isCopied); myDirsStack.push(dirBaton); }
public void addDir(String path, String copyFromPath, long copyFromRevision) throws SVNException { DirBaton parentBaton = (DirBaton) myDirsStack.peek(); String fullPath = SVNPathUtil.getAbsolutePath(SVNPathUtil.append(myBasePath, path)); boolean isCopied = false; if (copyFromPath != null && FSRepository.isInvalidRevision(copyFromRevision)) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_GENERAL, "Got source path but no source revision for ''{0}''", fullPath); SVNErrorManager.error(err, SVNLogType.FSFS); } else if (copyFromPath != null) { SVNNodeKind kind = myTxnRoot.checkNodeKind(fullPath); if (kind != SVNNodeKind.NONE && !parentBaton.isCopied()) { SVNErrorManager.error(FSErrors.errorOutOfDate(fullPath, kind), SVNLogType.FSFS); } copyFromPath = myRepository.getRepositoryPath(copyFromPath); FSRevisionRoot copyRoot = myFSFS.createRevisionRoot(copyFromRevision); myCommitter.makeCopy(copyRoot, copyFromPath, fullPath, true); isCopied = true; } else { myCommitter.makeDir(fullPath); } DirBaton dirBaton = new DirBaton(SVNRepository.INVALID_REVISION, fullPath, isCopied); myDirsStack.push(dirBaton); }
public void addFile(String path, String copyFromPath, long copyFromRevision) throws SVNException { DirBaton parentBaton = (DirBaton) myDirsStack.peek(); String fullPath = SVNPathUtil.concatToAbs(myBasePath, path); if (copyFromPath != null && FSRepository.isInvalidRevision(copyFromRevision)) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_GENERAL, "Got source path but no source revision for ''{0}''", fullPath); SVNErrorManager.error(err); } else if (copyFromPath != null) { SVNNodeKind kind = myTxnRoot.checkNodeKind(fullPath); if (kind != SVNNodeKind.NONE && !parentBaton.isCopied()) { SVNErrorManager.error(FSErrors.errorOutOfDate(fullPath, myTxnRoot.getTxnID())); } copyFromPath = myRepository.getRepositoryPath(copyFromPath); FSRevisionRoot copyRoot = myFSFS.createRevisionRoot(copyFromRevision); myCommitter.makeCopy(copyRoot, copyFromPath, fullPath, true); } else { myCommitter.makeFile(fullPath); } }
public void addFile(String path, String copyFromPath, long copyFromRevision) throws SVNException { DirBaton parentBaton = (DirBaton) myDirsStack.peek(); String fullPath = SVNPathUtil.getAbsolutePath(SVNPathUtil.append(myBasePath, path)); if (copyFromPath != null && FSRepository.isInvalidRevision(copyFromRevision)) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_GENERAL, "Got source path but no source revision for ''{0}''", fullPath); SVNErrorManager.error(err, SVNLogType.FSFS); } else if (copyFromPath != null) { SVNNodeKind kind = myTxnRoot.checkNodeKind(fullPath); if (kind != SVNNodeKind.NONE && !parentBaton.isCopied()) { SVNErrorManager.error(FSErrors.errorOutOfDate(fullPath, kind), SVNLogType.FSFS); } copyFromPath = myRepository.getRepositoryPath(copyFromPath); FSRevisionRoot copyRoot = myFSFS.createRevisionRoot(copyFromRevision); myCommitter.makeCopy(copyRoot, copyFromPath, fullPath, true); } else { myCommitter.makeFile(fullPath); } }
public void addFile(String path, String copyFromPath, long copyFromRevision) throws SVNException { DirBaton parentBaton = (DirBaton) myDirsStack.peek(); String fullPath = SVNPathUtil.getAbsolutePath(SVNPathUtil.append(myBasePath, path)); if (copyFromPath != null && FSRepository.isInvalidRevision(copyFromRevision)) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_GENERAL, "Got source path but no source revision for ''{0}''", fullPath); SVNErrorManager.error(err, SVNLogType.FSFS); } else if (copyFromPath != null) { SVNNodeKind kind = myTxnRoot.checkNodeKind(fullPath); if (kind != SVNNodeKind.NONE && !parentBaton.isCopied()) { SVNErrorManager.error(FSErrors.errorOutOfDate(fullPath, kind), SVNLogType.FSFS); } copyFromPath = myRepository.getRepositoryPath(copyFromPath); FSRevisionRoot copyRoot = myFSFS.createRevisionRoot(copyFromRevision); myCommitter.makeCopy(copyRoot, copyFromPath, fullPath, true); } else { myCommitter.makeFile(fullPath); } }
public void addFile(String path, String copyFromPath, long copyFromRevision) throws SVNException { DirBaton parentBaton = (DirBaton) myDirsStack.peek(); String fullPath = SVNPathUtil.getAbsolutePath(SVNPathUtil.append(myBasePath, path)); if (copyFromPath != null && FSRepository.isInvalidRevision(copyFromRevision)) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_GENERAL, "Got source path but no source revision for ''{0}''", fullPath); SVNErrorManager.error(err, SVNLogType.FSFS); } else if (copyFromPath != null) { SVNNodeKind kind = myTxnRoot.checkNodeKind(fullPath); if (kind != SVNNodeKind.NONE && !parentBaton.isCopied()) { SVNErrorManager.error(FSErrors.errorOutOfDate(fullPath, kind), SVNLogType.FSFS); } copyFromPath = myRepository.getRepositoryPath(copyFromPath); FSRevisionRoot copyRoot = myFSFS.createRevisionRoot(copyFromRevision); myCommitter.makeCopy(copyRoot, copyFromPath, fullPath, true); } else { myCommitter.makeFile(fullPath); } }
public SVNDirEntry info(String path, long revision) throws SVNException { try { openRepository(); path = getRepositoryPath(path); if (FSRepository.isInvalidRevision(revision)) { revision = myFSFS.getYoungestRevision(); } FSRevisionRoot root = myFSFS.createRevisionRoot(revision); if (root.checkNodeKind(path) == SVNNodeKind.NONE) { return null; } FSRevisionNode revNode = root.getRevisionNode(path); String fullPath = getFullPath(path); String parentFullPath = "/".equals(path) ? fullPath : SVNPathUtil.removeTail(fullPath); SVNURL url = getLocation().setPath(parentFullPath, false); String name = "/".equals(path) ? "" : SVNPathUtil.tail(path); FSEntry fsEntry = new FSEntry(revNode.getId(), revNode.getType(), name); SVNDirEntry entry = buildDirEntry(fsEntry, url, revNode, SVNDirEntry.DIRENT_ALL); return entry; } finally { closeRepository(); } }
public SVNDirEntry info(String path, long revision) throws SVNException { try { openRepository(); path = getRepositoryPath(path); if (FSRepository.isInvalidRevision(revision)) { revision = myFSFS.getYoungestRevision(); } FSRevisionRoot root = myFSFS.createRevisionRoot(revision); if (root.checkNodeKind(path) == SVNNodeKind.NONE) { return null; } FSRevisionNode revNode = root.getRevisionNode(path); String fullPath = getFullPath(path); String parentFullPath = "/".equals(path) ? fullPath : SVNPathUtil.removeTail(fullPath); SVNURL url = getLocation().setPath(parentFullPath, false); String name = SVNPathUtil.tail(path); FSEntry fsEntry = new FSEntry(revNode.getId(), revNode.getType(), name); SVNDirEntry entry = buildDirEntry(fsEntry, url, revNode, SVNDirEntry.DIRENT_ALL); return entry; } finally { closeRepository(); } }
public SVNDirEntry info(String path, long revision) throws SVNException { try { openRepository(); path = getRepositoryPath(path); if (FSRepository.isInvalidRevision(revision)) { revision = myFSFS.getYoungestRevision(); } FSRevisionRoot root = myFSFS.createRevisionRoot(revision); if (root.checkNodeKind(path) == SVNNodeKind.NONE) { return null; } FSRevisionNode revNode = root.getRevisionNode(path); String fullPath = getFullPath(path); String parentFullPath = "/".equals(path) ? fullPath : SVNPathUtil.removeTail(fullPath); SVNURL url = getLocation().setPath(parentFullPath, false); String name = SVNPathUtil.tail(path); FSEntry fsEntry = new FSEntry(revNode.getId(), revNode.getType(), name); SVNDirEntry entry = buildDirEntry(fsEntry, url, revNode, false); return entry; } finally { closeRepository(); } }
public SVNDirEntry info(String path, long revision) throws SVNException { try { openRepository(); path = getRepositoryPath(path); if (FSRepository.isInvalidRevision(revision)) { revision = myFSFS.getYoungestRevision(); } FSRevisionRoot root = myFSFS.createRevisionRoot(revision); if (root.checkNodeKind(path) == SVNNodeKind.NONE) { return null; } FSRevisionNode revNode = root.getRevisionNode(path); String fullPath = getFullPath(path); String parentFullPath = "/".equals(path) ? fullPath : SVNPathUtil.removeTail(fullPath); SVNURL url = getLocation().setPath(parentFullPath, false); String name = SVNPathUtil.tail(path); FSEntry fsEntry = new FSEntry(revNode.getId(), revNode.getType(), name); SVNDirEntry entry = buildDirEntry(fsEntry, url, revNode, SVNDirEntry.DIRENT_ALL); return entry; } finally { closeRepository(); } }