Archive for January 2009
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.
Eclipse project missing java builder
Description: Eclipse can not build the project, because project is missing default builder. It happens most of the time when checking out project from SVN or CVS.
Solution: You need to add the default Java builder into .project file.
Verify that following lines are present in .project file of the eclipse project. If it is not present in the file, copy it from here and save the file.
Adding default Java builder
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
That’s it! select the Java builder from project propertiese > builder, clean and build the project again. you should be able to build the project now.