private void loadOffsets(FSFile file) throws SVNException { if (myRootOffset >= 0) { return; } long[] rootOffset = { -1 }; long[] changesOffset = { -1 }; FSRepositoryUtil.loadRootChangesOffset(getOwner(), getRevision(), file, rootOffset, changesOffset); myRootOffset = rootOffset[0]; myChangesOffset = changesOffset[0]; }
public Map getMergeInfo(String[] paths, FSRevisionRoot root, SVNMergeInfoInheritance inherit, boolean includeDescendants) throws SVNException { if (!root.getOwner().supportsMergeInfo()) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.UNSUPPORTED_FEATURE, "Querying mergeinfo requires version {0} of the FSFS filesystem schema;" + " filesystem ''{1}'' uses only version {2}", new Object[] { new Integer(FSFS.MIN_MERGE_INFO_FORMAT), root.getOwner().getDBRoot(), new Integer(root.getOwner().getDBFormat()) }); SVNErrorManager.error(err, SVNLogType.FSFS); } Map mergeInfoAsHashes = getMergeInfoForPaths(root, paths, inherit, includeDescendants); Map mergeInfo = new TreeMap(); for (Iterator mergeInfoIter = mergeInfoAsHashes.keySet().iterator(); mergeInfoIter.hasNext();) { String path = (String) mergeInfoIter.next(); Map pathMergeInfo = (Map) mergeInfoAsHashes.get(path); mergeInfo.put(path, new SVNMergeInfo(path, pathMergeInfo)); } return mergeInfo; }
private void loadOffsets(FSFile file) throws SVNException { if (myRootOffset >= 0) { return; } long[] rootOffset = { -1 }; long[] changesOffset = { -1 }; FSRepositoryUtil.loadRootChangesOffset(getOwner(), getRevision(), file, rootOffset, changesOffset); myRootOffset = rootOffset[0]; myChangesOffset = changesOffset[0]; }
public Map getMergeInfo(String[] paths, FSRevisionRoot root, SVNMergeInfoInheritance inherit, boolean includeDescendants) throws SVNException { if (!root.getOwner().supportsMergeInfo()) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.UNSUPPORTED_FEATURE, "Querying mergeinfo requires version {0} of the FSFS filesystem schema;" + " filesystem ''{1}'' uses only version {2}", new Object[] { new Integer(FSFS.MIN_MERGE_INFO_FORMAT), root.getOwner().getDBRoot(), new Integer(root.getOwner().getDBFormat()) }); SVNErrorManager.error(err, SVNLogType.FSFS); } Map mergeInfoAsHashes = getMergeInfoForPaths(root, paths, inherit, includeDescendants); Map mergeInfo = new TreeMap(); for (Iterator mergeInfoIter = mergeInfoAsHashes.keySet().iterator(); mergeInfoIter.hasNext();) { String path = (String) mergeInfoIter.next(); Map pathMergeInfo = (Map) mergeInfoAsHashes.get(path); mergeInfo.put(path, new SVNMergeInfo(path, pathMergeInfo)); } return mergeInfo; }
public Map getMergeInfo(String[] paths, FSRevisionRoot root, SVNMergeInfoInheritance inherit, boolean includeDescendants) throws SVNException { if (!root.getOwner().supportsMergeInfo()) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.UNSUPPORTED_FEATURE, "Querying mergeinfo requires version {0} of the FSFS filesystem schema;" + " filesystem ''{1}'' uses only version {2}", new Object[] { new Integer(FSFS.MIN_MERGE_INFO_FORMAT), root.getOwner().getDBRoot(), new Integer(root.getOwner().getDBFormat()) }); SVNErrorManager.error(err, SVNLogType.FSFS); } Map mergeInfoAsHashes = getMergeInfoForPaths(root, paths, inherit, includeDescendants); Map mergeInfo = new TreeMap(); for (Iterator mergeInfoIter = mergeInfoAsHashes.keySet().iterator(); mergeInfoIter.hasNext();) { String path = (String) mergeInfoIter.next(); Map pathMergeInfo = (Map) mergeInfoAsHashes.get(path); mergeInfo.put(path, new SVNMergeInfo(path, pathMergeInfo)); } return mergeInfo; }
private void loadOffsets(FSFile file, long itemIndex) throws SVNException { if (myRootOffset >= 0 && itemIndex == FSID.ITEM_INDEX_ROOT_NODE) { return; } if (myChangesOffset >= 0 && itemIndex == FSID.ITEM_INDEX_CHANGES) { return; } long[] rootOffset = { -1 }; long[] changesOffset = { -1 }; if (isUseLogAddressing()) { FSRepositoryUtil.loadRootChangesOffsetLogicalAddressing(getOwner(), getRevision(), file, itemIndex, rootOffset, changesOffset); if (itemIndex == FSID.ITEM_INDEX_ROOT_NODE) { myRootOffset = rootOffset[0]; } if (itemIndex == FSID.ITEM_INDEX_CHANGES) { myChangesOffset = changesOffset[0]; } } else { FSRepositoryUtil.loadRootChangesOffset(getOwner(), getRevision(), file, rootOffset, changesOffset); myRootOffset = rootOffset[0]; myChangesOffset = changesOffset[0]; } }
public Map getChangedPaths() throws SVNException { FSFile file = getOwner().getPackOrRevisionFSFile(getRevision()); try { loadOffsets(file, FSID.ITEM_INDEX_CHANGES); file.seek(myChangesOffset); return fetchAllChanges(file, true); } finally { file.close(); } }
public Map getChangedPaths() throws SVNException { FSFile file = getOwner().getPackOrRevisionFSFile(getRevision()); try { loadOffsets(file); file.seek(myChangesOffset); return fetchAllChanges(file, true); } finally { file.close(); } }
public Map getChangedPaths() throws SVNException { FSFile file = getOwner().getRevisionFile(getRevision()); loadOffsets(file); try { file.seek(myChangesOffset); return fetchAllChanges(file, true); } finally { file.close(); } }
public Map getChangedPaths() throws SVNException { FSFile file = getOwner().getPackOrRevisionFSFile(getRevision()); try { loadOffsets(file); file.seek(myChangesOffset); return fetchAllChanges(file, true); } finally { file.close(); } }
public FSRevisionNode getRootRevisionNode() throws SVNException { if (myRootRevisionNode == null) { FSFile file = getOwner().getRevisionFile(getRevision()); try { loadOffsets(file); file.seek(myRootOffset); Map headers = file.readHeader(); myRootRevisionNode = FSRevisionNode.fromMap(headers); } finally { file.close(); } } return myRootRevisionNode; }
public FSRevisionNode getRootRevisionNode() throws SVNException { if (myRootRevisionNode == null) { FSFile file = getOwner().getPackOrRevisionFSFile(getRevision()); try { loadOffsets(file); file.seek(myRootOffset); Map headers = file.readHeader(); myRootRevisionNode = FSRevisionNode.fromMap(headers); } finally { file.close(); } } return myRootRevisionNode; }
public FSRevisionNode getRootRevisionNode() throws SVNException { if (myRootRevisionNode == null) { FSFile file = getOwner().getPackOrRevisionFSFile(getRevision()); try { loadOffsets(file); file.seek(myRootOffset); Map headers = file.readHeader(); myRootRevisionNode = FSRevisionNode.fromMap(headers); } finally { file.close(); } } return myRootRevisionNode; }
public FSNodeHistory getNodeHistory(String path) throws SVNException { SVNNodeKind kind = checkNodeKind(path); if (kind == SVNNodeKind.NONE) { SVNErrorManager.error(FSErrors.errorNotFound(this, path), SVNLogType.FSFS); } return new FSNodeHistory(new SVNLocationEntry(getRevision(), SVNPathUtil.canonicalizeAbsolutePath(path)), false, new SVNLocationEntry(SVNRepository.INVALID_REVISION, null), getOwner()); }
public FSNodeHistory getNodeHistory(String path) throws SVNException { SVNNodeKind kind = checkNodeKind(path); if (kind == SVNNodeKind.NONE) { SVNErrorManager.error(FSErrors.errorNotFound(this, path), SVNLogType.FSFS); } return new FSNodeHistory(new SVNLocationEntry(getRevision(), SVNPathUtil.canonicalizeAbsolutePath(path)), false, new SVNLocationEntry(SVNRepository.INVALID_REVISION, null), getOwner()); }
public FSNodeHistory getNodeHistory(String path) throws SVNException { SVNNodeKind kind = checkNodeKind(path); if (kind == SVNNodeKind.NONE) { SVNErrorManager.error(FSErrors.errorNotFound(this, path), SVNLogType.FSFS); } return new FSNodeHistory(new SVNLocationEntry(getRevision(), SVNPathUtil.canonicalizeAbsolutePath(path)), false, new SVNLocationEntry(SVNRepository.INVALID_REVISION, null), getOwner()); }
public FSRevisionNode getRootRevisionNode() throws SVNException { if (myRootRevisionNode == null) { if (false && isUseLogAddressing()) { FSRevisionNode rootRevisionNode = new FSRevisionNode(); rootRevisionNode.setId(FSID.createRevId(null, null, myRevision, FSID.ITEM_INDEX_ROOT_NODE)); rootRevisionNode.setType(SVNNodeKind.DIR); rootRevisionNode.setPredecessorId(null); rootRevisionNode.setCreatedPath("/"); myRootRevisionNode = rootRevisionNode; } else { FSFile file = getOwner().getPackOrRevisionFSFile(getRevision()); try { loadOffsets(file, FSID.ITEM_INDEX_ROOT_NODE); file.seek(myRootOffset); Map headers = file.readHeader(); myRootRevisionNode = FSRevisionNode.fromMap(headers); } finally { file.close(); } } } return myRootRevisionNode; }
public FSClosestCopy getClosestCopy(String path) throws SVNException { FSParentPath parentPath = openPath(path, true, true); SVNLocationEntry copyDstEntry = FSNodeHistory.findYoungestCopyroot(getOwner().getRepositoryRoot(), parentPath); if (copyDstEntry == null || copyDstEntry.getRevision() == 0) { return null; } FSRevisionRoot copyDstRoot = getOwner().createRevisionRoot(copyDstEntry.getRevision()); if (copyDstRoot.checkNodeKind(path) == SVNNodeKind.NONE) { return null; } FSParentPath copyDstParentPath = copyDstRoot.openPath(path, true, true); FSRevisionNode copyDstNode = copyDstParentPath.getRevNode(); if (!copyDstNode.getId().isRelated(parentPath.getRevNode().getId())) { return null; } long createdRev = copyDstNode.getCreatedRevision(); if (createdRev == copyDstEntry.getRevision()) { if (copyDstNode.getPredecessorId() == null) { return null; } } return new FSClosestCopy(copyDstRoot, copyDstEntry.getPath()); }
public FSClosestCopy getClosestCopy(String path) throws SVNException { FSParentPath parentPath = openPath(path, true, true); SVNLocationEntry copyDstEntry = FSNodeHistory.findYoungestCopyroot(getOwner().getRepositoryRoot(), parentPath); if (copyDstEntry == null || copyDstEntry.getRevision() == 0) { return null; } FSRevisionRoot copyDstRoot = getOwner().createRevisionRoot(copyDstEntry.getRevision()); if (copyDstRoot.checkNodeKind(path) == SVNNodeKind.NONE) { return null; } FSParentPath copyDstParentPath = copyDstRoot.openPath(path, true, true); FSRevisionNode copyDstNode = copyDstParentPath.getRevNode(); if (!copyDstNode.getId().isRelated(parentPath.getRevNode().getId())) { return null; } long createdRev = copyDstNode.getCreatedRevision(); if (createdRev == copyDstEntry.getRevision()) { if (copyDstNode.getPredecessorId() == null) { return null; } } return new FSClosestCopy(copyDstRoot, copyDstEntry.getPath()); }
public FSClosestCopy getClosestCopy(String path) throws SVNException { FSParentPath parentPath = openPath(path, true, true); SVNLocationEntry copyDstEntry = FSNodeHistory.findYoungestCopyroot(getOwner().getRepositoryRoot(), parentPath); if (copyDstEntry == null || copyDstEntry.getRevision() == 0) { return null; } FSRevisionRoot copyDstRoot = getOwner().createRevisionRoot(copyDstEntry.getRevision()); if (copyDstRoot.checkNodeKind(path) == SVNNodeKind.NONE) { return null; } FSParentPath copyDstParentPath = copyDstRoot.openPath(path, true, true); FSRevisionNode copyDstNode = copyDstParentPath.getRevNode(); if (!copyDstNode.getId().isRelated(parentPath.getRevNode().getId())) { return null; } long createdRev = copyDstNode.getCreatedRevision(); if (createdRev == copyDstEntry.getRevision()) { if (copyDstNode.getPredecessorId() == null) { return null; } } return new FSClosestCopy(copyDstRoot, copyDstEntry.getPath()); }