How to edit EEGLAB code

From SCCN

Jump to: navigation, search

EEGLAB is now under CVS (Concurrent Version System). Below are a couple of hints to help you check in and out eeglab functions. At this moment, only researchers with an account at SCCN may edit the EEGLAB code. If you want to contribute to the project and do not have a SCCN account, let us know at eeglab@sccn.ucsd.edu.

Contents

Editing files

SCCN Linux local checked out version with Matlab editor

Then the simplest way to edit files is to use the Matlab editor and set the Matlab preference to CVS for revision control. As with RCS, you may check out any EEGLAB file, and then check it back in and enter your revision comment. It is that simple. The difference with our prior revision scheme however is that IF YOU DO NOT CHECK BACK IN YOUR CHANGES, THEY WILL BE ERASED OVERNIGHT (at 3:30 AM). Your changes will be saved in temporary files though. Be sure to change your settings so that other users can modify the file you save.

Files are erased overnight because the EEGLAB files at SCCN are just a checked out version of the real EEGLAB repository (which contains all history of changes and some fragmented Matlab code but not the actual Matlab files). There can be as many checked out version as we want (one in France, one in India, etc...) and all of them can be edited simultaneously. If two people modify the same file, and check them back in, then there is a conflict and it has to be resolved manually using special tools that allow to compare the files side by side with color highlighting of the changes.

SCCN Linux local checked out version with Matlab editor

Log onto SCCN and go to the folder you are interested in. You may just type

 edit xxx.m

edit the file using xemacs. When you close the file, you may enter comment in a vi editing window. You must type "I" to insert comments and "ESC" then ":wq" to write and leave the comment editing window.

Alternativelly you may edit the file directly

cd /data/common/matlab/eeglab/functions/sigprocfunc/
xemacs xxxx.m

save (but be careful that other can still edit your functions and have write permissions). Then type

setenv CVS_ROOT /data/common/cvs
cvs commit xxx.m

I think the first line is not even necessary as Bob said he would make that system wide. Then another vi pops up and you can enter comments. It's that simple.

Custom checked out version Linux

If you want to work on a couple of functions for several days, the best is to check out the whole tree structure in your home folder (using dedicated software or Linux command) and then check back in your changes when you are done. Go to the folder where you want to check out the repository. Under the linux command line

cvs checkout eeglab

Bob set up CVS so the CVSROOT variable which tells CVS where the repository files are is set by default (equivalent to typing "setenv CVSROOT /data/common/cvs/"). To edit files with vi, do as recommended in the two previous sections.

To checkout files remotely (on your Linux laptop etc...), use the SSH protocol and any of the SCCN computers. Under Linux, you may type in:

setenv CVS_RSH "ssh"
cvs -d :ext:yourname@sccn.ucsd.edu:/data/common/cvs checkout eeglab

You may then edit and commit your changes as described in the previous section without the need to use different commands (in the version you checked out, there is a CVS folder that contains all the information about where the file are coming from etc...).

Custom checked out version Windows

For instance, using tortoisecvs, you may simply check out the full EEGLAB tree, modify some files using Matlab (you may use or not the CVS feature of Matlab but in this case it is more of a burden as you would have to check in every single file). When you are done, right click on the eeglab folder and select Commit. This will commit all of your changes at once, and allow you to enter a comment that will apply to all of them.

Protocol: ssh
Protocol parameters:
Server: speaking.sccn.ucsd.edu
Port:
Repository folder: /data/common/cvs/
Username: arno

For username, you may also enter your username followed by a colom and your password. There are more secure ways to set that up of course. You may then press the Fetch list button and select EEGLAB. The checkout process will take a few minutes depending on the speed of your connection.

Creating new files

To create and add a new function. Simply move it to the folder where you want it to be in the EEGLAB SCCN folder (/data/common/matlab/eeglab/), open it with Matlab and check it in using the Matlab menu (File > check in). Local folders have CVS folders that refer to the repository so CVS knows at all time where you are in the EEGLAB repositry tree structure. If you were to try that in your home folder, it would crash because your home folder is not associated with any checked out module of CVS.

If you are using tortoisecvs, copy or create a file within the EEGLAB structure. Then right click on it and select Add. Right click again and select Commit. Your file is now in the repository.


Arno Delorme - Jan 30th 2009


Return to EEGLAB Wiki
Return to SCCN Wiki Home
Personal tools