public void safeRevertWorkingCopy ( ) { try { revertWorkingCopy ( ) ; } catch ( Exception e ) { debuggingLogger . log ( Level . FINE , "Failed to revert working copy" , e ) ; log ( "Failed to revert working copy: " + e . getLocalizedMessage ( ) ) ; Throwable cause = e . getCause ( ) ; if ( ! ( cause instanceof SVNException ) ) { return ; } SVNException svnException = ( SVNException ) cause ; if ( svnException . getErrorMessage ( ) . getErrorCode ( ) == SVNErrorCode . WC_LOCKED ) { // work space locked attempt cleanup and try to revert again try { cleanupWorkingCopy ( ) ; } catch ( Exception unlockException ) { debuggingLogger . log ( Level . FINE , "Failed to cleanup working copy" , e ) ; log ( "Failed to cleanup working copy: " + e . getLocalizedMessage ( ) ) ; return ; } try { revertWorkingCopy ( ) ; } catch ( Exception revertException ) { log ( "Failed to revert working copy on the 2nd attempt: " + e . getLocalizedMessage ( ) ) ; } } } }
Attempts to revert the working copy . In case of failure it just logs the error .