Your best option is to perform a check at the server via a pre-commit
hook script. Inspect the content coming in; if any JS file contains uncommented console.logs()
statements (or any instances of console.logs()
, period), reject the commit & inform the user why.
You may have to maintain a working copy on the server to apply the diffs to, to perform this check properly.
If you try to do any checking at the client end, you will have to configure each client separately and trust that users only use the client that you've configured. Assuming you have any SVN clients that offer this functionality (I'm only aware of TortoiseSVN allowing for anything remotely like this).
Your Subversion client and server should never automatically "purge" lines as you suggest in that last paragraph. You'll inevitably lose content you don't want to lose, and break your builds.