public void writePathInfoToReportFile(String path, String linkPath, String lockToken, long revision, boolean startEmpty) throws SVNException { String anchorRelativePath = SVNPathUtil.append(getReportTarget(), path); String linkPathRep = linkPath != null ? "+" + linkPath.length() + ":" + linkPath : "-"; String revisionRep = FSRepository.isValidRevision(revision) ? "+" + revision + ":" : "-"; String lockTokenRep = lockToken != null ? "+" + lockToken.length() + ":" + lockToken : "-"; String startEmptyRep = startEmpty ? "+" : "-"; String fullRepresentation = "+" + anchorRelativePath.length() + ":" + anchorRelativePath + linkPathRep + revisionRep + startEmptyRep + lockTokenRep; try { OutputStream reportOS = getReportFileForWriting(); reportOS.write(fullRepresentation.getBytes("UTF-8")); } catch (IOException ioe) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.IO_ERROR, ioe.getLocalizedMessage()); SVNErrorManager.error(err, ioe); } }
private Map computeMetaProperties(long revision) throws SVNException { Map metaProperties = new SVNHashMap(); if (FSRepository.isValidRevision(revision)) { SVNProperties entryProps = myFSFS.compoundMetaProperties(revision); metaProperties.put(SVNProperty.COMMITTED_REVISION, entryProps.getSVNPropertyValue(SVNProperty.COMMITTED_REVISION)); metaProperties.put(SVNProperty.COMMITTED_DATE, entryProps.getSVNPropertyValue(SVNProperty.COMMITTED_DATE)); metaProperties.put(SVNProperty.LAST_AUTHOR, entryProps.getSVNPropertyValue(SVNProperty.LAST_AUTHOR)); metaProperties.put(SVNProperty.UUID, entryProps.getSVNPropertyValue(SVNProperty.UUID)); } else if (!FSRepository.isValidRevision(revision) && isTransactionTarget()) { FSTransactionRoot txnRoot = (FSTransactionRoot) getTargetRoot(); SVNProperties txnProperties = myFSFS.getTransactionProperties(txnRoot.getTxnID()); metaProperties.put(SVNProperty.COMMITTED_REVISION, SVNPropertyValue.create(Long.toString(getTargetRevision()))); metaProperties.put(SVNProperty.COMMITTED_DATE, txnProperties.getSVNPropertyValue(SVNRevisionProperty.DATE)); metaProperties.put(SVNProperty.LAST_AUTHOR, txnProperties.getSVNPropertyValue(SVNRevisionProperty.AUTHOR)); metaProperties.put(SVNProperty.UUID, SVNPropertyValue.create(myFSFS.getUUID())); } else { metaProperties = null; } return metaProperties; }
public void writePathInfoToReportFile(String path, String linkPath, String lockToken, long revision, boolean startEmpty, SVNDepth depth) throws SVNException { if (depth == null || depth == SVNDepth.UNKNOWN) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.REPOS_BAD_ARGS, "Unsupported report depth ''{0}''", depth != null ? depth.getName() : "null"); SVNErrorManager.error(err, SVNLogType.FSFS); } String anchorRelativePath = SVNPathUtil.append(getReportTarget(), path); String revisionRep = FSRepository.isValidRevision(revision) ? "+" + String.valueOf(revision) + ":" : "-"; String depthRep = "-";//infinity by default if (depth == SVNDepth.EXCLUDE || depth == SVNDepth.EMPTY || depth == SVNDepth.FILES || depth == SVNDepth.IMMEDIATES) { depthRep = "+" + getDepthLetter(depth); } try { ByteArrayOutputStream baos = new ByteArrayOutputStream(); writeSingleString(anchorRelativePath, baos); writeSingleString(linkPath, baos); baos.write(revisionRep.getBytes("UTF-8")); baos.write(depthRep.getBytes("UTF-8")); baos.write(startEmpty ? '+' : '-'); writeSingleString(lockToken, baos); OutputStream reportOS = getReportFileForWriting(); reportOS.write(baos.toByteArray()); } catch (IOException ioe) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.IO_ERROR, ioe.getLocalizedMessage()); SVNErrorManager.error(err, ioe, SVNLogType.FSFS); } }
public void writePathInfoToReportFile(String path, String linkPath, String lockToken, long revision, boolean startEmpty, SVNDepth depth) throws SVNException { if (depth == null || depth == SVNDepth.UNKNOWN) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.REPOS_BAD_ARGS, "Unsupported report depth ''{0}''", depth != null ? depth.getName() : "null"); SVNErrorManager.error(err, SVNLogType.FSFS); } String anchorRelativePath = SVNPathUtil.append(getReportTarget(), path); String revisionRep = FSRepository.isValidRevision(revision) ? "+" + String.valueOf(revision) + ":" : "-"; String depthRep = "-";//infinity by default if (depth == SVNDepth.EXCLUDE || depth == SVNDepth.EMPTY || depth == SVNDepth.FILES || depth == SVNDepth.IMMEDIATES) { depthRep = "+" + getDepthLetter(depth); } try { ByteArrayOutputStream baos = new ByteArrayOutputStream(); writeSingleString(anchorRelativePath, baos); writeSingleString(linkPath, baos); baos.write(revisionRep.getBytes("UTF-8")); baos.write(depthRep.getBytes("UTF-8")); baos.write(startEmpty ? '+' : '-'); writeSingleString(lockToken, baos); OutputStream reportOS = getReportFileForWriting(); reportOS.write(baos.toByteArray()); } catch (IOException ioe) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.IO_ERROR, ioe.getLocalizedMessage()); SVNErrorManager.error(err, ioe, SVNLogType.FSFS); } }
public void writePathInfoToReportFile(String path, String linkPath, String lockToken, long revision, boolean startEmpty, SVNDepth depth) throws SVNException { if (depth == null || depth == SVNDepth.UNKNOWN) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.REPOS_BAD_ARGS, "Unsupported report depth ''{0}''", depth != null ? depth.getName() : "null"); SVNErrorManager.error(err, SVNLogType.FSFS); } String anchorRelativePath = SVNPathUtil.append(getReportTarget(), path); String revisionRep = FSRepository.isValidRevision(revision) ? "+" + String.valueOf(revision) + ":" : "-"; String depthRep = "-";//infinity by default if (depth == SVNDepth.EXCLUDE || depth == SVNDepth.EMPTY || depth == SVNDepth.FILES || depth == SVNDepth.IMMEDIATES) { depthRep = "+" + getDepthLetter(depth); } try { ByteArrayOutputStream baos = new ByteArrayOutputStream(); writeSingleString(anchorRelativePath, baos); writeSingleString(linkPath, baos); baos.write(revisionRep.getBytes("UTF-8")); baos.write(depthRep.getBytes("UTF-8")); baos.write(startEmpty ? '+' : '-'); writeSingleString(lockToken, baos); OutputStream reportOS = getReportFileForWriting(); reportOS.write(baos.toByteArray()); } catch (IOException ioe) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.IO_ERROR, ioe.getLocalizedMessage()); SVNErrorManager.error(err, ioe, SVNLogType.FSFS); } }
public void openFile(String path, long revision) throws SVNException { String fullPath = SVNPathUtil.getAbsolutePath(SVNPathUtil.append(myBasePath, path)); FSRevisionNode revNode = myTxnRoot.getRevisionNode(fullPath); if (FSRepository.isValidRevision(revision) && revision < revNode.getCreatedRevision()) { SVNErrorManager.error(FSErrors.errorOutOfDate(fullPath, SVNNodeKind.FILE), SVNLogType.FSFS); } }
public void openFile(String path, long revision) throws SVNException { String fullPath = SVNPathUtil.getAbsolutePath(SVNPathUtil.append(myBasePath, path)); FSRevisionNode revNode = myTxnRoot.getRevisionNode(fullPath); if (FSRepository.isValidRevision(revision) && revision < revNode.getCreatedRevision()) { SVNErrorManager.error(FSErrors.errorOutOfDate(fullPath, SVNNodeKind.FILE), SVNLogType.FSFS); } }
public void openFile(String path, long revision) throws SVNException { String fullPath = SVNPathUtil.getAbsolutePath(SVNPathUtil.append(myBasePath, path)); FSRevisionNode revNode = myTxnRoot.getRevisionNode(fullPath); if (FSRepository.isValidRevision(revision) && revision < revNode.getCreatedRevision()) { SVNErrorManager.error(FSErrors.errorOutOfDate(fullPath, SVNNodeKind.FILE), SVNLogType.FSFS); } }
public void changeDirProperty(String name, SVNPropertyValue value) throws SVNException { DirBaton dirBaton = (DirBaton) myDirsStack.peek(); if (FSRepository.isValidRevision(dirBaton.getBaseRevision())) { FSRevisionNode existingNode = myTxnRoot.getRevisionNode(dirBaton.getPath()); long createdRev = existingNode.getCreatedRevision(); if (dirBaton.getBaseRevision() < createdRev) { SVNErrorManager.error(FSErrors.errorOutOfDate(dirBaton.getPath(), SVNNodeKind.DIR), SVNLogType.FSFS); } } myCommitter.changeNodeProperty(dirBaton.getPath(), name, value); }
public void changeDirProperty(String name, SVNPropertyValue value) throws SVNException { DirBaton dirBaton = (DirBaton) myDirsStack.peek(); if (FSRepository.isValidRevision(dirBaton.getBaseRevision())) { FSRevisionNode existingNode = myTxnRoot.getRevisionNode(dirBaton.getPath()); long createdRev = existingNode.getCreatedRevision(); if (dirBaton.getBaseRevision() < createdRev) { SVNErrorManager.error(FSErrors.errorOutOfDate(dirBaton.getPath(), SVNNodeKind.DIR), SVNLogType.FSFS); } } myCommitter.changeNodeProperty(dirBaton.getPath(), name, value); }
public void changeDirProperty(String name, SVNPropertyValue value) throws SVNException { DirBaton dirBaton = (DirBaton) myDirsStack.peek(); if (FSRepository.isValidRevision(dirBaton.getBaseRevision())) { FSRevisionNode existingNode = myTxnRoot.getRevisionNode(dirBaton.getPath()); long createdRev = existingNode.getCreatedRevision(); if (dirBaton.getBaseRevision() < createdRev) { SVNErrorManager.error(FSErrors.errorOutOfDate(dirBaton.getPath(), SVNNodeKind.DIR), SVNLogType.FSFS); } } myCommitter.changeNodeProperty(dirBaton.getPath(), name, value); }
public void openFile(String path, long revision) throws SVNException { String fullPath = SVNPathUtil.concatToAbs(myBasePath, path); FSRevisionNode revNode = myTxnRoot.getRevisionNode(fullPath); if (FSRepository.isValidRevision(revision) && revision < revNode.getId().getRevision()) { SVNErrorManager.error(FSErrors.errorOutOfDate(fullPath, myTxnRoot.getTxnID())); } }
protected Map getMergeInfoImpl(String[] paths, long revision, SVNMergeInfoInheritance inherit, boolean includeDescendants) throws SVNException { try { openRepository(); if (!isValidRevision(revision)) { revision = myFSFS.getYoungestRevision(); } FSRevisionRoot root = myFSFS.createRevisionRoot(revision); String[] absPaths = new String[paths.length]; for (int i = 0; i < paths.length; i++) { absPaths[i] = getRepositoryPath(paths[i]); } SVNMergeInfoManager mergeInfoManager = getMergeInfoManager(); return mergeInfoManager.getMergeInfo(absPaths, root, inherit, includeDescendants); } finally { closeRepository(); } }
public void changeDirProperty(String name, String value) throws SVNException { DirBaton dirBaton = (DirBaton) myDirsStack.peek(); if (FSRepository.isValidRevision(dirBaton.getBaseRevision())) { FSRevisionNode existingNode = myTxnRoot.getRevisionNode(dirBaton.getPath()); long createdRev = existingNode.getId().getRevision(); if (dirBaton.getBaseRevision() < createdRev) { SVNErrorManager.error(FSErrors.errorOutOfDate(dirBaton.getPath(), myTxnRoot.getTxnID())); } } changeNodeProperty(dirBaton.getPath(), name, value); }
protected Map getMergeInfoImpl(String[] paths, long revision, SVNMergeInfoInheritance inherit, boolean includeDescendants) throws SVNException { try { openRepository(); if (!isValidRevision(revision)) { revision = myFSFS.getYoungestRevision(); } FSRevisionRoot root = myFSFS.createRevisionRoot(revision); String[] absPaths = new String[paths.length]; for (int i = 0; i < paths.length; i++) { absPaths[i] = getRepositoryPath(paths[i]); } SVNMergeInfoManager mergeInfoManager = getMergeInfoManager(); return mergeInfoManager.getMergeInfo(absPaths, root, inherit, includeDescendants); } finally { closeRepository(); } }
protected Map getMergeInfoImpl(String[] paths, long revision, SVNMergeInfoInheritance inherit, boolean includeDescendants) throws SVNException { try { openRepository(); if (!isValidRevision(revision)) { revision = myFSFS.getYoungestRevision(); } FSRevisionRoot root = myFSFS.createRevisionRoot(revision); String[] absPaths = new String[paths.length]; for (int i = 0; i < paths.length; i++) { absPaths[i] = getRepositoryPath(paths[i]); } SVNMergeInfoManager mergeInfoManager = getMergeInfoManager(); return mergeInfoManager.getMergeInfo(absPaths, root, inherit, includeDescendants); } finally { closeRepository(); } }
public void deleteEntry(String path, long revision) throws SVNException { String fullPath = SVNPathUtil.concatToAbs(myBasePath, path); SVNNodeKind kind = myTxnRoot.checkNodeKind(fullPath); if (kind == SVNNodeKind.NONE) { return; } FSRevisionNode existingNode = myTxnRoot.getRevisionNode(fullPath); long createdRev = existingNode.getId().getRevision(); if (FSRepository.isValidRevision(revision) && revision < createdRev) { SVNErrorManager.error(FSErrors.errorOutOfDate(fullPath, myTxnRoot.getTxnID())); } myCommitter.deleteNode(fullPath); }
public void deleteEntry(String path, long revision) throws SVNException { String fullPath = SVNPathUtil.getAbsolutePath(SVNPathUtil.append(myBasePath, path)); SVNNodeKind kind = myTxnRoot.checkNodeKind(fullPath); if (kind == SVNNodeKind.NONE) { SVNErrorManager.error(FSErrors.errorOutOfDate(fullPath, kind), SVNLogType.FSFS); } FSRevisionNode existingNode = myTxnRoot.getRevisionNode(fullPath); long createdRev = existingNode.getCreatedRevision(); if (FSRepository.isValidRevision(revision) && revision < createdRev) { SVNErrorManager.error(FSErrors.errorOutOfDate(fullPath, kind), SVNLogType.FSFS); } myCommitter.deleteNode(fullPath); }
public void deleteEntry(String path, long revision) throws SVNException { String fullPath = SVNPathUtil.getAbsolutePath(SVNPathUtil.append(myBasePath, path)); SVNNodeKind kind = myTxnRoot.checkNodeKind(fullPath); if (kind == SVNNodeKind.NONE) { SVNErrorManager.error(FSErrors.errorOutOfDate(fullPath, kind), SVNLogType.FSFS); } FSRevisionNode existingNode = myTxnRoot.getRevisionNode(fullPath); long createdRev = existingNode.getCreatedRevision(); if (FSRepository.isValidRevision(revision) && revision < createdRev) { SVNErrorManager.error(FSErrors.errorOutOfDate(fullPath, kind), SVNLogType.FSFS); } myCommitter.deleteNode(fullPath); }
public void deleteEntry(String path, long revision) throws SVNException { String fullPath = SVNPathUtil.getAbsolutePath(SVNPathUtil.append(myBasePath, path)); SVNNodeKind kind = myTxnRoot.checkNodeKind(fullPath); if (kind == SVNNodeKind.NONE) { SVNErrorManager.error(FSErrors.errorOutOfDate(fullPath, kind), SVNLogType.FSFS); } FSRevisionNode existingNode = myTxnRoot.getRevisionNode(fullPath); long createdRev = existingNode.getCreatedRevision(); if (FSRepository.isValidRevision(revision) && revision < createdRev) { SVNErrorManager.error(FSErrors.errorOutOfDate(fullPath, kind), SVNLogType.FSFS); } myCommitter.deleteNode(fullPath); }