views:

1668

answers:

3

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

+4  A: 

Here is a trick for TortoiseSVN:

How to turn off “auto-merge” in Subversion

Trick for svn.exe:

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.

aku
+3  A: 

The best way around this is to educate the developers. After you do an update in TortoiseSVN it shows you a list of affected files. Simply double clicking each file will give you the diff between them. Then you'll be able to see what changed between your version and the latest repository version.

Mark Ingram
Before you notice any changes svn will gladly merge your files. Anyway it's a good idea to check what changed :-)
aku
+3  A: 

I would suggest you should learn to work with the natural Subversion model if at all possible. In practice we find conflicts are rare, and the type of logic conflict you talk about almost non-existent (I can't recall an instance in the last 4 years in our repository).

Team members should check-in changes on as small a scale as possible (whilst maintaining correctness) rather than batching up a whole days work to just check it in once. This will reduce the possibility of stepping on someone else's work.

If you are concerned about about a particular change you are making Subversion does provide a locking mechanism to let you prevent other changes to the file. See the Red Book chapters on locking.

Rob Walker