final String md5Checksum = fields[4]; final FSRepresentation representation = new FSRepresentation(); representation.setRevision(revision); representation.setItemIndex(itemIndex);
public void close() throws IOException { if (myIsClosed) { return; } myIsClosed = true; try { ByteArrayInputStream target = new ByteArrayInputStream(myTextBuffer.array(), 0, myTextBuffer.position()); myDeltaGenerator.sendDelta(null, mySourceStream, mySourceOffset, target, this, false); FSRepresentation rep = new FSRepresentation(); rep.setOffset(myRepOffset); long offset = myTargetFile.getPosition(); rep.setSize(offset - myDeltaStart); rep.setExpandedSize(myRepSize); rep.setTxnId(myRevNode.getId().getTxnID()); rep.setRevision(FSRepository.SVN_INVALID_REVNUM); rep.setHexDigest(SVNFileUtil.toHexDigest(myDigest)); myTargetFile.write("ENDREP\n".getBytes("UTF-8")); myRevNode.setTextRepresentation(rep); myTxnRoot.getOwner().putTxnRevisionNode(myRevNode.getId(), myRevNode); } catch (SVNException svne) { throw new IOException(svne.getMessage()); } finally { closeStreams(); } }
private FSRepresentationState buildRepresentationList(FSRepresentation firstRep, LinkedList result, FSFS owner) throws SVNException { FSFile file = null; FSRepresentation rep = new FSRepresentation(firstRep); ByteBuffer buffer = ByteBuffer.allocate(4); try {
private FSRepresentationState buildRepresentationList(FSRepresentation firstRep, LinkedList result, FSFS owner) throws SVNException { FSFile file = null; FSRepresentation rep = new FSRepresentation(firstRep); ByteBuffer buffer = ByteBuffer.allocate(4); try {
private FSRepresentationState buildRepresentationList(FSRepresentation firstRep, LinkedList result, FSFS owner) throws SVNException { FSFile file = null; FSRepresentation rep = new FSRepresentation(firstRep); ByteBuffer buffer = ByteBuffer.allocate(4); try {
public void setProplist(FSRevisionNode node, Map properties) throws SVNException { if (!node.getId().isTxn()) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NOT_MUTABLE, "Can't set proplist on *immutable* node-revision {0}", node.getId()); SVNErrorManager.error(err); } File propsFile = getTransactionRevNodePropsFile(node.getId()); SVNProperties.setProperties(properties, propsFile, SVNFileUtil.createUniqueFile(propsFile.getParentFile(), propsFile.getName(), ".tmp"), SVNProperties.SVN_HASH_TERMINATOR); if (node.getPropsRepresentation() == null || !node.getPropsRepresentation().isTxn()) { FSRepresentation mutableRep = new FSRepresentation(); mutableRep.setTxnId(node.getId().getTxnID()); node.setPropsRepresentation(mutableRep); getOwner().putTxnRevisionNode(node.getId(), node); } }
public FSRepresentation getRepresentationByHash(String hash) throws SVNException { FSRepresentationCacheRecord cache = getByHash(hash); if (cache != null) { FSRepresentation representation = new FSRepresentation(); representation.setExpandedSize(cache.getExpandedSize()); representation.setOffset(cache.getOffset()); representation.setRevision(cache.getRevision()); representation.setSize(cache.getSize()); representation.setSHA1HexDigest(cache.getHash()); return representation; } return null; }
public FSRepresentation getRepresentationByHash(String hash) throws SVNException { FSRepresentationCacheRecord cache = getByHash(hash); if (cache != null) { FSRepresentation representation = new FSRepresentation(); representation.setExpandedSize(cache.getExpandedSize()); representation.setOffset(cache.getOffset()); representation.setRevision(cache.getRevision()); representation.setSize(cache.getSize()); representation.setSHA1HexDigest(cache.getHash()); return representation; } return null; }
public FSRepresentation getRepresentationByHash(String hash) throws SVNException { FSRepresentationCacheRecord cache = getByHash(hash); if (cache != null) { FSRepresentation representation = new FSRepresentation(); representation.setExpandedSize(cache.getExpandedSize()); representation.setItemIndex(cache.getOffset()); representation.setRevision(cache.getRevision()); representation.setSize(cache.getSize()); representation.setSHA1HexDigest(cache.getHash()); return representation; } return null; }
public void setProplist(FSRevisionNode node, SVNProperties properties) throws SVNException { if (!node.getId().isTxn()) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NOT_MUTABLE, "Can't set proplist on *immutable* node-revision {0}", node.getId()); SVNErrorManager.error(err, SVNLogType.FSFS); } File propsFile = getTransactionRevNodePropsFile(node.getId()); SVNWCProperties.setProperties(properties, propsFile, SVNFileUtil.createUniqueFile(propsFile.getParentFile(), ".props", ".tmp", false), SVNWCProperties.SVN_HASH_TERMINATOR); if (node.getPropsRepresentation() == null || !node.getPropsRepresentation().isTxn()) { FSRepresentation mutableRep = new FSRepresentation(); mutableRep.setTxnId(node.getId().getTxnID()); node.setPropsRepresentation(mutableRep); node.setIsFreshTxnRoot(false); getOwner().putTxnRevisionNode(node.getId(), node); } }
public void setProplist(FSRevisionNode node, SVNProperties properties) throws SVNException { if (!node.getId().isTxn()) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NOT_MUTABLE, "Can't set proplist on *immutable* node-revision {0}", node.getId()); SVNErrorManager.error(err, SVNLogType.FSFS); } File propsFile = getTransactionRevNodePropsFile(node.getId()); SVNWCProperties.setProperties(properties, propsFile, SVNFileUtil.createUniqueFile(propsFile.getParentFile(), ".props", ".tmp", false), SVNWCProperties.SVN_HASH_TERMINATOR); if (node.getPropsRepresentation() == null || !node.getPropsRepresentation().isTxn()) { FSRepresentation mutableRep = new FSRepresentation(); mutableRep.setTxnId(node.getId().getTxnID()); node.setPropsRepresentation(mutableRep); node.setIsFreshTxnRoot(false); getOwner().putTxnRevisionNode(node.getId(), 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 void setProplist(FSRevisionNode node, SVNProperties properties) throws SVNException { if (!node.getId().isTxn()) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NOT_MUTABLE, "Can't set proplist on *immutable* node-revision {0}", node.getId()); SVNErrorManager.error(err, SVNLogType.FSFS); } File propsFile = getTransactionRevNodePropsFile(node.getId()); SVNWCProperties.setProperties(properties, propsFile, SVNFileUtil.createUniqueFile(propsFile.getParentFile(), ".props", ".tmp", false), SVNWCProperties.SVN_HASH_TERMINATOR); if (node.getPropsRepresentation() == null || !node.getPropsRepresentation().isTxn()) { FSRepresentation mutableRep = new FSRepresentation(); mutableRep.setTxnId(node.getId().getTxnID()); node.setPropsRepresentation(mutableRep); node.setIsFreshTxnRoot(false); getOwner().putTxnRevisionNode(node.getId(), 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())); } 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; }
dst = SVNFileUtil.openFileForWriting(childrenFile); SVNProperties.setProperties(unparsedEntries, dst, SVNProperties.SVN_HASH_TERMINATOR); textRep = new FSRepresentation(); textRep.setRevision(FSRepository.SVN_INVALID_REVNUM); textRep.setTxnId(myTxnID);
dst = SVNFileUtil.openFileForWriting(childrenFile); SVNWCProperties.setProperties(unparsedEntries, dst, SVNWCProperties.SVN_HASH_TERMINATOR); textRep = new FSRepresentation(); textRep.setRevision(SVNRepository.INVALID_REVISION); textRep.setTxnId(myTxnID);
dst = SVNFileUtil.openFileForWriting(childrenFile); SVNWCProperties.setProperties(unparsedEntries, dst, SVNWCProperties.SVN_HASH_TERMINATOR); textRep = new FSRepresentation(); textRep.setRevision(SVNRepository.INVALID_REVISION); textRep.setTxnId(myTxnID);
dst = SVNFileUtil.openFileForWriting(childrenFile); SVNWCProperties.setProperties(unparsedEntries, dst, SVNWCProperties.SVN_HASH_TERMINATOR); textRep = new FSRepresentation(); textRep.setRevision(SVNRepository.INVALID_REVISION); textRep.setTxnId(myTxnID);