views:

163

answers:

3

I'm wondering if the need to alter the indentation of code to adjust the nesting has any adverse effects on merging changes in a system like SVN.

This is a really open ended question. I'm sort of fishing for information/anecdotes here.

Edit: Thanks all! I'd accept an answer but which one? I up moded them all.

+2  A: 

I've used python with SVN and Mercurial, and have no hassles merging.

It all depends on how the diffing is done - and I suspect that it is character-by-character, which would notice the difference between one level of indent and another.

Matthew Schinckel
This is what I'm looking for, thanks
BCS
A really good merge would notice an edit on one side and a tab in on the other and do both...
BCS
+1  A: 

Generally source control systems merge on a line-by-line basis by default. I have found that merging Python code is no different from merging any other source code that is reasonably indented. If one programmer wraps a block of code in an if statement (indenting the whole block), and another programmer modifies something inside the block, then there will be a merge conflict. Fortunately, the conflict in this case is super easy to resolve.

If you use an external merge tool, then your tool may support more detailed textual merging algorithms that take the above scenario into account automatically.

Greg Hewgill
+1  A: 

It works fine so long as everyone on the project has agreed to use the same whitespace style (spaces or tabs).

But I've seen cases where a developer has converted an entire file from spaces to tabs (I think Eclipse had that as a feature, bound to Ctrl+Tab!), which makes spotting diffs near impossible.

rodbegbie