Can I turn off automatic merging in Subversion?

By : saw-lau
Source: Stackoverflow.com
Question!

We're looking at moving from a check-out/edit/check-in style of version control system to Subversion, and during the evaluation we discovered that when you perform an Update action in TortoiseSVN (and presumably in any Subversion client?), if changes in the repository that need to be applied to files that you've been editing don't cause any conflicts then they'll be automatically/silently merged.

This scares us a little, as it's possible that this merge, while not producing any compile errors, could at least introduce some logic errors that may not be easily detected.

Very simple example: I'm working within a C# method changing some logic in the latter-part of the method, and somebody else changes the value that a variable gets initialised to at the start of the method. The other person's change isn't in the lines of code that I'm working on so there won't be a conflict; but it's possible to dramatically change the output of the method.

What we were hoping the situation would be is that if a merge needs to occur, then the two files would be shown and at least a simple accept/reject change option be presented, so that at least we're aware that something has changed and are given the option to see if it impacts our code.

Is there a way to do this with Subversion/TortoiseSVN? Or are we stuck in our present working ways too much and should just let it do it's thing...

By : saw-lau


Answers

It's in the FAQ: How can I prevent Subversion from doing automatic merges?

  1. In TortoiseSVN->Settings->General->Subversion configuration file, click on the edit button.
  2. Change the [helpers] section by adding

      diff-cmd = "C:\\false.bat"
    

    (note the double backslash)

  3. Create the file C:\false.bat which contains two lines

      @type %9
      @exit 1
    


This is why automated (unit) testing is a fundamental part of distributed software development. In the example you give, at least one unit test should fail on svn update and alert you to the error.

Remember what Subversion is: a version control system, not a perfectly-working-code-merging-tool.

By : APWorsley


Here is a trick for TortoiseSVN:

How to turn off



This video can help you solving your question :)
By: admin