Reputation: 14952
Is there a tool for Subversion that can automatically notify me when changes are committed to certain files?
Upvotes: 2
Views: 3784
Reputation: 1694
If you are on Windows you might be looking for a simple System-Tray program such as SVN Notifier.
I tried it myself recently and found it quick and useful: easy to setup and no scripting required.
It can monitor individual files or whole directories in SVN.
Only problem I had was it relies on a checked out copy of the files/folders to monitor rather than just pointing to the repo directly. The latest version of SVN Notifier is integrated with TortoiseSVN 1.7 and the checked out copy must be done via Subversion 1.7. This was a problem for me as my project workspace is currently checked out within Eclipse IDE using an SVNKit connector that is Subversion 1.6 compatible. Consequently in order to use SVN Notifier I must either upgrade/replace the SVN connector in my IDE (which is not always possible) or checkout a second copy using Subversion 1.7 for the purposes of monitoring (which means maintaining two working copies instead of one).
Upvotes: 2
Reputation: 10687
You could create a post-commit hook script to "hook" on commits.
In the hook script, you would use the SVNLOOK utility to examine the changeset, see what has changed, and then if it meets your criteria, take some action.
Hook scripts (e.g. post-commit) are stored here:
\hooks\post-commit.bat
You would use SVNLOOK like:
svnlook changed -r%REV% %REPOS% | <find_or_grep> <filename>
and then write script code so that if the find/grep is successful, you take an action.
It's the same for Windows and Linux, just the syntax is a little different.
Upvotes: 3
Reputation: 181270
You need to write a hook for the commit operation. In that hook, you can do whatever you want (i.e. notifying when desired files changed).
Upvotes: 1