When I do a Svn up in a file with a local modification that can produce a conflict.
Is it possible to cancel svn update with a hook and write a message?
Thanks
|
When I do a Svn up in a file with a local modification that can produce a conflict. Is it possible to cancel svn update with a hook and write a message? Thanks |
|||||
|
|
If you just want to ignore any changes that would cause a particular file to be conflicted, then you probably want http://svnbook.red-bean.com/en/1.5/svn.tour.cycle.html#svn.tour.cycle.resolve If you want to decide whether a change to any file would cause a conflict, use |
|||
|
|
|
I don't think you'll be able to do it server side. However, as of version 1.5, TortoiseSVN supports client-side hooks, including pre-update and post-update. I'm not sure if any other clients do. That, in combination with
and some scripting, may let you do what you want. According to the documentation, svn status --show-updates --verbose will give you a status list like this example:
If I understand this correctly, any time you see M (for Modified locally) and * (changed in the repository) for the same file, you're going to have a conflict. So all you should need to do is parse that output and abort the update if it looks like you'll have a conflict. Hope that helps. |
|||
|
|
|
You will want a pre-commit hook, in your svn repository directory there is a hooks directory, containing something like pre-commit.bat (on windows, or pre-commit.sh). SVN will execute this before you commit, so just replace this with a script you wish to run and you will be able to halt the commit to SVN. |
|||||||||||
|