We have seen how Subversion allows us to keep our code under control as we develop; now we will see how we can use it to develop safely.
Consider this series of events: we spend a few days perfecting new reporting functionality for our application, but it depends on an already existing function. While we are writing our code another developer changes the way the function works, which causes our code to break, and checks that in. We then check our code in, without realizing that it no longer works. The end result? The code in trunk
is broken. This is a situation we should strive to avoid—ideally the code in trunk
should always work (undiscovered/unresolved bugs not withstanding).
So how do we develop things and get the benefits of Subversion if we can't check in incomplete code? The answer is by using branches.