Locking

Locking a file provides exclusive rights to a user for changing that file in the repository. As long as the file in the repository is locked by a user, no other user can change (commit) that file in the repository. This helps to avoid conflicting commits.

Subversion provides a property svn:needs-lock. This property can be set on files only. The svn:needs-lock property sets the file to read-only when checked out. A user who has checked out the file will have to lock the file to modify it in the working copy. If another user wants to modify the same file, they will have to first acquire the lock on the same file and is informed that the file is already locked by another user. In this way a locked file cannot be modified simultaneously which avoids possible conflicts.