Situation
One of the translators involved in a team translation project using a very cool OmegaT Team project feature gets a message about the project being locked.
Problem
The translator’s connectivity is rather limited and re-downloading the whole project would be very undesirable. There’s also no SVN software installed on her computer (other than OmegaT itself). Otherwise the quickest solution would be either getting OmegaT to download the project anew into an empty folder, or run “svn cleanup” on the project’s folder using one of the available SVN tools. Bad luck this time.
Solution
Since OmegaT can act as a SVN client itself (that’s what it does when a Team project is loaded), and there’s a cool scripting functionality, why not just exploit OmegaT to do the cleanup on any folder of our choice? So, here’s the script (the heading is also a link):
- svn_cleanup_selected.groovy
/* * Perform SVN cleanup on any local SVN repository * * @author Yu Tang * @author Kos Ivatsov * @date 2014-01-17 * @version 0.2 */ import javax.swing.JFileChooser import org.omegat.core.team.SVNRemoteRepository import org.tmatesoft.svn.core.wc.* def folder if (project.isProjectLoaded()) { def prop = project.getProjectProperties() folder = new File(prop.getProjectRoot()) }else{ JFileChooser fc = new JFileChooser( dialogTitle: "Choose SVN repository to perform cleanup", fileSelectionMode: JFileChooser.DIRECTORIES_ONLY, multiSelectionEnabled: false ) if(fc.showOpenDialog() != JFileChooser.APPROVE_OPTION) { console.println "Canceled" return } folder = new File(fc.getSelectedFile().toString()) } if (SVNRemoteRepository.isSVNDirectory(folder)) { def clientManager = SVNClientManager.newInstance() clientManager.getWCClient().doCleanup(folder) console.println("Cleanup done!!") } return
If that pesky message pops up, it should usually suffice to fire up the script (it works even if no project is currently loaded, otherwise it cleans up the current project if it happens to be a Team project), browse to the problematic project folder and get “Cleanup done!!” message in the Scripting console. After that, the project should open without problems.
After the fix there might be a problem with sync, and OmegaT may throw a message like this:
but that is usually easily fixed with Ctrl+S (Save) or F5 (Reload).
I wish you all good and stable Internet connection, responsive and responsible team members and a glitch-less work-flow.
But as of now,
Good luck
UPDATE:
The script is now bundled with OmegaT, you’ll get it along with the program. No need to download it from the links posted here.