SVN commit failed: Property “svn:needs-lock” needed

Error description: Can not commit binary files into SVN repository.

Error message:
A repository hook failed
svn: Commit failed (details follow):
svn: MERGE request failed on 'XYZ'
svn: Commit blocked by pre-commit hook (exit code 2) with output:
ERROR: Commit failed for the following reasons:
Property "svn:needs-lock" needed for file "xyz binary file".
Must match regex '.*'.

Look at http://subversion.tigris.org/faq.html#binary-files to see how does subversion handles binary files.

When a file consists of binary data, it’s often difficult or impossible to merge two sets of changes made in parallel by different users. For this reason, Subversion 1.2 and later offers a feature known as locking, often known as “reserved checkouts” in other version control systems.

Once a file is locked by an user, another user can not commit it.

svn:needs-lock property
If the property is attached to a file (the value is irrelevant), then the file will have read-only permissions. When the user locks the file and receives a lock token, the file becomes read-write. When the lock is released—either explicitly unlocked, or released via commit—the file returns to read-only again.

Binary files must have this property, otherwise it can not be committed. the value of this property is irrelevant.

Look at http://svnbook.red-bean.com/en/1.2/svn.advanced.locking.html it explains SVN locking model

Solution
Add the svn:needs-lock property to the file in question. The SVN property can be set using SVN client like tortoise or using SVN propset sub command from command prompt.

svn propset svn:needs-lock '*' file name

For more information on SVN properties, look at http://svnbook.red-bean.com/en/1.4/svn.advanced.props.html

That’s it, try to commit it.