Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I turn off automatic merging in Subversion?

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...

like image 381
saw-lau Avatar asked Sep 10 '08 11:09

saw-lau


People also ask

What is a SVN Sync merge?

This basic syntax— svn merge URL —tells Subversion to merge all changes which have not been previously merged from the URL to the current working directory (which is typically the root of your working copy).

How do I merge two SVN revisions?

To merge a range of revisions, use svn merge -r start:end from to where start and end are revision IDs. This will merge all revisions starting at start+1 up to and INCLUDING end . Note: it will NOT include the first revision (ex: -r3:45 will merge 4 through 45).


2 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
    
like image 60
Nordic Mainframe Avatar answered Oct 24 '22 12:10

Nordic Mainframe


Here is a trick for TortoiseSVN:

How to turn off “auto-merge” in Subversion

Trick for svn.exe is to set svn external diff tool to a program that will constantly fail.

svn --diff-cmd=/bin/false

If external diff program fails, svn concludes that conflict is unresolvable and wouldn't merge it.

like image 40
aku Avatar answered Oct 24 '22 12:10

aku