Subversion is pretty smart about merging changes. But what happens if two people make incompatible changes to the same part of the file at the same time?
Let's demonstrate. We'll update both working copies to the most recent revision, then make different changes to each copy of Combinatorics.java, but on the same line. We update/commit one copy, and it's fine. But when we update/commit the second copy, we get a conflict warning!
We have to resolve this conflict before we can commit our changes. To help us, SVN has left us lots of notes:
If we open Combinatorics.java in an editor, we can see the conflict markers. Let's resolve the conflict, save the file, and commit.
But the commit fails! We have to tell SVN that we've resolved the
conflict:
SVN's notion of conflicts only goes so far, though. It doesn't know anything about what the contents of the file mean; it only knows which lines have changed. So, let's have our first programmer edit Combinatorics.java to change the type of the fact method to use an accumulator; it now takes two arguments.
While we're doing this, our second developer decides to add a new function, perms, that computes ; this will of course use fact. Since we're working from an old version, we give it a single argument. When we update, SVN doesn't tell us anything about a conflict, even though the resulting code clearly won't compile.
So, here's the process: