public static SVNErrorMessage errorNotFound(FSRoot root, String path) { SVNErrorMessage err; if (root instanceof FSTransactionRoot) { FSTransactionRoot txnRoot = (FSTransactionRoot) root; err = SVNErrorMessage.create(SVNErrorCode.FS_NOT_FOUND, "File not found: transaction ''{0}'', path ''{1}''", new Object[] { txnRoot.getTxnID(), path }); } else { FSRevisionRoot revRoot = (FSRevisionRoot) root; err = SVNErrorMessage.create(SVNErrorCode.FS_NOT_FOUND, "File not found: revision {0}, path ''{1}''", new Object[] { new Long(revRoot.getRevision()), path }); } return err; }
public static SVNErrorMessage errorNotFound(FSRoot root, String path) { SVNErrorMessage err; if (root instanceof FSTransactionRoot) { FSTransactionRoot txnRoot = (FSTransactionRoot) root; err = SVNErrorMessage.create(SVNErrorCode.FS_NOT_FOUND, "File not found: transaction ''{0}'', path ''{1}''", new Object[] { txnRoot.getTxnID(), path }); } else { FSRevisionRoot revRoot = (FSRevisionRoot) root; err = SVNErrorMessage.create(SVNErrorCode.FS_NOT_FOUND, "File not found: revision {0}, path ''{1}''", new Object[] { new Long(revRoot.getRevision()), path }); } return err; }
private String getNewTxnNodeId() throws SVNException { String[] curIds = myTxnRoot.readNextIDs(); String curNodeId = curIds[0]; String curCopyId = curIds[1]; String nextNodeId = FSTransactionRoot.generateNextKey(curNodeId); myFSFS.writeNextIDs(myTxnRoot.getTxnID(), nextNodeId, curCopyId); return "_" + nextNodeId; }
public String getNewTxnNodeId() throws SVNException { String[] curIds = readNextIDs(); String curNodeId = curIds[0]; String curCopyId = curIds[1]; String nextNodeId = FSRepositoryUtil.generateNextKey(curNodeId); getOwner().writeNextIDs(getTxnID(), nextNodeId, curCopyId); return "_" + curNodeId; }
public String getNewTxnNodeId() throws SVNException { String[] curIds = readNextIDs(); String curNodeId = curIds[0]; String curCopyId = curIds[1]; String nextNodeId = FSRepositoryUtil.generateNextKey(curNodeId); getOwner().writeNextIDs(getTxnID(), nextNodeId, curCopyId); return "_" + curNodeId; }
public String getNewTxnNodeId() throws SVNException { String[] curIds = readNextIDs(); String curNodeId = curIds[0]; String curCopyId = curIds[1]; String nextNodeId = FSRepositoryUtil.generateNextKey(curNodeId); getOwner().writeNextIDs(getTxnID(), nextNodeId, curCopyId); return "_" + curNodeId; }
public void storeL2PIndexEntry(long offset, long itemIndex) throws SVNException { final FSFS fsfs = getOwner(); final String txnID = getTxnID(); if (fsfs.isUseLogAddressing()) { final FSL2PProtoIndex protoIndex = FSL2PProtoIndex.open(fsfs, txnID, true); assert protoIndex != null; try { protoIndex.addEntry(offset, itemIndex); } finally { if (protoIndex != null) { protoIndex.close(); } } } }
protected SVNProperties getProperties() throws SVNException { FSRoot root = getFSRoot(); if (root instanceof FSTransactionRoot) { return root.getOwner().getTransactionProperties(((FSTransactionRoot) root).getTxnID()); } return root.getOwner().getRevisionProperties(root.getRevision()); }
protected SVNProperties getProperties() throws SVNException { FSRoot root = getFSRoot(); if (root instanceof FSTransactionRoot) { return root.getOwner().getTransactionProperties(((FSTransactionRoot) root).getTxnID()); } return root.getOwner().getRevisionProperties(root.getRevision()); }
public void storeP2LIndexEntry(FSP2LEntry entry) throws SVNException { final FSFS fsfs = getOwner(); final String txnID = getTxnID(); if (getOwner().isUseLogAddressing()) { final FSP2LProtoIndex protoIndex = FSP2LProtoIndex.open(fsfs, txnID, true); assert protoIndex != null; try { protoIndex.writeEntry(entry); } finally { if (protoIndex != null) { protoIndex.close(); } } } }
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())); } }
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); }
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 makeDir(String path) throws SVNException { SVNPathUtil.checkPathIsValid(path); String txnId = myTxnRoot.getTxnID(); FSParentPath parentPath = myTxnRoot.openPath(path, false, true); if (parentPath.getRevNode() != null) { SVNErrorManager.error(FSErrors.errorAlreadyExists(myTxnRoot, path, myFSFS)); } if ((myTxnRoot.getTxnFlags() & FSTransactionRoot.SVN_FS_TXN_CHECK_LOCKS) != 0) { FSCommitter.allowLockedOperation(myFSFS, path, myAuthor, myLockTokens, true, false); } makePathMutable(parentPath.getParent(), path); FSRevisionNode subDirNode = makeEntry(parentPath.getParent().getRevNode(), parentPath.getParent().getAbsPath(), parentPath.getNameEntry(), true, txnId); myTxnRoot.putRevNodeToCache(parentPath.getAbsPath(), subDirNode); addChange(path, subDirNode.getId(), FSPathChangeKind.FS_PATH_CHANGE_ADD, false, false, FSRepository.SVN_INVALID_REVNUM, null); }
public void makeDir(String path) throws SVNException { SVNPathUtil.checkPathIsValid(path); String txnId = myTxnRoot.getTxnID(); FSParentPath parentPath = myTxnRoot.openPath(path, false, true); if (parentPath.getRevNode() != null) { SVNErrorManager.error(FSErrors.errorAlreadyExists(myTxnRoot, path, myFSFS), SVNLogType.FSFS); } if ((myTxnRoot.getTxnFlags() & FSTransactionRoot.SVN_FS_TXN_CHECK_LOCKS) != 0) { FSCommitter.allowLockedOperation(myFSFS, path, myAuthor, myLockTokens, true, false); } makePathMutable(parentPath.getParent(), path); FSRevisionNode subDirNode = makeEntry(parentPath.getParent().getRevNode(), parentPath.getParent().getAbsPath(), parentPath.getEntryName(), true, txnId); myTxnRoot.putRevNodeToCache(parentPath.getAbsPath(), subDirNode); addChange(path, subDirNode.getId(), FSPathChangeKind.FS_PATH_CHANGE_ADD, false, false, SVNRepository.INVALID_REVISION, null, SVNNodeKind.DIR); }
public void makeFile(String path) throws SVNException { SVNPathUtil.checkPathIsValid(path); String txnId = myTxnRoot.getTxnID(); FSParentPath parentPath = myTxnRoot.openPath(path, false, true); if (parentPath.getRevNode() != null) { SVNErrorManager.error(FSErrors.errorAlreadyExists(myTxnRoot, path, myFSFS), SVNLogType.FSFS); } if ((myTxnRoot.getTxnFlags() & FSTransactionRoot.SVN_FS_TXN_CHECK_LOCKS) != 0) { FSCommitter.allowLockedOperation(myFSFS, path, myAuthor, myLockTokens, false, false); } makePathMutable(parentPath.getParent(), path); FSRevisionNode childNode = makeEntry(parentPath.getParent().getRevNode(), parentPath.getParent().getAbsPath(), parentPath.getEntryName(), false, txnId); myTxnRoot.putRevNodeToCache(parentPath.getAbsPath(), childNode); addChange(path, childNode.getId(), FSPathChangeKind.FS_PATH_CHANGE_ADD, false, false, SVNRepository.INVALID_REVISION, null, SVNNodeKind.FILE); }
public void makeDir(String path) throws SVNException { SVNPathUtil.checkPathIsValid(path); String txnId = myTxnRoot.getTxnID(); FSParentPath parentPath = myTxnRoot.openPath(path, false, true); if (parentPath.getRevNode() != null) { SVNErrorManager.error(FSErrors.errorAlreadyExists(myTxnRoot, path, myFSFS), SVNLogType.FSFS); } if ((myTxnRoot.getTxnFlags() & FSTransactionRoot.SVN_FS_TXN_CHECK_LOCKS) != 0) { FSCommitter.allowLockedOperation(myFSFS, path, myAuthor, myLockTokens, true, false); } makePathMutable(parentPath.getParent(), path); FSRevisionNode subDirNode = makeEntry(parentPath.getParent().getRevNode(), parentPath.getParent().getAbsPath(), parentPath.getEntryName(), true, txnId); myTxnRoot.putRevNodeToCache(parentPath.getAbsPath(), subDirNode); addChange(path, subDirNode.getId(), FSPathChangeKind.FS_PATH_CHANGE_ADD, false, false, SVNRepository.INVALID_REVISION, null, SVNNodeKind.DIR); }
public void makeFile(String path) throws SVNException { SVNPathUtil.checkPathIsValid(path); String txnId = myTxnRoot.getTxnID(); FSParentPath parentPath = myTxnRoot.openPath(path, false, true); if (parentPath.getRevNode() != null) { SVNErrorManager.error(FSErrors.errorAlreadyExists(myTxnRoot, path, myFSFS), SVNLogType.FSFS); } if ((myTxnRoot.getTxnFlags() & FSTransactionRoot.SVN_FS_TXN_CHECK_LOCKS) != 0) { FSCommitter.allowLockedOperation(myFSFS, path, myAuthor, myLockTokens, false, false); } makePathMutable(parentPath.getParent(), path); FSRevisionNode childNode = makeEntry(parentPath.getParent().getRevNode(), parentPath.getParent().getAbsPath(), parentPath.getEntryName(), false, txnId); myTxnRoot.putRevNodeToCache(parentPath.getAbsPath(), childNode); addChange(path, childNode.getId(), FSPathChangeKind.FS_PATH_CHANGE_ADD, false, false, SVNRepository.INVALID_REVISION, null, SVNNodeKind.FILE); }
public void makeFile(String path) throws SVNException { SVNPathUtil.checkPathIsValid(path); String txnId = myTxnRoot.getTxnID(); FSParentPath parentPath = myTxnRoot.openPath(path, false, true); if (parentPath.getRevNode() != null) { SVNErrorManager.error(FSErrors.errorAlreadyExists(myTxnRoot, path, myFSFS)); } if ((myTxnRoot.getTxnFlags() & FSTransactionRoot.SVN_FS_TXN_CHECK_LOCKS) != 0) { FSCommitter.allowLockedOperation(myFSFS, path, myAuthor, myLockTokens, false, false); } makePathMutable(parentPath.getParent(), path); FSRevisionNode childNode = makeEntry(parentPath.getParent().getRevNode(), parentPath.getParent().getAbsPath(), parentPath.getNameEntry(), false, txnId); myTxnRoot.putRevNodeToCache(parentPath.getAbsPath(), childNode); addChange(path, childNode.getId(), FSPathChangeKind.FS_PATH_CHANGE_ADD, false, false, FSRepository.SVN_INVALID_REVNUM, null); }
public void makeDir(String path) throws SVNException { SVNPathUtil.checkPathIsValid(path); FSTransactionRoot txnRoot = getTxnRoot(); String txnId = txnRoot.getTxnID(); FSParentPath parentPath = txnRoot.openPath(path, false, true); if (parentPath.getRevNode() != null) { SVNErrorManager.error(FSErrors.errorAlreadyExists(txnRoot, path, myFSFS), SVNLogType.FSFS); } if ((txnRoot.getTxnFlags() & FSTransactionRoot.SVN_FS_TXN_CHECK_LOCKS) != 0) { allowLockedOperation(myFSFS, path, myAuthor, myLockTokens, true, false); } makePathMutable(parentPath.getParent(), path); FSRevisionNode subDirNode = makeEntry(parentPath.getParent().getRevNode(), parentPath.getParent().getAbsPath(), parentPath.getEntryName(), true, txnId); txnRoot.putRevNodeToCache(parentPath.getAbsPath(), subDirNode); addChange(path, subDirNode.getId(), FSPathChangeKind.FS_PATH_CHANGE_ADD, false, false, false, SVNRepository.INVALID_REVISION, null, SVNNodeKind.DIR); }