File Exchange

image thumbnail

Subversion Interface for Matlab

version 1.0 (2.49 KB) by

Use the Subversion version control system in Matlab



View License

The summary basically says it all. This lets you use Subversion with Matlab. I didn't see any other implementation on this, so I wrote this simple version for my group. Put this file in the ../toolbox/matlab/verctrl/ directory, overwriting the existing file there with the same name. Then go to matlab preferences, click on source control, and change it to "custom." Now in a matlab editor, you can use the menu items under File-Source Control.

Subversion doesn't use the "lock" concept, so that isn't implemented here. I also didn't implement the "undo checkout" feature. However, Zheng Li implemented that feature, and it is included in the "customverctr.m" file. My old version is "customverctr_noundo.m".

Improvements or comments are welcome.

Comments and Ratings (22)

Shalin Mehta

On Mac OS X, one needs to search and replace /sw by /usr. Else, works like a charm.


If you need a hassle-free Windows solution, The "TAM TAM SVN SCC" plug-in works without a hitch. I downloaded it, and it self-installed. It shows up on the Preferences/Source Control option and accessed my Subversion host db without a hitch. It allows a free, apparently unlimited trial, but it's only $19.95 for a single-seat license.

Here's the link:


Amy (view profile)

@Pascal Schulthess - You probably need to use the command 'add' instead of 'checkin'.

I haven't used subversion before, so this might be an easy question for you. I just installed subversion and your script and it seems to work fine. But I get a "some_file is not a working copy" message if I want to check in some_file. What am I doing wrong?


PushOK is a Russian company, and the PushOK wrapper solution requires a "trial license", but the cost isn't stated. Some of us would like to have known this! I think the original question remains - how can we use the provided solution on Windows???


Eric (view profile)

Very useful, though I second Dave's suggestion that the path be moved to a user defined variable - even on OSX there are numerous distributions of svn that use their own default paths.

dave matthews

thanks, works on mac os 10.4.11 after changing the svn path.

perhaps you could create a variable svnPath = 'sw/bin/svn' which can be modified just once at the top of the function so users don't have to dig through the code.

Thierry Dalon

According to TMW support

For windows you don't need install this file customverctr but only the plugin here:

For other OS you need to install a customvecctr file.

N Shah

Where can I find the "Zheng Li" version referenced in the comments?

Jesper Mariegaard

Works fine under Linux... see Zheng Lis comments.

Mister Chan

Hum Gaaa Chaan!!!

Andrea Tagliasacchi

What about OsX??
I had to go down in the script and change by hand the path of the svn binary to:
Seems to be working though...

Felix Hebeler

Ok, I revised the script and set up svn so that the code basically works when executed step by step, e.g. using F9. Get svn to work from the commandline using ssh first:

The only problem remaining is that the preference dialog in Matlab doesnt allow to use a custom version control, no matter what.

To the author: please update the file and give the OS it works with. That is _not_ under windows. Works under Linux for me though...

Goran christiansson

Please provide information on how to register subversion control software into Matlab on a Windows machine.
The com-control only allows choosing SourceSafe, which is not what we want to use for our projects.

How can we use svn?

Juan Romero

Hi, Anyone could to make it works under windows ???
Please any help?

Thanks in advances
Juan Romero

Zheng Li

Works on linux after editing the paths and dos to system.

stephane roy

Works with R14SP1 on OSX. Had to replace the path to svn (mine is in /usr/local/bin, not /sw/bin).

Stephen Larson

Trying this on windows, Matlab 7.01. Doesn't seem to allow me to choose 'custom' from the source control preferences once I've placed the file in /toolbox/matlab/verctrl.

In fact, the Matlab documentation, in the function reference, says that the customverctrl function is only for UNIX. Perhaps some modification can be done to the Windows-only method named verctrl instead for Windows users.

James Snyder

Works perfectly on OS X with the new Intel beta.

Dirkjan Krijnders

Works prefect on linux when the "-Q" is replaced by the "-q" option

Dennis Wouters

In order to get it to work, the occurences of the SVN path (/sw/usr/svn) need to be modified to wherever you have your subversion command installed. Probably even 'svn' will be sufficient.
This should also work under Windows (not tested).

Thomas G

Doesn't work with Windows.

MATLAB Release
MATLAB 7.2 (R2006a)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video