private long finalizeCommit() throws SVNException { FSHooks.runPreCommitHook(myFSFS.getRepositoryRoot(), myTxn.getTxnId()); return myCommitter.commitTxn(); }
public static FSTransactionInfo beginTransactionForCommit(long baseRevision, SVNProperties revisionProperties, FSFS owner) throws SVNException { List caps = new ArrayList(); caps.add("mergeinfo"); String author = revisionProperties.getStringValue(SVNRevisionProperty.AUTHOR); FSHooks.runStartCommitHook(owner.getRepositoryRoot(), author, caps); FSTransactionInfo txn = FSTransactionRoot.beginTransaction(baseRevision, FSTransactionRoot.SVN_FS_TXN_CHECK_LOCKS, owner); owner.changeTransactionProperties(txn.getTxnId(), revisionProperties); return txn; }
public static FSTransactionInfo beginTransactionForCommit(long baseRevision, SVNProperties revisionProperties, FSFS owner) throws SVNException { List caps = new ArrayList(); caps.add("mergeinfo"); String author = revisionProperties.getStringValue(SVNRevisionProperty.AUTHOR); FSHooks.runStartCommitHook(owner.getRepositoryRoot(), author, caps); FSTransactionInfo txn = FSTransactionRoot.beginTransaction(baseRevision, FSTransactionRoot.SVN_FS_TXN_CHECK_LOCKS, owner); owner.changeTransactionProperties(txn.getTxnId(), revisionProperties); return txn; }
private FSTransactionInfo beginTransactionForCommit(long baseRevision) throws SVNException { FSHooks.runStartCommitHook(myFSFS.getRepositoryRoot(), myAuthor); FSTransactionInfo txn = FSTransactionRoot.beginTransaction(baseRevision, FSTransactionRoot.SVN_FS_TXN_CHECK_LOCKS, myFSFS); if (myAuthor != null && !"".equals(myAuthor)) { myFSFS.setTransactionProperty(txn.getTxnId(), SVNRevisionProperty.AUTHOR, myAuthor); } if (myLogMessage != null && !"".equals(myLogMessage)) { myFSFS.setTransactionProperty(txn.getTxnId(), SVNRevisionProperty.LOG, myLogMessage); } return txn; }
public static FSTransactionInfo beginTransactionForCommit(long baseRevision, SVNProperties revisionProperties, FSFS owner) throws SVNException { List caps = new ArrayList(); caps.add("mergeinfo"); String author = revisionProperties.getStringValue(SVNRevisionProperty.AUTHOR); if (owner != null && owner.isHooksEnabled()) { FSHooks.runStartCommitHook(owner.getRepositoryRoot(), author, caps); } FSTransactionInfo txn = FSTransactionRoot.beginTransaction(baseRevision, FSTransactionRoot.SVN_FS_TXN_CHECK_LOCKS, owner); owner.changeTransactionProperties(txn.getTxnId(), revisionProperties); return txn; }
public void insert(final FSRepresentation representation, boolean rejectDup) throws SVNException { if (representation.getSHA1HexDigest() == null) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.BAD_CHECKSUM_KIND, "Only SHA1 checksums can be used as keys in the rep_cache table.\n"); SVNErrorManager.error(err, SVNLogType.FSFS); } FSRepresentation oldRep = getRepresentationByHash(representation.getSHA1HexDigest()); if (oldRep != null) { if (rejectDup && (oldRep.getRevision() != representation.getRevision() || oldRep.getOffset() != representation.getOffset() || oldRep.getSize() != representation.getSize() || oldRep.getExpandedSize() != representation.getExpandedSize())) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_CORRUPT, "Representation key for checksum ''{0}'' exists in " + "filesystem ''{1}'' with a different value ({2},{3},{4},{5}) than what we were about to store ({6},{7},{8},{9})", new Object[] { representation.getSHA1HexDigest(), myFSFS.getRepositoryRoot(), String.valueOf(oldRep.getRevision()), String.valueOf(oldRep.getOffset()), String.valueOf(oldRep.getSize()), String.valueOf(oldRep.getExpandedSize()), String.valueOf(representation.getRevision()), String.valueOf(representation.getOffset()), String.valueOf(representation.getSize()), String.valueOf(representation.getExpandedSize()) }); SVNErrorManager.error(err, SVNLogType.FSFS); } return; } try { myTable.insert(new Object[] { representation.getSHA1HexDigest(), new Long(representation.getRevision()), new Long(representation.getOffset()), new Long(representation.getSize()), new Long(representation.getExpandedSize()) }); } catch (SqlJetException e) { SVNErrorManager.error(convertError(e), SVNLogType.FSFS); } }
public void insert(final FSRepresentation representation, boolean rejectDup) throws SVNException { if (representation.getSHA1HexDigest() == null) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.BAD_CHECKSUM_KIND, "Only SHA1 checksums can be used as keys in the rep_cache table.\n"); SVNErrorManager.error(err, SVNLogType.FSFS); } FSRepresentation oldRep = getRepresentationByHash(representation.getSHA1HexDigest()); if (oldRep != null) { if (rejectDup && (oldRep.getRevision() != representation.getRevision() || oldRep.getOffset() != representation.getOffset() || oldRep.getSize() != representation.getSize() || oldRep.getExpandedSize() != representation.getExpandedSize())) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_CORRUPT, "Representation key for checksum ''{0}'' exists in " + "filesystem ''{1}'' with a different value ({2},{3},{4},{5}) than what we were about to store ({6},{7},{8},{9})", new Object[] { representation.getSHA1HexDigest(), myFSFS.getRepositoryRoot(), String.valueOf(oldRep.getRevision()), String.valueOf(oldRep.getOffset()), String.valueOf(oldRep.getSize()), String.valueOf(oldRep.getExpandedSize()), String.valueOf(representation.getRevision()), String.valueOf(representation.getOffset()), String.valueOf(representation.getSize()), String.valueOf(representation.getExpandedSize()) }); SVNErrorManager.error(err, SVNLogType.FSFS); } return; } try { myTable.insert(new Object[] { representation.getSHA1HexDigest(), new Long(representation.getRevision()), new Long(representation.getOffset()), new Long(representation.getSize()), new Long(representation.getExpandedSize()) }); } catch (SqlJetException e) { SVNErrorManager.error(convertError(e), SVNLogType.FSFS); } }
public void insert(final FSRepresentation representation, boolean rejectDup) throws SVNException { if (representation.getSHA1HexDigest() == null) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.BAD_CHECKSUM_KIND, "Only SHA1 checksums can be used as keys in the rep_cache table.\n"); SVNErrorManager.error(err, SVNLogType.FSFS); } FSRepresentation oldRep = getRepresentationByHash(representation.getSHA1HexDigest()); if (oldRep != null) { if (rejectDup && (oldRep.getRevision() != representation.getRevision() || oldRep.getItemIndex() != representation.getItemIndex() || oldRep.getSize() != representation.getSize() || oldRep.getExpandedSize() != representation.getExpandedSize())) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_CORRUPT, "Representation key for checksum ''{0}'' exists in " + "filesystem ''{1}'' with a different value ({2},{3},{4},{5}) than what we were about to store ({6},{7},{8},{9})", new Object[] { representation.getSHA1HexDigest(), myFSFS.getRepositoryRoot(), String.valueOf(oldRep.getRevision()), String.valueOf(oldRep.getItemIndex()), String.valueOf(oldRep.getSize()), String.valueOf(oldRep.getExpandedSize()), String.valueOf(representation.getRevision()), String.valueOf(representation.getItemIndex()), String.valueOf(representation.getSize()), String.valueOf(representation.getExpandedSize()) }); SVNErrorManager.error(err, SVNLogType.FSFS); } return; } try { myTable.insert(new Object[] { representation.getSHA1HexDigest(), new Long(representation.getRevision()), new Long(representation.getItemIndex()), new Long(representation.getSize()), new Long(representation.getExpandedSize()) }); } catch (SqlJetException e) { SVNErrorManager.error(convertError(e), SVNLogType.FSFS); } }
public SVNCommitInfo closeEdit() throws SVNException { if (myTxn == null) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.REPOS_BAD_ARGS, "No valid transaction supplied to closeEdit()"); SVNErrorManager.error(err); } long committedRev = -1; SVNErrorMessage errorMessage = null; committedRev = finalizeCommit(); try { FSHooks.runPostCommitHook(myFSFS.getRepositoryRoot(), committedRev); } catch (SVNException svne) { errorMessage = SVNErrorMessage.create(SVNErrorCode.REPOS_POST_COMMIT_HOOK_FAILED, svne.getErrorMessage().getFullMessage(), SVNErrorMessage.TYPE_WARNING); } Map revProps = myFSFS.getRevisionProperties(committedRev); String dateProp = (String) revProps.get(SVNRevisionProperty.DATE); String authorProp = (String) revProps.get(SVNRevisionProperty.AUTHOR); Date datestamp = dateProp != null ? SVNTimeUtil.parseDateString(dateProp) : null; SVNCommitInfo info = new SVNCommitInfo(committedRev, authorProp, datestamp, errorMessage); releaseLocks(); myRepository.closeRepository(); return info; }
public void runHotCopy(FSFS srcOwner, File dstPath) throws SVNException { FSWriteLock dbLogsLock = FSWriteLock.getDBLogsLock(srcOwner, false); File srcPath = srcOwner.getRepositoryRoot(); synchronized (dbLogsLock) { try {
public void runHotCopy(FSFS srcOwner, File dstPath) throws SVNException { FSWriteLock dbLogsLock = FSWriteLock.getDBLogsLock(srcOwner, false); File srcPath = srcOwner.getRepositoryRoot(); synchronized (dbLogsLock) { try {
public void runHotCopy(FSFS srcOwner, File dstPath) throws SVNException { FSWriteLock dbLogsLock = FSWriteLock.getDBLogsLock(srcOwner, false); File srcPath = srcOwner.getRepositoryRoot(); synchronized (dbLogsLock) { try {
public long commitTxn(boolean runPreCommitHook, boolean runPostCommitHook, SVNErrorMessage[] postCommitHookError, StringBuffer conflictPath) throws SVNException { if (runPreCommitHook) { FSHooks.runPreCommitHook(myFSFS.getRepositoryRoot(), myTxn.getTxnId()); FSHooks.runPostCommitHook(myFSFS.getRepositoryRoot(), newRevision); } catch (SVNException svne) { SVNErrorMessage errorMessage = SVNErrorMessage.create(SVNErrorCode.REPOS_POST_COMMIT_HOOK_FAILED,
public long commitTxn(boolean runPreCommitHook, boolean runPostCommitHook, SVNErrorMessage[] postCommitHookError, StringBuffer conflictPath) throws SVNException { if (runPreCommitHook) { FSHooks.runPreCommitHook(myFSFS.getRepositoryRoot(), myTxn.getTxnId()); FSHooks.runPostCommitHook(myFSFS.getRepositoryRoot(), newRevision); } catch (SVNException svne) { SVNErrorMessage errorMessage = SVNErrorMessage.create(SVNErrorCode.REPOS_POST_COMMIT_HOOK_FAILED,
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()); }
commitEntry = new SVNLocationEntry(revNode.getId().getRevision(), revNode.getCreatedPath()); SVNLocationEntry copyrootEntry = findYoungestCopyroot(owner.getRepositoryRoot(), parentPath); SVNLocationEntry srcEntry = new SVNLocationEntry(FSRepository.SVN_INVALID_REVNUM, null); long dstRev = FSRepository.SVN_INVALID_REVNUM;
SVNLocationEntry copyrootEntry = findYoungestCopyroot(myFSFS.getRepositoryRoot(), parentPath); SVNLocationEntry srcEntry = new SVNLocationEntry(SVNRepository.INVALID_REVISION, null);
SVNLocationEntry copyrootEntry = findYoungestCopyroot(myFSFS.getRepositoryRoot(), parentPath); SVNLocationEntry srcEntry = new SVNLocationEntry(SVNRepository.INVALID_REVISION, null);