Some version control systems use a revision number for each file. Subversion uses a single revision number for the entire repository. When you do a commit, you can have Subversion commit the changes you made to a single file, multiple files, or even every file that has been changed since your last checkout (see the documentation for svn add
, svn revert
, and svn commit
). Subversion treats the commit as an atomic transaction; that is, no matter how many or how few files you commit, all of them are committed in a single operation that either completely succeeds or completely fails (in which case the repository is not modified). Every time you issue a commit command, the revision number for the entire repository increments.
Subversion doesn't know whether or not your code compiles, so there isn't anything preventing you from checking in bad code. You can use Subversion to store any type of file, not just source code, so Subversion doesn't try to verify the functionality of anything you check in (since attempting to "build" a repository full of text files wouldn't make sense and since there is no reliable way for the server to guess your build system or how to compile your code). That being said, it is possible to tell the Subversion server to run a script whenever a commit is attempted but before the transaction is processed (called a pre-commit hook). Some people use this feature with a script that attempts to build the source code (including the incoming changes). If the script is unable to build the source, it returns an error and Subversion refuses the transaction (on your end, you would see the commit operation fail). Auto-building source code is not something that is built into Subversion by default, but it is not too difficult to add if it is something you are interested in.
For more information, I highly recommend reading through the (free) official Subversion book "Version Control with Subversion". It's an easy read, contains almost everything you would ever want to know about Subversion, and has lots of examples.