How to use the SVN

Forum to talk about the development of SMPlayer (code, patches...).

How to use the SVN

Postby rvm » Thu Dec 24, 2009 12:50 am

I've just begun to use the SVN (seriously).

There'll still be package releases (tar.bz2) from time to time.

If you want to download from SVN, these are the instructions:

1) Installing

First be sure you have the package subversion installed (subversion, not svn! I spent a lot of time searching for a package called svn...) Windows users can download it from here (svn-1.4.5-setup.exe is ok).

Now create a directory where you're gonna store your "working copy" (~/svn or ~/smplayer-svn or whatever you like).

(For Windows users: "~" in linux means the home directory, you'll have to replace with another thing, "C:\" or "C:\Documents and Settings\User\My documents" or whatever)

2) Downloading for first time

Open a console (konsole, gnome-terminal...). In Windows open the command prompt or whatever it's called, you know, that black window where you can type DOS-like commands.

Go to the directory you just created.
Code: Select all
cd ~/smplayer-svn

Now type this command:
Code: Select all
svn co smplayer

You'll see something like this:
Code: Select all
A    smplayer/debian-rvm
A    smplayer/debian-rvm/control
A    smplayer/debian-rvm/emacsen-remove.ex
A    smplayer/debian-rvm/watch.ex
A    smplayer/icons/smplayer_icon32.png
A    smplayer/icons/smplayer_icon16.png
A    smplayer/Makefile
Revisión obtenida: 37

Ok, a subdirectory named smplayer has been created, with the sources. You can compile it as usual.

If you're interested in smplayer-themes too, you can download it this way:

Code: Select all
svn co smplayer-themes

That will create another subdirectory named smplayer-themes.

3) Updating

Now suppose that a day (or a week) has passed and you want to get the last revision. That's a lot easier.

Code: Select all
cd ~/smplayer-svn/smplayer/
svn update

That will synchronize your copy to the SVN, downloading only the files that have changed.

For smplayer-themes it would be similar:

Code: Select all
cd ~/smplayer-svn/smplayer-themes/
svn update

4) How to compile in Windows

Windows users will probably see that after compilation the version number that appears in the about dialog is wrong: 0.5.59+SVN-UNKNOWN

There's a program in the smplayer sources (getrev/getrev.exe) that is called before compilation which gets the current svn revision by calling svn info. So you have to have subversion (svn.exe) installed and it has to be in the path so it can be found.

Maybe the easiest way would be editing the file C:\Qt\4.3.1\bin\qtvars.bat and adding the line in bold:
@echo off
rem This file is generated

echo Setting up a MinGW/Qt only environment...
echo -- QTDIR set to C:\Qt\4.3.1
echo -- PATH set to C:\Qt\4.3.1\bin
echo -- Adding C:\MinGW\bin to PATH
echo -- Adding %SystemRoot%\System32 to PATH
echo -- QMAKESPEC set to win32-g++

set QTDIR=C:\Qt\4.3.1
set PATH=C:\Qt\4.3.1\bin
set PATH=%PATH%;C:\MinGW\bin
set PATH=%PATH%;%SystemRoot%\System32
set PATH=%PATH%;C:\Program Files\Subversion\bin
set QMAKESPEC=win32-g++

UPDATE: recent releases of smplayer doesn't require to have svn.exe in the path (or installed at all). The revision will be extracted from the .svn directory. Anyway the explanation above could be useful to use svn with the Qt console.

How to write to the SVN
Now a little explanation on how to upload your changes.

This could be very useful for translators or people making icon themes, as they can upload their changes directly to the SVN.

First of all you need to register in Then send to me by e-mail your sourceforge username, and I'll give your write permissions for the SVN.

Now I assume that you already know how to use the SVN to get the latest release and you already have your working copy in your computer.

Updating translations
For translators is very easy, just open your translation as usual in linguist and update your translation. Save it as usual.

Now to upload it to the SVN type something like this:
Code: Select all
svn commit -m "Updated my Klingon translation"

The first time you'll be asked for your sourceforge username and password. If everything's ok, your changes will be uploaded.

The message after -m specifies a message for the log, so other people could know what you changed.

You could also have done:
Code: Select all
svn commit

In that case an editor would open so you can enter your message there.

Updating icon themes
It's quite similar, but there's a complication: you need to tell svn the files (or directories) you add or remove.

So if you have added a new icon, you need to enter a command like this:
Code: Select all
svn add icon.png

You can also add a whole directory with svn add.

In case you want to remove a file (or directory) you have to tell svn to do it:
Code: Select all
svn delete icon.png

In the case you need to create a directory:
Code: Select all
svn mkdir themes/my_new_icon_theme

Once you are finished, you can submit your changes:
Code: Select all
svn commit -m "Updating my icon theme"

More detailed info about svn usage:
Site Admin
Posts: 2917
Joined: Wed Dec 23, 2009 1:25 am
Location: España

Return to Development

Who is online

Users browsing this forum: No registered users and 1 guest