public static FSTransactionInfo beginTransaction(long baseRevision, int flags, FSFS owner) throws SVNException { FSTransactionInfo txn = createTxn(baseRevision, owner); String commitTime = SVNDate.formatDate(new Date(System.currentTimeMillis())); owner.setTransactionProperty(txn.getTxnId(), SVNRevisionProperty.DATE, SVNPropertyValue.create(commitTime)); if ((flags & SVN_FS_TXN_CHECK_OUT_OF_DATENESS) != 0) { owner.setTransactionProperty(txn.getTxnId(), SVNProperty.TXN_CHECK_OUT_OF_DATENESS, SVNPropertyValue.create(Boolean.TRUE.toString())); } if ((flags & FSTransactionRoot.SVN_FS_TXN_CHECK_LOCKS) != 0) { owner.setTransactionProperty(txn.getTxnId(), SVNProperty.TXN_CHECK_LOCKS, SVNPropertyValue.create(Boolean.TRUE.toString())); } 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 beginTransaction(long baseRevision, int flags, FSFS owner) throws SVNException { FSTransactionInfo txn = createTxn(baseRevision, owner); String commitTime = SVNDate.formatDate(new Date(System.currentTimeMillis())); owner.setTransactionProperty(txn.getTxnId(), SVNRevisionProperty.DATE, SVNPropertyValue.create(commitTime)); if ((flags & SVN_FS_TXN_CHECK_OUT_OF_DATENESS) != 0) { owner.setTransactionProperty(txn.getTxnId(), SVNProperty.TXN_CHECK_OUT_OF_DATENESS, SVNPropertyValue.create(Boolean.TRUE.toString())); } if ((flags & FSTransactionRoot.SVN_FS_TXN_CHECK_LOCKS) != 0) { owner.setTransactionProperty(txn.getTxnId(), SVNProperty.TXN_CHECK_LOCKS, SVNPropertyValue.create(Boolean.TRUE.toString())); } return txn; }
public static FSTransactionInfo beginTransaction(long baseRevision, int flags, FSFS owner) throws SVNException { FSTransactionInfo txn = createTxn(baseRevision, owner); String commitTime = SVNTimeUtil.formatDate(new Date(System.currentTimeMillis())); owner.setTransactionProperty(txn.getTxnId(), SVNRevisionProperty.DATE, commitTime); if ((flags & SVN_FS_TXN_CHECK_OUT_OF_DATENESS) != 0) { owner.setTransactionProperty(txn.getTxnId(), SVNProperty.TXN_CHECK_OUT_OF_DATENESS, SVNProperty.toString(true)); } if ((flags & FSTransactionRoot.SVN_FS_TXN_CHECK_LOCKS) != 0) { owner.setTransactionProperty(txn.getTxnId(), SVNProperty.TXN_CHECK_LOCKS, SVNProperty.toString(true)); } return txn; }
public static FSTransactionInfo beginTransaction(long baseRevision, int flags, FSFS owner) throws SVNException { FSTransactionInfo txn = createTxn(baseRevision, owner); String commitTime = SVNDate.formatDate(new Date(System.currentTimeMillis())); owner.setTransactionProperty(txn.getTxnId(), SVNRevisionProperty.DATE, SVNPropertyValue.create(commitTime)); if ((flags & SVN_FS_TXN_CHECK_OUT_OF_DATENESS) != 0) { owner.setTransactionProperty(txn.getTxnId(), SVNProperty.TXN_CHECK_OUT_OF_DATENESS, SVNPropertyValue.create(Boolean.TRUE.toString())); } if ((flags & FSTransactionRoot.SVN_FS_TXN_CHECK_LOCKS) != 0) { owner.setTransactionProperty(txn.getTxnId(), SVNProperty.TXN_CHECK_LOCKS, SVNPropertyValue.create(Boolean.TRUE.toString())); } return txn; }
public void setRevisionProperty(String propertyName, SVNPropertyValue propertyValue) throws SVNException { if (myCurrentRevisionBaton.myRevision > 0) { myFSFS.setTransactionProperty(myCurrentRevisionBaton.myTxn.getTxnId(), propertyName, propertyValue); if (SVNRevisionProperty.DATE.equals(propertyName)) { myCurrentRevisionBaton.myDatestamp = propertyValue; } } else if (myCurrentRevisionBaton.myRevision == 0) { long youngestRevision = myFSFS.getYoungestRevision(); if (youngestRevision == 0) { myFSFS.setRevisionProperty(0, propertyName, propertyValue); } } }
public FSTransactionRoot createTransactionRoot(FSTransactionInfo txn) throws SVNException { SVNProperties txnProps = getTransactionProperties(txn.getTxnId()); int flags = 0; if (txnProps.getStringValue(SVNProperty.TXN_CHECK_OUT_OF_DATENESS) != null) { flags |= FSTransactionRoot.SVN_FS_TXN_CHECK_OUT_OF_DATENESS; } if (txnProps.getStringValue(SVNProperty.TXN_CHECK_LOCKS) != null) { flags |= FSTransactionRoot.SVN_FS_TXN_CHECK_LOCKS; } return new FSTransactionRoot(this, txn.getTxnId(), txn.getBaseRevision(), flags); }
public void setRevisionProperty(String propertyName, SVNPropertyValue propertyValue) throws SVNException { if (myCurrentRevisionBaton.myRevision > 0) { myFSFS.setTransactionProperty(myCurrentRevisionBaton.myTxn.getTxnId(), propertyName, propertyValue); if (SVNRevisionProperty.DATE.equals(propertyName)) { myCurrentRevisionBaton.myDatestamp = propertyValue; } } else if (myCurrentRevisionBaton.myRevision == 0) { long youngestRevision = myFSFS.getYoungestRevision(); if (youngestRevision == 0) { myFSFS.setRevisionProperty(0, propertyName, propertyValue); } } }
public FSTransactionRoot createTransactionRoot(FSTransactionInfo txn) throws SVNException { SVNProperties txnProps = getTransactionProperties(txn.getTxnId()); int flags = 0; if (txnProps.getStringValue(SVNProperty.TXN_CHECK_OUT_OF_DATENESS) != null) { flags |= FSTransactionRoot.SVN_FS_TXN_CHECK_OUT_OF_DATENESS; } if (txnProps.getStringValue(SVNProperty.TXN_CHECK_LOCKS) != null) { flags |= FSTransactionRoot.SVN_FS_TXN_CHECK_LOCKS; } return new FSTransactionRoot(this, txn.getTxnId(), txn.getBaseRevision(), flags); }
public FSTransactionRoot createTransactionRoot(FSTransactionInfo txn) throws SVNException { SVNProperties txnProps = getTransactionProperties(txn.getTxnId()); int flags = 0; if (txnProps.getStringValue(SVNProperty.TXN_CHECK_OUT_OF_DATENESS) != null) { flags |= FSTransactionRoot.SVN_FS_TXN_CHECK_OUT_OF_DATENESS; } if (txnProps.getStringValue(SVNProperty.TXN_CHECK_LOCKS) != null) { flags |= FSTransactionRoot.SVN_FS_TXN_CHECK_LOCKS; } return new FSTransactionRoot(this, txn.getTxnId(), txn.getBaseRevision(), flags); }
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; }
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; }
private static FSTransactionInfo createTxn(long baseRevision, FSFS owner) throws SVNException { String txnID = createTxnDir(baseRevision, owner); FSTransactionInfo txn = new FSTransactionInfo(baseRevision, txnID); FSRevisionRoot root = owner.createRevisionRoot(baseRevision); FSRevisionNode rootNode = root.getRootRevisionNode(); owner.createNewTxnNodeRevisionFromRevision(txnID, rootNode); SVNFileUtil.createEmptyFile(new File(owner.getTransactionDir(txn.getTxnId()), FSFS.TXN_PATH_REV)); SVNFileUtil.createEmptyFile(new File(owner.getTransactionDir(txn.getTxnId()), "changes")); owner.writeNextIDs(txnID, "0", "0"); return txn; }
public static void attachAutoRevisionProperties(FSTransactionInfo txn, String path, FSFS fsfs) throws SVNException { String logMessage = "Autoversioning commit: a non-deltaV client made a change to\n" + path; SVNProperties props = new SVNProperties(); props.put(SVNRevisionProperty.LOG, logMessage); props.put(SVNRevisionProperty.AUTOVERSIONED, "*"); fsfs.changeTransactionProperties(txn.getTxnId(), props); }
public void openRoot(long revision) throws SVNException { long youngestRev = myFSFS.getYoungestRevision(); if (isTxnOwner) { myTxn = FSTransactionRoot.beginTransactionForCommit(youngestRev, myRevProps, myFSFS); } else { myFSFS.changeTransactionProperties(myTxn.getTxnId(), myRevProps); } myTxnRoot = myFSFS.createTransactionRoot(myTxn); myCommitter = new FSCommitter(myFSFS, myTxnRoot, myTxn, myLockTokens, getAuthor()); DirBaton dirBaton = new DirBaton(revision, myBasePath, false); myDirsStack.push(dirBaton); }
public void openRoot(long revision) throws SVNException { long youngestRev = myFSFS.getYoungestRevision(); if (isTxnOwner) { myTxn = FSTransactionRoot.beginTransactionForCommit(youngestRev, myRevProps, myFSFS); } else { myFSFS.changeTransactionProperties(myTxn.getTxnId(), myRevProps); } myTxnRoot = myFSFS.createTransactionRoot(myTxn); myCommitter = new FSCommitter(myFSFS, myTxnRoot, myTxn, myLockTokens, getAuthor()); DirBaton dirBaton = new DirBaton(revision, myBasePath, false); myDirsStack.push(dirBaton); }
public void openRoot(long revision) throws SVNException { long youngestRev = myFSFS.getYoungestRevision(); if (isTxnOwner) { myTxn = FSTransactionRoot.beginTransactionForCommit(youngestRev, myRevProps, myFSFS); } else { myFSFS.changeTransactionProperties(myTxn.getTxnId(), myRevProps); } myTxnRoot = myFSFS.createTransactionRoot(myTxn); myCommitter = new FSCommitter(myFSFS, myTxnRoot, myTxn, myLockTokens, getAuthor()); DirBaton dirBaton = new DirBaton(revision, myBasePath, false); myDirsStack.push(dirBaton); }
private void mergeChanges(FSRevisionNode ancestorNode, FSRevisionNode sourceNode, StringBuffer conflictPath) throws SVNException { String txnId = myTxn.getTxnId(); FSRevisionNode txnRootNode = myTxnRoot.getRootRevisionNode(); if (ancestorNode == null) { ancestorNode = myTxnRoot.getTxnBaseRootNode(); } if (txnRootNode.getId().equals(ancestorNode.getId())) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.UNKNOWN, "FATAL error: no changes in transaction to commit"); SVNErrorManager.error(err, SVNLogType.FSFS); } else { merge("/", txnRootNode, sourceNode, ancestorNode, txnId, conflictPath); } }