protected void handleNormalizedProperties(int normalizedRevPropsCount, int normalizedNodePropsCount) throws SVNException { if (myEventHandler != null && (normalizedRevPropsCount > 0 || normalizedNodePropsCount > 0)) { String message = MessageFormat.format("NOTE: Normalized {0}* properties to LF line endings ({1} rev-props, {2} node-props).", new Object[] { SVNProperty.SVN_PREFIX, String.valueOf(normalizedRevPropsCount), String.valueOf(normalizedNodePropsCount) }); SVNAdminEvent event = new SVNAdminEvent(SVNAdminEventAction.NORMALIZED_PROPERTIES, message); myEventHandler.handleAdminEvent(event, ISVNEventHandler.UNKNOWN); } }
protected void handleNormalizedProperties(int normalizedRevPropsCount, int normalizedNodePropsCount) throws SVNException { if (myEventHandler != null && (normalizedRevPropsCount > 0 || normalizedNodePropsCount > 0)) { String message = MessageFormat.format("NOTE: Normalized {0}* properties to LF line endings ({1} rev-props, {2} node-props).", new Object[] { SVNProperty.SVN_PREFIX, String.valueOf(normalizedRevPropsCount), String.valueOf(normalizedNodePropsCount) }); SVNAdminEvent event = new SVNAdminEvent(SVNAdminEventAction.NORMALIZED_PROPERTIES, message); myEventHandler.handleAdminEvent(event, ISVNEventHandler.UNKNOWN); } }
private void firePackEvent(long shard, boolean start) throws SVNException { if (myNotifyHandler != null) { SVNAdminEvent event = new SVNAdminEvent(start ? SVNAdminEventAction.PACK_START : SVNAdminEventAction.PACK_END, shard); myNotifyHandler.handleAdminEvent(event, ISVNEventHandler.UNKNOWN); } }
private void firePackEvent(long shard, boolean start) throws SVNException { if (myNotifyHandler != null) { SVNAdminEvent event = new SVNAdminEvent(start ? SVNAdminEventAction.PACK_START : SVNAdminEventAction.PACK_END, shard); myNotifyHandler.handleAdminEvent(event, ISVNEventHandler.UNKNOWN); } }
private void firePackEvent(long shard, boolean start) throws SVNException { if (myNotifyHandler != null) { SVNAdminEvent event = new SVNAdminEvent(start ? SVNAdminEventAction.PACK_START : SVNAdminEventAction.PACK_END, shard); myNotifyHandler.handleAdminEvent(event, ISVNEventHandler.UNKNOWN); } }
protected void handleNormalizedProperties(int normalizedRevPropsCount, int normalizedNodePropsCount) throws SVNException { if (myEventHandler != null && (normalizedRevPropsCount > 0 || normalizedNodePropsCount > 0)) { String message = MessageFormat.format("NOTE: Normalized {0}* properties to LF line endings ({1} rev-props, {2} node-props).", new Object[] { SVNProperty.SVN_PREFIX, String.valueOf(normalizedRevPropsCount), String.valueOf(normalizedNodePropsCount) }); SVNAdminEvent event = new SVNAdminEvent(SVNAdminEventAction.NORMALIZED_PROPERTIES, message); myEventHandler.handleAdminEvent(event, ISVNEventHandler.UNKNOWN); } }
protected void handlePropertesCopied(boolean foundSyncProps, long revision) throws SVNException { if (myEventHandler != null) { String message = null; if (foundSyncProps) { message = MessageFormat.format("Copied properties for revision {0} ({1}* properties skipped).", new Object[] { String.valueOf(revision), SVNProperty.SVN_SYNC_PREFIX }); } else { message = MessageFormat.format("Copied properties for revision {0}.", new Object[] { String.valueOf(revision) }); } SVNAdminEvent event = new SVNAdminEvent(revision, SVNAdminEventAction.REVISION_PROPERTIES_COPIED, message); myEventHandler.handleAdminEvent(event, ISVNEventHandler.UNKNOWN); } }
protected void handlePropertesCopied(boolean foundSyncProps, long revision) throws SVNException { if (myEventHandler != null) { String message = null; if (foundSyncProps) { message = MessageFormat.format("Copied properties for revision {0} ({1}* properties skipped).", new Object[] { String.valueOf(revision), SVNProperty.SVN_SYNC_PREFIX }); } else { message = MessageFormat.format("Copied properties for revision {0}.", new Object[] { String.valueOf(revision) }); } SVNAdminEvent event = new SVNAdminEvent(revision, SVNAdminEventAction.REVISION_PROPERTIES_COPIED, message); myEventHandler.handleAdminEvent(event, ISVNEventHandler.UNKNOWN); } }
protected void handlePropertesCopied(boolean foundSyncProps, long revision) throws SVNException { if (myEventHandler != null) { String message = null; if (foundSyncProps) { message = MessageFormat.format("Copied properties for revision {0} ({1}* properties skipped).", new Object[] { String.valueOf(revision), SVNProperty.SVN_SYNC_PREFIX }); } else { message = MessageFormat.format("Copied properties for revision {0}.", new Object[] { String.valueOf(revision) }); } SVNAdminEvent event = new SVNAdminEvent(revision, SVNAdminEventAction.REVISION_PROPERTIES_COPIED, message); myEventHandler.handleAdminEvent(event, ISVNEventHandler.UNKNOWN); } }
public void handleLock(String path, SVNLock lock, SVNErrorMessage error) throws SVNException { checkCancelled(); if (myEventHandler != null) { SVNAdminEvent event = new SVNAdminEvent(SVNAdminEventAction.LOCK_LISTED, lock, error, null); myEventHandler.handleAdminEvent(event, ISVNEventHandler.UNKNOWN); } } public void handleUnlock(String path, SVNLock lock, SVNErrorMessage error) throws SVNException {
public void handleLock(String path, SVNLock lock, SVNErrorMessage error) throws SVNException { checkCancelled(); if (myEventHandler != null) { SVNAdminEvent event = new SVNAdminEvent(SVNAdminEventAction.LOCK_LISTED, lock, error, null); myEventHandler.handleAdminEvent(event, ISVNEventHandler.UNKNOWN); } } public void handleUnlock(String path, SVNLock lock, SVNErrorMessage error) throws SVNException {
public void handleLock(String path, SVNLock lock, SVNErrorMessage error) throws SVNException { checkCancelled(); if (myEventHandler != null) { SVNAdminEvent event = new SVNAdminEvent(SVNAdminEventAction.LOCK_LISTED, lock, error, null); myEventHandler.handleAdminEvent(event, ISVNEventHandler.UNKNOWN); } } public void handleUnlock(String path, SVNLock lock, SVNErrorMessage error) throws SVNException {
File txnDir = (File) txns.get(txnName); if (myEventHandler != null) { SVNAdminEvent event = new SVNAdminEvent(txnName, txnDir, SVNAdminEventAction.TRANSACTION_LISTED); myEventHandler.handleAdminEvent(event, ISVNEventHandler.UNKNOWN);
public void openRevision(Map headers) throws SVNException { myCurrentRevisionBaton = new RevisionBaton(); long revision = -1; if (headers.containsKey(SVNAdminHelper.DUMPFILE_REVISION_NUMBER)) { try { revision = Long.parseLong((String) headers.get(SVNAdminHelper.DUMPFILE_REVISION_NUMBER)); } catch (NumberFormatException nfe) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.STREAM_MALFORMED_DATA, "Cannot parse revision ({0}) in dump file", headers.get(SVNAdminHelper.DUMPFILE_REVISION_NUMBER)); SVNErrorManager.error(err, SVNLogType.FSFS); } } myCurrentRevisionBaton.myRevision = revision; long headRevision = myFSFS.getYoungestRevision(); myCurrentRevisionBaton.myRevisionOffset = revision - (headRevision + 1); if (revision > 0) { myCurrentRevisionBaton.myTxn = FSTransactionRoot.beginTransaction(headRevision, 0, myFSFS); myCurrentRevisionBaton.myTxnRoot = myFSFS.createTransactionRoot(myCurrentRevisionBaton.myTxn); String message = "<<< Started new transaction, based on original revision " + revision; if (myProgressHandler != null) { SVNAdminEvent event = new SVNAdminEvent(revision, SVNAdminEventAction.REVISION_LOAD, message); myProgressHandler.handleAdminEvent(event, ISVNEventHandler.UNKNOWN); } } }
public void openRevision(Map headers) throws SVNException { myCurrentRevisionBaton = new RevisionBaton(); long revision = -1; if (headers.containsKey(SVNAdminHelper.DUMPFILE_REVISION_NUMBER)) { try { revision = Long.parseLong((String) headers.get(SVNAdminHelper.DUMPFILE_REVISION_NUMBER)); } catch (NumberFormatException nfe) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.STREAM_MALFORMED_DATA, "Cannot parse revision ({0}) in dump file", headers.get(SVNAdminHelper.DUMPFILE_REVISION_NUMBER)); SVNErrorManager.error(err, SVNLogType.FSFS); } } myCurrentRevisionBaton.myRevision = revision; long headRevision = myFSFS.getYoungestRevision(); myCurrentRevisionBaton.myRevisionOffset = revision - (headRevision + 1); if (revision > 0) { myCurrentRevisionBaton.myTxn = FSTransactionRoot.beginTransaction(headRevision, 0, myFSFS); myCurrentRevisionBaton.myTxnRoot = myFSFS.createTransactionRoot(myCurrentRevisionBaton.myTxn); String message = "<<< Started new transaction, based on original revision " + revision; if (myProgressHandler != null) { SVNAdminEvent event = new SVNAdminEvent(revision, SVNAdminEventAction.REVISION_LOAD, message); myProgressHandler.handleAdminEvent(event, ISVNEventHandler.UNKNOWN); } } }
public void openRevision(Map headers) throws SVNException { myCurrentRevisionBaton = new RevisionBaton(); long revision = -1; if (headers.containsKey(SVNAdminHelper.DUMPFILE_REVISION_NUMBER)) { try { revision = Long.parseLong((String) headers.get(SVNAdminHelper.DUMPFILE_REVISION_NUMBER)); } catch (NumberFormatException nfe) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.STREAM_MALFORMED_DATA, "Cannot parse revision ({0}) in dump file", headers.get(SVNAdminHelper.DUMPFILE_REVISION_NUMBER)); SVNErrorManager.error(err, SVNLogType.FSFS); } } myCurrentRevisionBaton.myRevision = revision; long headRevision = myFSFS.getYoungestRevision(); myCurrentRevisionBaton.myRevisionOffset = revision - (headRevision + 1); if (revision > 0) { myCurrentRevisionBaton.myTxn = FSTransactionRoot.beginTransaction(headRevision, 0, myFSFS); myCurrentRevisionBaton.myTxnRoot = myFSFS.createTransactionRoot(myCurrentRevisionBaton.myTxn); String message = "<<< Started new transaction, based on original revision " + revision; if (myProgressHandler != null) { SVNAdminEvent event = new SVNAdminEvent(revision, SVNAdminEventAction.REVISION_LOAD, message); myProgressHandler.handleAdminEvent(event, ISVNEventHandler.UNKNOWN); } } }
SVNAdminEvent event = new SVNAdminEvent(SVNAdminEventAction.RECOVERY_STARTED); myEventHandler.handleAdminEvent(event, ISVNEventHandler.UNKNOWN);
SVNAdminEvent event = new SVNAdminEvent(SVNAdminEventAction.RECOVERY_STARTED); myEventHandler.handleAdminEvent(event, ISVNEventHandler.UNKNOWN);
/** * Recovers the repository found under <code>repositoryRoot</code>. * This method can recover only FSFS type repositories and is identical to the <code>'svnadmin recover'</code> * command. * * <p/> * If the caller has {@link #setEventHandler(ISVNEventHandler) provided} an event handler, the handler will * receive an {@link SVNAdminEvent} with the {@link SVNAdminEventAction#RECOVERY_STARTED} action before * the recovery starts. * * @param repositoryRoot repository root location * @throws SVNException * @since 1.2.0, SVN 1.5.0 */ public void doRecover(File repositoryRoot) throws SVNException { FSFS fsfs = null; try { fsfs = SVNAdminHelper.openRepositoryForRecovery(repositoryRoot); if (myEventHandler != null) { SVNAdminEvent event = new SVNAdminEvent(SVNAdminEventAction.RECOVERY_STARTED); myEventHandler.handleAdminEvent(event, ISVNEventHandler.UNKNOWN); } FSRecoverer recoverer = new FSRecoverer(fsfs, this); recoverer.runRecovery(); } finally { if (fsfs != null) { fsfs.close(); } } }
SVNAdminEvent event = new SVNAdminEvent(rev, SVNAdminEventAction.REVISION_DUMPED, message); myEventHandler.handleAdminEvent(event, ISVNEventHandler.UNKNOWN);