10.6: Create Services to interact with Subversion
Sep 22, '09 07:30:01AM
Contributed by: leenoble_uk
After hastily upgrading to Snow Leopard, I found myself without various tools I had grown used to. One such tool was the SCPlugin, which provided a contextual menu for many operations with Subversion repositories.
After reading that Finder contextual plugins are now no longer possible (in the Ars Technica Snow Leopard review), I gave up hope of an update being released. Services are seemingly the nearest equivalent. Fortunately, Automator now makes making your own services relatively easy. I confess to never having used Automator before today, so this may not be the best way, but it at least goes some way to restoring the functionality I lost.
These two workflows provide Update and Commit commands, which is all I find myself in desperate need of right now. To create both, launch Automator and select Service from the initial screen.
Update workflow (the easy one):
- Set the 'Service receives selected' drop-down menu to folders, and the 'in' drop-down menu to Finder.
- Drag the Utilities » Run Shell Script action into the work area. Set the 'Pass input' drop-down menu to as arguments. Set the script to cd "$@";svn update;.
- Save the new Service.
Commit workflow:
- Set the 'Service receives selected' drop-down menu to folders, and the 'in' drop-down menu to Finder.
- Utilities » Set value of variable: Name the variable dir.
- Text » Ask for Text: Set your Commit message here.
- Utilities » Set value of variable: Name the variable message.
- Utilities » Get value of variable: Get the value of the dir variable.
- Utilities » Run Shell Script: Set the 'Pass input' drop-down to as arguments. Set the script to cd "$2";svn commit -m "$1";
- Save the new Service.
I hope this will be enough to tide some Subversion users over until some clever developer comes along and provides a more complete solution.
[robg adds: I haven't tested this one.]
Comments (2)
Mac OS X Hints
http://hints.macworld.com/article.php?story=20090905150746685