Development installation

WARNING: Only follow these instructions if you actually want to hack on RabbitVCS, otherwise stick to standard installation. If you are an end-user please do not follow these instructions.

It's a good idea organize your code in the following way, this makes it easy to switch between branches and whatnot without fiddling too much.

Directory structure

Development
|-- rabbitvcs
|   |-- trunk       
|   |-- current     # Symbolic link to whatever you're currently working on
|   |-- extension   # Folder that contains a link to the Nautilus extension
|   `-- branches
`-- python          # This will be included in the PYTHONPATH

You'll notice later that setting up your development directory like this will make it easy to switch between branches, you simply have to change the directory current is pointing to (as long as the branch structure doesn't deviate too much).

Checking out RabbitVCS

svn checkout http://rabbitvcs.googlecode.com/svn/trunk ~/Development/rabbitvcs/trunk

Setting up the directory structure

# Make current point to trunk
ln -s ~/Development/rabbitvcs/trunk ~/Development/rabbitvcs/current
 
# Make a handy shortcut to the Nautilus extension
mkdir -p ~/Development/rabbitvcs/extension
(cd ~/Development/rabbitvcs/extension && ln -s ../current/rabbitvcs/clients/nautilus/RabbitVCS.py)
 
# Link to the Nautilus extension from the proper directory
mkdir -p ~/.nautilus/python-extensions 
ln -s ~/Development/rabbitvcs/extension/RabbitVCS.py ~/.nautilus/python-extensions
 
# Setup the icon directory
mkdir -p ~/.icons
ln -s ~/Development/rabbitvcs/current/rabbitvcs/data/icons/hicolor ~/.icons/

Setting up a local PYTHONPATH

mkdir -p ~/Development/python 
ln -s ~/Development/rabbitvcs/current/rabbitvcs ~/Development/python/rabbitvcs

Change ~/.profile to include the line:

export PYTHONPATH="/home/$USER/Development/python"

And parse this file in your ~/.bashrc so this environment variable is also available to Bash (note that ~/.profile needs to executable):

# Source .profile
if [ -f ~/.profile ]; then
  . ~/.profile
fi

Placing it in ~/.profile is needed because your GNOME session isn't started from a shell, so ~/.bashrc etc. is not parsed. You'll have to restart your session (logout/login) for the changes to take effect. Or you can load the extension immediately using (it won't be available to any programs not started from the shell though):

export PYTHONPATH="$PYTHONPATH:/home/$USER/Development/python/"
[run nautilus now]

Running for Debugging

Firstly, you need to terminate Nautilus itself and the status checker service…

nautilus -q ; pgrep -f service.py | xargs kill

…and then start it up:

nautilus --no-desktop . ; pgrep -f service.py | xargs kill

I recommend either logging to console (set in the settings menu for NautilusSVN), or my preference: running

tail -n 0 -f ~/.config/rabbitvcs/RabbitVCS.log

…in a separate nice, wide console.

When you're done, just run

nohup nautilus > /dev/null &

…and you can close the terminal.

A Useful Script

Set logging to “file”, level “debug”. Copy this into a script called something like “rvcs-test” and run it. It'll do everything I mentioned above.

#!/bin/bash
export DESKTOP_AUTOSTART_ID=
gnome-terminal --geometry 172x20 -x sh -c "tail -n 0 -f ~/.config/rabbitvcs/RabbitVCS.log" &
nautilus -q
pgrep -f service.py | xargs kill
nautilus --no-desktop .
pgrep -f service.py | xargs kill

Discussion

Gábor Pápai, 2009/12/19 12:32

small correction:

not everyone's username is Bruce ;)

so instead of using ”/home/bruce” I suggest use ”~/” in the paths

Bruce van der Kooij, 2010/01/17 16:07

Using ~ in PYTHONPATH doesn't work because Python will not expand it. However, /home/$USER/Development/python does work because Bash will expand $USER when exporting the variable so I changed it to that.

Thanks.

Alexander Osipenko, 2010/02/08 23:11

bash provides special variable for user home directory: $HOME

Portable definition should be:
export PYTHONPATH=“$HOME/Development/python”

Enter your comment
MNAJF