Why doesn't the $Revision$ keyword expand to the file's current revision, instead of the file's last-changed revision?

Subversion increments the revision number of the repository as a whole; it can't expand any keyword to be that number. To do this would require to search and possibly modify every file in your working copy on every update and commit.

The information you want (the revision of your working copy) is available from the command svnversion; it gives you information on the revision level of a working copy given a path (see svnversion - help for details). You can incorporate it into your build or release process to get the information you need into the source itself. For example, in a build environment based on GNU make, add something like this to your Makefile: SVNDEF := -D'SVN_REV="$(shell svnversion -n.)"' CFLAGS := $(SVNDEF)... continue with your other flags... (Note that this will not work on non-GNU versions of make. Don't use it if your build process needs to be portable.) Or try this recipe: svn_version.c: FORCE * echo -n 'const char* svn_version(void) { const char* SVN_Version = "' \ o > svn_version.c svnversion -n. >> svn_version.c echo '"; return SVN_Version; }' >> svn_version.c

Windows users may want to use SubWCRev.exe, available from the TortoiseSVN download page; it replaces all $WCREV$ tags in a given file with the current working copy revision.