svntortoisesvnsvnserve

SVN option/plugin that won't allow commit if files contain certain string


I'm looking for SVN option or plugin that will not allow commit if files contain certain string (like System.out.println).

Is there any possibility that such thing exists? May be client or server sided.

Thanks, Piotr


Solution

  • Sure.

    You can use pre-commit hooks on your svn server.

    http://svnbook.red-bean.com/en/1.8/svn.ref.reposhooks.pre-commit.html

    The pre-commit hook is run just before a commit transaction is promoted to a new revision. Typically, this hook is used to protect against commits that are disallowed due to content or location (e.g., your site might require that all commits to a certain branch include a ticket number from the bug tracker, or that the incoming log message is nonempty).

    Alternatively you can create pre-commit hooks in your TortoiseSVN client as well.

    http://tortoisesvn.net/docs/nightly/TortoiseSVN_en/tsvn-dug-settings.html