| 32 | Breaking Someone Else’s Lock |
File locking is a consensual activity; it’s designed to save a team effort where more than one person might change an unmergeable file. Sometimes, though, someone might not play by the rules. If a team member locks a file and goes home for the night (or worse goes on vacation!), then no one else is able to lock and edit the file. Subversion allows us to forcibly break a lock or more commonly to steal a lock from someone else.
Stealing a lock is usually preferred, because the Subversion server will unlock the file and relock it for a different user all in one atomic operation. If instead we unlock the file and then try to relock it, there’s a small chance that another user can get in first and lock the file ahead ...