public static void mergeChanges(FSFS owner, FSTransactionRoot txnRoot, FSRevisionNode sourceNode, StringBuffer conflictPath) throws SVNException { FSRevisionNode txnRootNode = txnRoot.getRootRevisionNode(); FSRevisionNode ancestorNode = txnRoot.getTxnBaseRootNode(); if (txnRootNode.getId().equals(ancestorNode.getId())) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.UNKNOWN, "FATAL error: no changes in transaction to commit"); SVNErrorManager.error(err, SVNLogType.FSFS); } else { merge(owner, "/", txnRootNode, sourceNode, ancestorNode, txnRoot, conflictPath); } }
public void createNewTxnNodeRevisionFromRevision(String txnID, FSRevisionNode sourceNode) throws SVNException { if (sourceNode.getId().isTxn()) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_CORRUPT, "Copying from transactions not allowed"); SVNErrorManager.error(err); } FSRevisionNode revNode = FSRevisionNode.dumpRevisionNode(sourceNode); revNode.setPredecessorId(sourceNode.getId()); revNode.setCount(revNode.getCount() + 1); revNode.setCopyFromPath(null); revNode.setCopyFromRevision(FSRepository.SVN_INVALID_REVNUM); revNode.setId(FSID.createTxnId(sourceNode.getId().getNodeID(), sourceNode.getId().getCopyID(), txnID)); putTxnRevisionNode(revNode.getId(), revNode); }
public void createNewTxnNodeRevisionFromRevision(String txnID, FSRevisionNode sourceNode) throws SVNException { if (sourceNode.getId().isTxn()) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_CORRUPT, "Copying from transactions not allowed"); SVNErrorManager.error(err, SVNLogType.FSFS); } FSRevisionNode revNode = FSRevisionNode.dumpRevisionNode(sourceNode); revNode.setPredecessorId(sourceNode.getId()); revNode.setCount(revNode.getCount() + 1); revNode.setCopyFromPath(null); revNode.setIsFreshTxnRoot(true); revNode.setCopyFromRevision(SVNRepository.INVALID_REVISION); revNode.setId(FSID.createTxnId(sourceNode.getId().getNodeID(), sourceNode.getId().getCopyID(), txnID)); putTxnRevisionNode(revNode.getId(), revNode); }
private void mergeChanges(FSRevisionNode ancestorNode, FSRevisionNode sourceNode, StringBuffer conflictPath) throws SVNException { String txnId = myTxn.getTxnId(); FSRevisionNode txnRootNode = myTxnRoot.getRootRevisionNode(); if (ancestorNode == null) { ancestorNode = myTxnRoot.getTxnBaseRootNode(); } if (txnRootNode.getId().equals(ancestorNode.getId())) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.UNKNOWN, "FATAL error: no changes in transaction to commit"); SVNErrorManager.error(err, SVNLogType.FSFS); } else { merge("/", txnRootNode, sourceNode, ancestorNode, txnId, conflictPath); } }
private void mergeChanges(FSRevisionNode ancestorNode, FSRevisionNode sourceNode) throws SVNException { String txnId = myTxn.getTxnId(); FSRevisionNode txnRootNode = myTxnRoot.getRootRevisionNode(); if (ancestorNode == null) { ancestorNode = myTxnRoot.getTxnBaseRootNode(); } if (txnRootNode.getId().equals(ancestorNode.getId())) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.UNKNOWN, "FATAL error: no changes in transaction to commit"); SVNErrorManager.error(err); } else { merge("/", txnRootNode, sourceNode, ancestorNode, txnId); } }
private void mergeChanges(FSRevisionNode ancestorNode, FSRevisionNode sourceNode, StringBuffer conflictPath) throws SVNException { String txnId = myTxn.getTxnId(); FSRevisionNode txnRootNode = myTxnRoot.getRootRevisionNode(); if (ancestorNode == null) { ancestorNode = myTxnRoot.getTxnBaseRootNode(); } if (txnRootNode.getId().equals(ancestorNode.getId())) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.UNKNOWN, "FATAL error: no changes in transaction to commit"); SVNErrorManager.error(err, SVNLogType.FSFS); } else { merge("/", txnRootNode, sourceNode, ancestorNode, txnId, conflictPath); } }
public FSTransactionInfo getTxn() throws SVNException { FSID rootID = FSID.createTxnId("0", "0", myTxnID); FSRevisionNode revNode = getOwner().getRevisionNode(rootID); FSTransactionInfo txn = new FSTransactionInfo(revNode.getId(), revNode.getPredecessorId()); return txn; }
public FSTransactionInfo getTxn() throws SVNException { FSID rootID = FSID.createTxnId("0", "0", myTxnID); FSRevisionNode revNode = getOwner().getRevisionNode(rootID); FSTransactionInfo txn = new FSTransactionInfo(revNode.getId(), revNode.getPredecessorId()); return txn; }
public FSTransactionInfo getTxn() throws SVNException { FSID rootID = FSID.createTxnId("0", "0", myTxnID); FSRevisionNode revNode = getOwner().getRevisionNode(rootID); FSTransactionInfo txn = new FSTransactionInfo(revNode.getId(), revNode.getPredecessorId()); return txn; }
public FSTransactionInfo getTxn() throws SVNException { FSID rootID = FSID.createTxnId("0", "0", myTxnID); FSRevisionNode revNode = getOwner().getRevisionNode(rootID); FSTransactionInfo txn = new FSTransactionInfo(revNode.getId(), revNode.getPredecessorId()); return txn; }
public FSID createSuccessor(FSID oldId, FSRevisionNode newRevNode, String copyId) throws SVNException { if (copyId == null) { copyId = oldId.getCopyID(); } FSID id = FSID.createTxnId(oldId.getNodeID(), copyId, myTxnID); newRevNode.setId(id); if (newRevNode.getCopyRootPath() == null) { newRevNode.setCopyRootPath(newRevNode.getCreatedPath()); newRevNode.setCopyRootRevision(newRevNode.getId().getRevision()); } getOwner().putTxnRevisionNode(newRevNode.getId(), newRevNode); return id; }
private FSEntry fakeDirEntry(String reposPath, FSRoot root) throws SVNException { if (root.checkNodeKind(reposPath) == SVNNodeKind.NONE) { return null; } FSRevisionNode node = root.getRevisionNode(reposPath); FSEntry dirEntry = new FSEntry(node.getId(), node.getType(), SVNPathUtil.tail(node.getCreatedPath())); return dirEntry; }
private FSEntry fakeDirEntry(String reposPath, FSRevisionRoot root) throws SVNException { if (root.checkNodeKind(reposPath) == SVNNodeKind.NONE) { return null; } FSRevisionNode node = root.getRevisionNode(reposPath); FSEntry dirEntry = new FSEntry(node.getId(), node.getType(), SVNPathUtil.tail(node.getCreatedPath())); return dirEntry; }
private FSEntry fakeDirEntry(String reposPath, FSRevisionRoot root) throws SVNException { if (root.checkNodeKind(reposPath) == SVNNodeKind.NONE) { return null; } FSRevisionNode node = root.getRevisionNode(reposPath); FSEntry dirEntry = new FSEntry(node.getId(), node.getType(), SVNPathUtil.tail(node.getCreatedPath())); return dirEntry; }
private FSEntry fakeDirEntry(String reposPath, FSRevisionRoot root) throws SVNException { if (root.checkNodeKind(reposPath) == SVNNodeKind.NONE) { return null; } FSRevisionNode node = root.getRevisionNode(reposPath); FSEntry dirEntry = new FSEntry(node.getId(), node.getType(), SVNPathUtil.tail(node.getCreatedPath())); return dirEntry; }
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); }
private static void updateAncestry(FSFS owner, FSID sourceId, FSID targetId) throws SVNException { if (!targetId.isTxn()) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NOT_MUTABLE, "Attempt to update ancestry of non-mutable node"); SVNErrorManager.error(err, SVNLogType.FSFS); } final FSRevisionNode targetNode = owner.getRevisionNode(targetId); final FSRevisionNode sourceNode = owner.getRevisionNode(sourceId); targetNode.setPredecessorId(sourceNode.getId()); final long sourcePredecessorCount = sourceNode.getCount(); targetNode.setPredecessorId(sourceId); targetNode.setCount(sourcePredecessorCount != -1 ? sourcePredecessorCount + 1 : sourcePredecessorCount); targetNode.setIsFreshTxnRoot(false); owner.putTxnRevisionNode(targetId, targetNode); }
private void removeRevisionNode(FSID id) throws SVNException { FSRevisionNode node = getOwner().getRevisionNode(id); if (!node.getId().isTxn()) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NOT_MUTABLE, "Attempted removal of immutable node"); SVNErrorManager.error(err, SVNLogType.FSFS); } if (node.getPropsRepresentation() != null && node.getPropsRepresentation().isTxn()) { SVNFileUtil.deleteFile(getTransactionRevNodePropsFile(id)); } if (node.getTextRepresentation() != null && node.getTextRepresentation().isTxn() && node.getType() == SVNNodeKind.DIR) { SVNFileUtil.deleteFile(getTransactionRevNodeChildrenFile(id)); } SVNFileUtil.deleteFile(getOwner().getTransactionRevNodeFile(id)); }