问题
On the project I'm working on, we have a file with svn:needs-lock that's frequently in contention. We frequently have to IM each other "let me know when you're done with X". If it's not really urgent, I would prefer not to interrupt my coworker if I don't have to.
Is there a util out there that will create a background process which will poll svn and pop a dialog or a system tray notification when the lock is released?
I'm on Windows and using TortoiseSVN, but even a python script that I could run in a command window would be better than nothing.
回答1:
SVN has hook scripts that can execute on lock/unlock events (read the SVN book). You could add an e-mail/IM notification command to one of these scripts.
Commit Monitor is also good for this kind of thing. http://tools.tortoisesvn.net/CommitMonitor
回答2:
Take a look on this Advanced Locking with SVN page. It describes techniques to determine the status of a file (Specifically look at the Discovering Locks section.) You could use that information to write a small program to "poll" the status and determine when the file has been locked/unlocked. Since you know the files that have the svn:needs-lock property, this ought to be pretty easy.
来源:https://stackoverflow.com/questions/1379472/is-there-a-way-to-automatically-poll-svn-for-a-released-lock