Nautilus subversion integration tool. Execute SVN commands with Gnome scripts
I have been using subversion (svn) for years from the command line... But some months ago I changed my job and I started using windows environments. And I must admit TortoiseSVN is the best GUI SVN client i've seen ever before. While my needs are satisfied in Windows with TortoiseSVN and in Mac OS X with SCPlugin and SvnX, I was lacking a subversion tool to manage my files while exploring files in my Ubuntu (nautilus file explorer). That's why i decided to create my own set of scripts to integrate them on Nautilus contextual menu for a quick access without opening SVN programs or shell. I took the icons from the SVN Workbench since that is the client that I mostly use in Ubuntu and my eye finds the actions faster.
This is how it looks like




The following actions are supported by now:
- svn status
- svn update
- svn add
- svn commit
It takes no more than 5 minutes to implement, for example, the svn checkout. I leave it to you. I post this quickly because there is people around willing to test it. This is not tested anywhere other than in my own machine, but these are easy scripts, I don't think you cope any problems with them.
Installation
Requeriments, not much, really:
- nautilus-actions
sudo apt-get install nautilus-actions - Zenity (already shipped with your Ubuntu)
- Subversion of course,
sudo apt-get install subversion
Steps:
- Uncompress the TarGz in your home folder
- Execute nautilus-actions-config (or go to System -> Preferences -> Nautilus Actions Configuration )

- Import every file inside the schemas directory. I deleted the Schemas, since users were having trouble.
- Press "Add" in the Nautilus Actions, and fill the information as follows:
Label: Commit (Name you'll see in the menu)
Icon: ~/nautilus-actions/blah/blah/commit.png (Select the ICON you want to show in the menu)
Path: ~/nautilus-actions/blah/blah/commit.sh (Path to the commits.sh script)
Parameters: %M
- Go to Conditions tab and select Both in the "Appears if selection contains" section.

- Press OK and repeat for the rest of scripts.
- Logout your gnome session and log in again.
Download nautilus subversion integration tool (free)
UPDATE, 02 March 2009: Scripts and instructions modified for Ubuntu 8.10 Intrepid Ibex
Download (right click and save): Download nautilus-svn scripts
Possible problems and solutions
- The script doesn't launch: Check the scripts are executable (chmod 755), and launch them from the terminal to see errors.
- ¿Te gustó el post? »
- Vote it (9)
- Add to your favorites





Comments
Now seriously, keep up with the good work _netle_!
You can use the scripts in the tar.gz since they are bash scripts. In order to add them to te contextual menu add them in the Thunar menu file:
An example of what you have to paste would be:
<action>
<icon>~/path/to/icon</icon>
<name>Commit</name>
<command>bash ~/.nautilus-svn/scripts/commit.sh %f</command>
<description>Commit</description>
<patterns>*</patterns>
<directories /></action>
instal·lant-se ^^
Hi Hiran,
I corrected the reference. Thanks.
Thanks for the sweet tip!
Using Ubuntu as a work environment now that I have some decent SVN shell integration!
Hi
Did maguilar get this working with Thunar? I prefer thunar even though I'm in Ubuntu. In fact I prefer the entire XFCE4 Panel.
Thanks much,
Hey Simon,
the scritps work in any environment. Maybe Thunar has changed along time, but that should work for you.
Hey, I made a small modification to each .sh, so it now displays what happens as it happens, as opposed to when it finishes. It works now more like TortoiseSVN :)
add.sh:
#!/bin/bash
# Albert Lombarte <alombarte AT harecoded DOT com>
RESPONSE=`date "+%Y-%b-%d_add".txt`
if [ $? -eq 0 ] ; then
(
svn add "$@"
echo "end."
) |
zenity --text-info --title="Adding files to repository" --width=600 --height=400
#rm -f $RESPONSE
fi
commit.sh:
#!/bin/bash
# Albert Lombarte <alombarte AT harecoded DOT com>
RESPONSE=`date "+%Y-%b-%d_commit".txt`
#MESSAGE=`zenity --entry --title="Commiting svn changes" --text="Specify log message:" --width=500 2>&1`
MESSAGE=""
if [ $? -eq 0 ] ; then
(
echo "Commiting files:$@"
svn commit -m "$MESSAGE" "$@"
echo "end."
) |
zenity --text-info --title="SVN commit $1" --width=600 --height=400
#rm -f $RESPONSE
fi
status.sh:
#!/bin/bash
# Albert Lombarte <alombarte AT harecoded DOT com>
RESPONSE=`date "+%Y-%b-%d".txt`
if [ $? -eq 0 ] ; then
(
svn status "$@"
echo "end."
) |
zenity --text-info --title="Checking status..." --width=600 --height=400
#rm -f $RESPONSE
fi
update.sh:
#!/bin/bash
# Albert Lombarte <alombarte AT harecoded DOT com>
RESPONSE=`date "+%Y-%b-%d_update".txt`
if [ $? -eq 0 ] ; then
(
echo "Updating $@"
svn update "$@"
echo "end."
) |
zenity --text-info --title="Updating resource to latest revision" --width=600 --height=400
#rm -f $RESPONSE
fi
Cheers!
Thank you Camilo!
I've added the capture of the messages to the scripts. Now your change is included in the download.
Gracias Albert! Llevaba mucho tiempo buscando sustituto para Tortoise. L e echaré un ojo al código a ver si puedo aportar mi granito. ¿Por qué no abres un proyecto Sourceforge o algo así? ¿Has pensado en los iconos superpuestos como hace Tortoise? ¿Sería posible con shell scripts? Quizá con Python no sea muy complicado, incluso se podrían utilizar estos mismos shell scripts.
Have a look at: http://code.google.com/p/nautilussvn
This is a "real" project ;)
> Have a look at: http://code.google.com/p/nautilussvn
Is this better though?
Hi Peter,
Yes use Nautilussvn instead. I put here those scripts long time ago, but Nautilussvn is the way to go.
First off - thanks for your tutorial and code! I have downloaded the scripts, and installation seems to have worked out fine. However, I maybe missing a huge chunk of info here, and wonder if you can advise: How / where do I define my repository, where my files should be checked out from? On Windows Tortoise, it's also set within the right-click menu. Sorry if this seems to be a silly one, I am a recent "Windows-refugee", still learning the ropes on Linux.
Many thanks in advance,
michal