1

I am building an application that will interact with the code of the developer (a release management app) (a meeting with my director is scheduled to decide if we'll go for an application or an eclipse plugin). So i need to know when the user (the developer on eclipse) make a commit (SVN) so the app can be be notified, recuperate the code (that is committed) and apply to it some operations. So my question is : is there a way to inject a script into SVN (or one of its properties) so it can notify my app that a commit has been done?

Cœur
  • 37,241
  • 25
  • 195
  • 267

2 Answers2

2

As ShiDoiSi pointed out, it can be done with a post-commit hook. A user with write access to file system where the subversion repository resides needs to install it, though. It can be done on any operating system.

Instead, you can do what continuous integration servers do: poll the revision of a specific project in the respository (or the whole repository itself) and then take action based on the results. Try the command svn log --xml or similar.

Tom Blodget
  • 20,260
  • 3
  • 39
  • 72
  • "user with write access" != "administrator"? ^__^ – bahrep Apr 03 '13 at 20:06
  • @bahrep. I could have said that but I was just being precise. It neither requires being a repository user nor being an OS administrator. Someone just needs to be able to write the script in the right file. – Tom Blodget Apr 04 '13 at 03:56
0

At first glance it looks like you want to reinvent Continuous integration (CI) or CommitMontior at least.

Nevertheless, if you have some special case and really need to develop Eclipse plugin or even a standalone application, Subversion hooks will help.

Apache Subversion has a capability to execute hook scripts on certain user actions. The paricular one you look for is a post-commit hook. Basically you need to write a post-commit executable that will, ehm, "notify" whatever you want to notify. Each time a user commits to a repository or a specific repository folder / trunk / branch / etc. your hook will run and do it's job.

It does not really matter whether you are on Windows or Linux BTW; however some reading and research is definitely required. I can advise you to start with SVNBook.

Community
  • 1
  • 1
bahrep
  • 29,961
  • 12
  • 103
  • 150