public boolean equals(Object obj) { if (obj == null || obj.getClass() != FSID.class) { return false; } FSID id = (FSID) obj; if (this == id) { return true; } if (myNodeID != null && !myNodeID.equals(id.getNodeID())) { return false; } else if (myNodeID == null && id.getNodeID() != null) { return false; } if (myCopyID != null && !myCopyID.equals(id.getCopyID())) { return false; } else if (myCopyID == null && id.getCopyID() != null) { return false; } if (myTxnID != null && !myTxnID.equals(id.getTxnID())) { return false; } else if (myTxnID == null && id.getTxnID() != null) { return false; } if (myRevision != id.getRevision() || myOffset != id.getOffset()) { return false; } return true; }
public boolean equals(Object obj) { if (obj == null || obj.getClass() != FSID.class) { return false; } FSID id = (FSID) obj; if (this == id) { return true; } if (myNodeID != null && !myNodeID.equals(id.getNodeID())) { return false; } else if (myNodeID == null && id.getNodeID() != null) { return false; } if (myCopyID != null && !myCopyID.equals(id.getCopyID())) { return false; } else if (myCopyID == null && id.getCopyID() != null) { return false; } if (myTxnID != null && !myTxnID.equals(id.getTxnID())) { return false; } else if (myTxnID == null && id.getTxnID() != null) { return false; } if (myRevision != id.getRevision() || myOffset != id.getOffset()) { return false; } return true; }
public boolean equals(Object obj) { if (obj == null || obj.getClass() != FSID.class) { return false; } FSID id = (FSID) obj; if (this == id) { return true; } if (myNodeID != null && !myNodeID.equals(id.getNodeID())) { return false; } else if (myNodeID == null && id.getNodeID() != null) { return false; } if (myCopyID != null && !myCopyID.equals(id.getCopyID())) { return false; } else if (myCopyID == null && id.getCopyID() != null) { return false; } if (myTxnID != null && !myTxnID.equals(id.getTxnID())) { return false; } else if (myTxnID == null && id.getTxnID() != null) { return false; } if (myRevision != id.getRevision() || myOffset != id.getOffset()) { return false; } return true; }
public boolean equals(Object obj) { if (obj == null || obj.getClass() != FSID.class) { return false; } FSID id = (FSID) obj; if (this == id) { return true; } if (myNodeID != null && !myNodeID.equals(id.getNodeID())) { return false; } else if (myNodeID == null && id.getNodeID() != null) { return false; } if (myCopyID != null && !myCopyID.equals(id.getCopyID())) { return false; } else if (myCopyID == null && id.getCopyID() != null) { return false; } if (myTxnID != null && !myTxnID.equals(id.getTxnID())) { return false; } else if (myTxnID == null && id.getTxnID() != null) { return false; } if (myRevision != id.getRevision() || myOffset != id.getOffset()) { return false; } return true; }
public FSID copy() { return new FSID(getNodeID(), getTxnID(), getCopyID(), getRevision(), getOffset()); }
public FSID copy() { return new FSID(getNodeID(), getTxnID(), getCopyID(), getRevision(), getOffset()); }
public FSID copy() { return new FSID(getNodeID(), getTxnID(), getCopyID(), getRevision(), getOffset()); }
public FSID copy() { return new FSID(getNodeID(), getTxnID(), getCopyID(), getRevision(), getOffset()); }
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 = getRevisionFile(id.getRevision()); revisionFile.seek(id.getOffset()); } Map headers = null; try { headers = revisionFile.readHeader(); } finally{ revisionFile.close(); } return FSRevisionNode.fromMap(headers); }
continue; findMaxIDs(rev, revFile, id.getOffset(), maxNodeID, maxCopyID);
continue; findMaxIDs(rev, revFile, id.getOffset(), maxNodeID, maxCopyID);
continue; findMaxIDs(rev, revFile, id.getOffset(), maxNodeID, maxCopyID);
private void commit(String startNodeId, String startCopyId, long newRevision, OutputStream protoFileOS, FSID newRootId, FSTransactionRoot txnRoot, File revisionPrototypeFile, long offset) throws SVNException { try { protoFileOS = SVNFileUtil.openFileForWriting(revisionPrototypeFile, true); FSID rootId = FSID.createTxnId("0", "0", myTxn.getTxnId()); CountingOutputStream revWriter = new CountingOutputStream(protoFileOS, offset); newRootId = txnRoot.writeFinalRevision(newRootId, revWriter, newRevision, rootId, startNodeId, startCopyId); long changedPathOffset = txnRoot.writeFinalChangedPathInfo(revWriter); String offsetsLine = "\n" + newRootId.getOffset() + " " + changedPathOffset + "\n"; protoFileOS.write(offsetsLine.getBytes("UTF-8")); } catch (IOException ioe) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.IO_ERROR, ioe.getLocalizedMessage()); SVNErrorManager.error(err, ioe, SVNLogType.FSFS); } finally { SVNFileUtil.closeFile(protoFileOS); } SVNProperties txnProps = myFSFS.getTransactionProperties(myTxn.getTxnId()); if (txnProps != null && !txnProps.isEmpty()) { if (txnProps.getStringValue(SVNProperty.TXN_CHECK_OUT_OF_DATENESS) != null) { myFSFS.setTransactionProperty(myTxn.getTxnId(), SVNProperty.TXN_CHECK_OUT_OF_DATENESS, null); } if (txnProps.getStringValue(SVNProperty.TXN_CHECK_LOCKS) != null) { myFSFS.setTransactionProperty(myTxn.getTxnId(), SVNProperty.TXN_CHECK_LOCKS, null); } } }
private void commit(String startNodeId, String startCopyId, long newRevision, OutputStream protoFileOS, FSID newRootId, FSTransactionRoot txnRoot, File revisionPrototypeFile, long offset) throws SVNException { try { protoFileOS = SVNFileUtil.openFileForWriting(revisionPrototypeFile, true); FSID rootId = FSID.createTxnId("0", "0", myTxn.getTxnId()); CountingOutputStream revWriter = new CountingOutputStream(protoFileOS, offset); newRootId = txnRoot.writeFinalRevision(newRootId, revWriter, newRevision, rootId, startNodeId, startCopyId); long changedPathOffset = txnRoot.writeFinalChangedPathInfo(revWriter); String offsetsLine = "\n" + newRootId.getOffset() + " " + changedPathOffset + "\n"; protoFileOS.write(offsetsLine.getBytes("UTF-8")); } catch (IOException ioe) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.IO_ERROR, ioe.getLocalizedMessage()); SVNErrorManager.error(err, ioe, SVNLogType.FSFS); } finally { SVNFileUtil.closeFile(protoFileOS); } SVNProperties txnProps = myFSFS.getTransactionProperties(myTxn.getTxnId()); if (txnProps != null && !txnProps.isEmpty()) { if (txnProps.getStringValue(SVNProperty.TXN_CHECK_OUT_OF_DATENESS) != null) { myFSFS.setTransactionProperty(myTxn.getTxnId(), SVNProperty.TXN_CHECK_OUT_OF_DATENESS, null); } if (txnProps.getStringValue(SVNProperty.TXN_CHECK_LOCKS) != null) { myFSFS.setTransactionProperty(myTxn.getTxnId(), SVNProperty.TXN_CHECK_LOCKS, null); } } }
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; }
long changedPathOffset = myTxnRoot.writeFinalChangedPathInfo(revWriter); String offsetsLine = "\n" + newRootId.getOffset() + " " + changedPathOffset + "\n"; protoFileOS.write(offsetsLine.getBytes("UTF-8")); } catch (IOException ioe) {
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; }
txnRoot.writeIndexData(revWriter, newRevision, myTxn.getTxnId()); } else { String offsetsLine = "\n" + newRootId.getOffset() + " " + changedPathOffset + "\n"; protoFileOS.write(offsetsLine.getBytes("UTF-8"));