views:

215

answers:

3

Please, help me with hook script on server which set svn:mime-type to application/octet-stream on all new and existing files automatically on each commit from working copy to repository. (I need it to prevent subversion auto merge files on conflict.)

My platform is Windows.

A: 

An alternative solution would be to use autoprops:

http://svnbook.red-bean.com/nightly/en/svn.advanced.props.html#svn.advanced.props.auto

Randy Proctor
maybe i`m wrong, but autoprops are in subversion config on client side, so if someone commits files from pc with different config, mime-type will not be set
Cicik
That is correct.
Randy Proctor
+2  A: 

You're using the wrong way to achieve this. Instead, configure a dummy diff tool in your Subversion config file. That dummy diff tool must do nothing but return 1 to indicate that it can't do the merge.

Here's a post explaining more detailed what to do.

But you have to ask yourself if Subversion is the right tool for you or if you should change your workflow. Preventing merging goes against the basic principle of almost any version control system I know of. Hacking something like this into them will never work reliably. So ask yourself why you need this and if it might be better to adjust your work flow.

Stefan
but it`s still client side solution, i want server side solution(on PC with different config, subversion automerge conflict, and i don`t want this). Is there some server side solution?
Cicik
Sorry, but no, there's no server side solution for this.
Stefan
merging is OK, i don`t have problem with it, but i want to do MANUAL MERGE(see where is conflict, consult conflict with responsible developer, and then merge). maybe i`m wrong but i test automatic subversion merge and it sometimes do thinks which i don`t like.
Cicik
exactly this scenario i can do on files with mime-type set to application/octet-stream
Cicik
@Stefan: +1, excellent advice!
Eli Acherkan
A: 

So,finally we use autoprops(mime-type set to application/octet-stream) on all clients and it looks good. When conflict occurs svn do not auto merge files and we can merge files manually. It is exactly what we want. by the way, what are other impacts of setting this property?

Cicik