private void copy(FSRevisionNode toNode, String entryName, FSRevisionNode fromNode, boolean preserveHistory, long fromRevision, String fromPath, String txnId) throws SVNException { FSID id = null; if (preserveHistory) { FSID srcId = fromNode.getId(); FSRevisionNode toRevNode = FSRevisionNode.dumpRevisionNode(fromNode); String copyId = reserveCopyId(txnId); toRevNode.setPredecessorId(srcId); if (toRevNode.getCount() != -1) { toRevNode.setCount(toRevNode.getCount() + 1); } toRevNode.setCreatedPath(SVNPathUtil.concatToAbs(toNode.getCreatedPath(), entryName)); toRevNode.setCopyFromPath(fromPath); toRevNode.setCopyFromRevision(fromRevision); toRevNode.setCopyRootPath(null); id = myTxnRoot.createSuccessor(srcId, toRevNode, copyId); } else { id = fromNode.getId(); } myTxnRoot.setEntry(toNode, entryName, id, fromNode.getType()); }
private void copy(FSRevisionNode toNode, String entryName, FSRevisionNode fromNode, boolean preserveHistory, long fromRevision, String fromPath, String txnId) throws SVNException { FSID id = null; if (preserveHistory) { FSID srcId = fromNode.getId(); FSRevisionNode toRevNode = FSRevisionNode.dumpRevisionNode(fromNode); String copyId = reserveCopyId(txnId); toRevNode.setPredecessorId(srcId); if (toRevNode.getCount() != -1) { toRevNode.setCount(toRevNode.getCount() + 1); } String createdPath = SVNPathUtil.getAbsolutePath(SVNPathUtil.append(toNode.getCreatedPath(), entryName)); toRevNode.setCreatedPath(createdPath); toRevNode.setCopyFromPath(fromPath); toRevNode.setCopyFromRevision(fromRevision); toRevNode.setCopyRootPath(null); id = myTxnRoot.createSuccessor(srcId, toRevNode, copyId); } else { id = fromNode.getId(); } myTxnRoot.setEntry(toNode, entryName, id, fromNode.getType()); }
private void copy(FSRevisionNode toNode, String entryName, FSRevisionNode fromNode, boolean preserveHistory, long fromRevision, String fromPath, String txnId) throws SVNException { FSID id = null; if (preserveHistory) { FSID srcId = fromNode.getId(); FSRevisionNode toRevNode = FSRevisionNode.dumpRevisionNode(fromNode); String copyId = reserveCopyId(txnId); toRevNode.setPredecessorId(srcId); if (toRevNode.getCount() != -1) { toRevNode.setCount(toRevNode.getCount() + 1); } String createdPath = SVNPathUtil.getAbsolutePath(SVNPathUtil.append(toNode.getCreatedPath(), entryName)); toRevNode.setCreatedPath(createdPath); toRevNode.setCopyFromPath(fromPath); toRevNode.setCopyFromRevision(fromRevision); toRevNode.setCopyRootPath(null); id = myTxnRoot.createSuccessor(srcId, toRevNode, copyId); } else { id = fromNode.getId(); } myTxnRoot.setEntry(toNode, entryName, id, fromNode.getType()); }
private void copy(FSRevisionNode toNode, String entryName, FSRevisionNode fromNode, boolean preserveHistory, long fromRevision, String fromPath, String txnId) throws SVNException { FSID id = null; FSTransactionRoot txnRoot = getTxnRoot(); if (preserveHistory) { FSID srcId = fromNode.getId(); FSRevisionNode toRevNode = FSRevisionNode.dumpRevisionNode(fromNode); String copyId = reserveCopyId(txnId); toRevNode.setPredecessorId(srcId); if (toRevNode.getCount() != -1) { toRevNode.setCount(toRevNode.getCount() + 1); } String createdPath = SVNPathUtil.getAbsolutePath(SVNPathUtil.append(toNode.getCreatedPath(), entryName)); toRevNode.setCreatedPath(createdPath); toRevNode.setCopyFromPath(fromPath); toRevNode.setCopyFromRevision(fromRevision); toRevNode.setCopyRootPath(null); id = txnRoot.createSuccessor(srcId, toRevNode, copyId); } else { id = fromNode.getId(); } txnRoot.setEntry(toNode, entryName, id, fromNode.getType()); }
public FSRevisionNode cloneChild(FSRevisionNode parent, String parentPath, String childName, String copyId, boolean isParentCopyRoot) throws SVNException { if (!parent.getId().isTxn()) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NOT_MUTABLE, "Attempted to clone child of non-mutable node"); SVNErrorManager.error(err); } if (!SVNPathUtil.isSinglePathComponent(childName)) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NOT_SINGLE_PATH_COMPONENT, "Attempted to make a child clone with an illegal name ''{0}''", childName); SVNErrorManager.error(err); } FSRevisionNode childNode = parent.getChildDirNode(childName, getOwner()); FSID newNodeId = null; if (childNode.getId().isTxn()) { newNodeId = childNode.getId(); } else { if (isParentCopyRoot) { childNode.setCopyRootPath(parent.getCopyRootPath()); childNode.setCopyRootRevision(parent.getCopyRootRevision()); } childNode.setCopyFromPath(null); childNode.setCopyFromRevision(FSRepository.SVN_INVALID_REVNUM); childNode.setPredecessorId(childNode.getId()); if (childNode.getCount() != -1) { childNode.setCount(childNode.getCount() + 1); } childNode.setCreatedPath(SVNPathUtil.concatToAbs(parentPath, childName)); newNodeId = createSuccessor(childNode.getId(), childNode, copyId); setEntry(parent, childName, newNodeId, childNode.getType()); } return getOwner().getRevisionNode(newNodeId); }
public FSRevisionNode cloneChild(FSRevisionNode parent, String parentPath, String childName, String copyId, boolean isParentCopyRoot) throws SVNException { if (!parent.getId().isTxn()) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NOT_MUTABLE, "Attempted to clone child of non-mutable node"); SVNErrorManager.error(err, SVNLogType.FSFS); } if (!SVNPathUtil.isSinglePathComponent(childName)) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NOT_SINGLE_PATH_COMPONENT, "Attempted to make a child clone with an illegal name ''{0}''", childName); SVNErrorManager.error(err, SVNLogType.FSFS); } FSRevisionNode childNode = parent.getChildDirNode(childName, getOwner()); FSID newNodeId = null; if (childNode.getId().isTxn()) { newNodeId = childNode.getId(); } else { if (isParentCopyRoot) { childNode.setCopyRootPath(parent.getCopyRootPath()); childNode.setCopyRootRevision(parent.getCopyRootRevision()); } childNode.setCopyFromPath(null); childNode.setCopyFromRevision(SVNRepository.INVALID_REVISION); childNode.setPredecessorId(childNode.getId()); if (childNode.getCount() != -1) { childNode.setCount(childNode.getCount() + 1); } childNode.setCreatedPath(SVNPathUtil.getAbsolutePath(SVNPathUtil.append(parentPath, childName))); newNodeId = createSuccessor(childNode.getId(), childNode, copyId); setEntry(parent, childName, newNodeId, childNode.getType()); } return getOwner().getRevisionNode(newNodeId); }
public FSRevisionNode cloneChild(FSRevisionNode parent, String parentPath, String childName, String copyId, boolean isParentCopyRoot) throws SVNException { if (!parent.getId().isTxn()) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NOT_MUTABLE, "Attempted to clone child of non-mutable node"); SVNErrorManager.error(err, SVNLogType.FSFS); } if (!SVNPathUtil.isSinglePathComponent(childName)) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NOT_SINGLE_PATH_COMPONENT, "Attempted to make a child clone with an illegal name ''{0}''", childName); SVNErrorManager.error(err, SVNLogType.FSFS); } FSRevisionNode childNode = parent.getChildDirNode(childName, getOwner()); FSID newNodeId = null; if (childNode.getId().isTxn()) { newNodeId = childNode.getId(); } else { if (isParentCopyRoot) { childNode.setCopyRootPath(parent.getCopyRootPath()); childNode.setCopyRootRevision(parent.getCopyRootRevision()); } childNode.setCopyFromPath(null); childNode.setCopyFromRevision(SVNRepository.INVALID_REVISION); childNode.setPredecessorId(childNode.getId()); if (childNode.getCount() != -1) { childNode.setCount(childNode.getCount() + 1); } childNode.setCreatedPath(SVNPathUtil.getAbsolutePath(SVNPathUtil.append(parentPath, childName))); newNodeId = createSuccessor(childNode.getId(), childNode, copyId); setEntry(parent, childName, newNodeId, childNode.getType()); } return getOwner().getRevisionNode(newNodeId); }
public FSRevisionNode cloneChild(FSRevisionNode parent, String parentPath, String childName, String copyId, boolean isParentCopyRoot) throws SVNException { if (!parent.getId().isTxn()) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NOT_MUTABLE, "Attempted to clone child of non-mutable node"); SVNErrorManager.error(err, SVNLogType.FSFS); } if (!SVNPathUtil.isSinglePathComponent(childName)) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NOT_SINGLE_PATH_COMPONENT, "Attempted to make a child clone with an illegal name ''{0}''", childName); SVNErrorManager.error(err, SVNLogType.FSFS); } FSRevisionNode childNode = parent.getChildDirNode(childName, getOwner()); FSID newNodeId = null; if (childNode.getId().isTxn()) { newNodeId = childNode.getId(); } else { if (isParentCopyRoot) { childNode.setCopyRootPath(parent.getCopyRootPath()); childNode.setCopyRootRevision(parent.getCopyRootRevision()); } childNode.setCopyFromPath(null); childNode.setCopyFromRevision(SVNRepository.INVALID_REVISION); childNode.setPredecessorId(childNode.getId()); if (childNode.getCount() != -1) { childNode.setCount(childNode.getCount() + 1); } childNode.setCreatedPath(SVNPathUtil.getAbsolutePath(SVNPathUtil.append(parentPath, childName))); newNodeId = createSuccessor(childNode.getId(), childNode, copyId); setEntry(parent, childName, newNodeId, childNode.getType()); } return getOwner().getRevisionNode(newNodeId); }