This document is a draft; presumably it will move to the handbook if and when it is finalized.
These are best practices for using Subversion from the perspective of the MAP team.They do not have to be your practices if you have a reason not to use them.
The history of a project can be a valuable tool for understanding how a bug was introduced, how a bug was fixed, or why code is the way it is. The more coherent and organized the project history, the more valuable the history will be in this respect. Even if you are the only developer on a project, others may be looking at the history of your code in the future. If you use Subversion merely as a snapshot mechanism without organizing and documenting the code's history, they won't get much out of it.
The downside: one change per commit will tend to slow down development. If in the process of making a change, you notice something else wrong in a file you are working on, you won't be able to just fix it "while you are there" without compromising the unity of your commit; you'll have to instead make a note and come back to it later. If you aren't able to finish a commit before moving on to a different task for some reason, you may have to stash away the changes (perhaps committing them to a short-lived branch) and revert them in order to work on the next task.
Like CVS, Subversion allows you to check out subdirectories of a repository, making it easy to have sub-projects. It can be tempting to have one big repository for an organizational unit with many independent sub-projects, but we advise against this practice. If two units of code will not be branched, released, and deployed together, they should typically not live in the same repository. Even if the two code bases share a dependency such as a library, you can use infrastructure such as Maven to handle the code sharing rather than piling it all into one repository. Reasons to use separate repositories include:
Now for the caveats:
This is a standard Subversion convention. Some tools may be better able to visualize your repository if you follow this convention, and other developers will have an easier time understanding your code if you follow it.
Particularly in Java projects using Ant, it can be common to check in third-party .class and .jar files which are needed to build the source code for a project. This practice can greatly expand the size of your repository (with consequences for checkouts) and can make it more difficult to identify the actual project code when browsing the repository. It can also lead to version skew due to the work required to update third-party dependencies. It is better to use Maven or a similar tool to manage third-party dependencies if possible.
Generally speaking, if file Z is automatically created from files X and Y, don't check it in. Use your build process to create it when necessary. Storing generated files in your repository obscures your project's history and invites version skew (where the sources change and the generated object does not, or vice versa).