String type = FSRevisionNode.HEADER_TYPE + ": " + revNode.getType() + "\n"; revNodeFile.write(type.getBytes("UTF-8")); if (revNode.getPredecessorId() != null) { String predId = FSRevisionNode.HEADER_PRED + ": " + revNode.getPredecessorId() + "\n"; revNodeFile.write(predId.getBytes("UTF-8"));
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 FSRepresentation chooseDeltaBase(FSFS fsfsOwner) throws SVNException { if (getCount() == 0) { return null; } long count = getCount(); count = count & (count - 1); FSRevisionNode baseNode = this; while ((count++) < getCount()) { baseNode = fsfsOwner.getRevisionNode(baseNode.getPredecessorId()); } return baseNode.getTextRepresentation(); }
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 FSRepresentation chooseDeltaBase(FSFS fsfsOwner) throws SVNException { if (getCount() == 0) { return null; } long count = getCount(); count = count & (count - 1); FSRevisionNode baseNode = this; while ((count++) < getCount()) { baseNode = fsfsOwner.getRevisionNode(baseNode.getPredecessorId()); } return baseNode.getTextRepresentation(); }
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 FSRepresentation chooseDeltaBase(FSFS fsfsOwner) throws SVNException { if (getCount() == 0) { return null; } long count = getCount(); count = count & (count - 1); FSRevisionNode baseNode = this; while ((count++) < getCount()) { baseNode = fsfsOwner.getRevisionNode(baseNode.getPredecessorId()); } return baseNode.getTextRepresentation(); }
public FSRepresentation chooseDeltaBase(FSFS fsfsOwner) throws SVNException { if (getCount() == 0) { return null; } long count = getCount(); count = count & (count - 1); FSRevisionNode baseNode = this; while ((count++) < getCount()) { baseNode = fsfsOwner.getRevisionNode(baseNode.getPredecessorId()); } return baseNode.getTextRepresentation(); }
public FSRevisionNode getRevisionNode(FSID id) throws SVNException { FSFile revisionFile = null; if (id.isTxn()) { File file = new File(getTransactionDir(id.getTxnID()), PATH_PREFIX_NODE + id.getNodeID() + "." + id.getCopyID()); revisionFile = new FSFile(file); } else { revisionFile = openAndSeekRevision(id.getRevision(), id.getOffset()); } Map headers = null; try { headers = revisionFile.readHeader(); } finally{ revisionFile.close(); } FSRevisionNode node = FSRevisionNode.fromMap(headers); if (node.isFreshTxnRoot()) { node.setFreshRootPredecessorId(node.getPredecessorId()); } return node; }
public FSRevisionNode getRevisionNode(FSID id) throws SVNException { FSFile revisionFile = null; if (id.isTxn()) { File file = new File(getTransactionDir(id.getTxnID()), PATH_PREFIX_NODE + id.getNodeID() + "." + id.getCopyID()); revisionFile = new FSFile(file); } else { revisionFile = openAndSeekRevision(id.getRevision(), id.getOffset()); } Map headers = null; try { headers = revisionFile.readHeader(); } finally{ revisionFile.close(); } FSRevisionNode node = FSRevisionNode.fromMap(headers); if (node.isFreshTxnRoot()) { node.setFreshRootPredecessorId(node.getPredecessorId()); } return node; }
public FSRevisionNode getRevisionNode(FSID id) throws SVNException { FSFile revisionFile = null; if (id.isTxn()) { File file = new File(getTransactionDir(id.getTxnID()), PATH_PREFIX_NODE + id.getNodeID() + "." + id.getCopyID()); revisionFile = new FSFile(file); } else { revisionFile = openAndSeekRevision(id.getRevision(), id.getOffset()); } Map headers = null; try { headers = revisionFile.readHeader(); } finally{ revisionFile.close(); } FSRevisionNode node = FSRevisionNode.fromMap(headers); if (node.isFreshTxnRoot()) { node.setFreshRootPredecessorId(node.getPredecessorId()); } return node; }
public static FSRevisionNode dumpRevisionNode(FSRevisionNode revNode) { FSRevisionNode clone = new FSRevisionNode(); clone.setId(revNode.getId()); if (revNode.getPredecessorId() != null) { clone.setPredecessorId(revNode.getPredecessorId()); } clone.setType(revNode.getType()); clone.setCopyFromPath(revNode.getCopyFromPath()); clone.setCopyFromRevision(revNode.getCopyFromRevision()); clone.setCopyRootPath(revNode.getCopyRootPath()); clone.setCopyRootRevision(revNode.getCopyRootRevision()); clone.setCount(revNode.getCount()); clone.setCreatedPath(revNode.getCreatedPath()); if (revNode.getPropsRepresentation() != null) { clone.setPropsRepresentation(new FSRepresentation(revNode.getPropsRepresentation())); } if (revNode.getTextRepresentation() != null) { clone.setTextRepresentation(new FSRepresentation(revNode.getTextRepresentation())); } return clone; }
public static FSRevisionNode dumpRevisionNode(FSRevisionNode revNode) { FSRevisionNode clone = new FSRevisionNode(); clone.setId(revNode.getId()); if (revNode.getPredecessorId() != null) { clone.setPredecessorId(revNode.getPredecessorId()); } clone.setType(revNode.getType()); clone.setCopyFromPath(revNode.getCopyFromPath()); clone.setCopyFromRevision(revNode.getCopyFromRevision()); clone.setCopyRootPath(revNode.getCopyRootPath()); clone.setCopyRootRevision(revNode.getCopyRootRevision()); clone.setCount(revNode.getCount()); clone.setCreatedPath(revNode.getCreatedPath()); if (revNode.getPropsRepresentation() != null) { clone.setPropsRepresentation(new FSRepresentation(revNode.getPropsRepresentation())); } if (revNode.getTextRepresentation() != null) { clone.setTextRepresentation(new FSRepresentation(revNode.getTextRepresentation())); } clone.setMergeInfoCount(revNode.getMergeInfoCount()); clone.setHasMergeInfo(revNode.hasMergeInfo()); return clone; }
public static FSRevisionNode dumpRevisionNode(FSRevisionNode revNode) { FSRevisionNode clone = new FSRevisionNode(); clone.setId(revNode.getId()); if (revNode.getPredecessorId() != null) { clone.setPredecessorId(revNode.getPredecessorId()); } clone.setType(revNode.getType()); clone.setCopyFromPath(revNode.getCopyFromPath()); clone.setCopyFromRevision(revNode.getCopyFromRevision()); clone.setCopyRootPath(revNode.getCopyRootPath()); clone.setCopyRootRevision(revNode.getCopyRootRevision()); clone.setCount(revNode.getCount()); clone.setCreatedPath(revNode.getCreatedPath()); if (revNode.getPropsRepresentation() != null) { clone.setPropsRepresentation(new FSRepresentation(revNode.getPropsRepresentation())); } if (revNode.getTextRepresentation() != null) { clone.setTextRepresentation(new FSRepresentation(revNode.getTextRepresentation())); } clone.setMergeInfoCount(revNode.getMergeInfoCount()); clone.setHasMergeInfo(revNode.hasMergeInfo()); return clone; }
public static FSRevisionNode dumpRevisionNode(FSRevisionNode revNode) { FSRevisionNode clone = new FSRevisionNode(); clone.setId(revNode.getId()); if (revNode.getPredecessorId() != null) { clone.setPredecessorId(revNode.getPredecessorId()); } clone.setType(revNode.getType()); clone.setCopyFromPath(revNode.getCopyFromPath()); clone.setCopyFromRevision(revNode.getCopyFromRevision()); clone.setCopyRootPath(revNode.getCopyRootPath()); clone.setCopyRootRevision(revNode.getCopyRootRevision()); clone.setCount(revNode.getCount()); clone.setCreatedPath(revNode.getCreatedPath()); if (revNode.getPropsRepresentation() != null) { clone.setPropsRepresentation(new FSRepresentation(revNode.getPropsRepresentation())); } if (revNode.getTextRepresentation() != null) { clone.setTextRepresentation(new FSRepresentation(revNode.getTextRepresentation())); } clone.setMergeInfoCount(revNode.getMergeInfoCount()); clone.setHasMergeInfo(revNode.hasMergeInfo()); return clone; }
private FSClosestCopy closestCopy(FSRevisionRoot root, String path) throws SVNException { FSParentPath parentPath = root.openPath(path, true, true); SVNLocationEntry copyDstEntry = FSNodeHistory.findYoungestCopyroot(myReposRootDir, parentPath); if (copyDstEntry == null || copyDstEntry.getRevision() == 0) { return null; } FSRevisionRoot copyDstRoot = myFSFS.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.getId().getRevision(); 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()); }
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()); }