Add test and fix for building from working copy with local changes.
This also fixes the bug where a build from SVN URL without -r parameter would yield RPM Revision 0