• Home
  • Subversion Hosting
  • Documents
  • Contact Us
  • Members Login

Sometimes You Just Need to Clean Up

When Subversion modifies your working copy (or any information within .svn), it tries to do so as safely as possible. Before changing the working copy, Subversion writes its intentions to a log file. Next it executes the commands in the log file to apply the requested change, holding a lock on the relevant part of the working copy while it worksв€”to prevent other Subversion clients from accessing the working copy in mid-change. Finally, Subversion removes the log file. Architecturally, this is similar to a journaled filesystem. If a Subversion operation is interrupted (if the process is killed, or if the machine crashes, for example), the log files remain on disk. By re-executing the log files, Subversion can complete the previously started operation, and your working copy can get itself back into a consistent state.

And this is exactly what svn cleanup does: it searches your working copy and runs any leftover logs, removing working copy locks in the process. If Subversion ever tells you that some part of your working copy is в€ślockedв€ť, then this is the command that you should run. Also, svn status will display an L next to locked items:

$ svn status
  L    somedir
M      somedir/foo.c

$ svn cleanup
$ svn status
M      somedir/foo.c

Don't confuse these working copy locks with the ordinary locks that Subversion users create when using the в€ślock-modify-unlockв€ť model of concurrent version control; see The three meanings of в€ślockв€ť for clarification.

All Plans Include

All plans free for 2008
Trac wiki linked to each repository
Online management tools
Access control lists (ALCs)
Read only or read write users
Secure HTTPS connections
Data mirrored onto backup servers
Disk usage reporting
Online invoices & payments
Unlimited support
Click for Free Subversion Hosting