Personal tools
  • Help

nutmeg:SVN

From NITRC Wiki

Jump to: navigation, search

SVN Setup (Developers and UCSF users only)

You will need to e-mail Sarang or Johanna with a copy of your SSH public key (located in ~/.ssh/id_rsa.pub of the computer you will be using). If it does not already exist, you need to run:

ssh-keygen -t rsa

Be sure to remember the passphrase you have set! If you forget it, you'll have to recreate the key and resend to Sarang or Johanna.


(Note to self (e.g. to Johanna from Johanna): use gedit, not pico, when adding an ssh-key!)

If you have a copy of NUTMEG that was checked out via SVN before SSH was implemented (roughly March 2009), you can convert your existing copy to use svn+ssh. On your local SVN copy of nutmeg, run the following command:

svn switch --relocate `svn info | grep URL: | sed -e s/URL:\ //` svn+ssh://nutmeg@ocf.berkeley.edu/nutmeg

If you are experience problems with svn update or svn log you may have to do the above as well.

Otherwise, if you are checking out for the first time, after Sarang/Johanna has added your SSH key, run the following command -- assuming a Linux or Mac command line:

svn co svn+ssh://nutmeg@ocf.berkeley.edu/nutmeg/trunk destinationdir

"destinationdir" is the directory you want to create to hold all the code, e.g., simply "nutmeg" or "nutmegsvn" would do. (I'm not sure what it does to existing directories, so, to be safe, you should rename old directories or choose a new directory name.)

Password versus Passphrase:

If all goes well, you may be asked for a passphrase (NOT a password), and then everything will download. VERY VERY IMPORTANT: If you are asked for the password of nutmeg@ocf.berkeley.edu, then your SSH key has not been properly added! If it asks for a passphrase, this is the passphrase you set yourself when you created your SSH key. If you don't remember it, you'll have to recreate the key and send the new id_rsa.pub file to Sarang or Johanna.

If you want to try on Windows, TortoiseSVN is the recommended client. It should be relatively intuitive to find the TortoiseSVN equivalent to all the above commands.

In Matlab, be sure to add the created nutmeg directory to your path (including subdirectories). Also, you will need to add SPM8 to your path: /netopt/share/lib/matlab/spm8 + subdirectories.

It is highly recommended that you make some changes to spm_defaults.m and place it in your /home/user/matlab directory. (Be sure this directory is above nutmeg and spm in the path list.) You may copy Sarang's version from /data/research_meg/tfbf/examples/spm_default.m. This version sets the default MRI format to neurological orientation (i.e., left on left and right on right) and expands the spatial normalization bounds to include all of the cerebellum.

Since we are actively fixing bugs and developing new features, you should periodically update your checked out copy of NUTMEG. To do that, change into the directory that contains nutmeg and run svn update.

Common SVN Commands

To download new updates from the repository:

svn update

To contribute bug fixes or other updates to existing code, you "commit" the file just like with CVS:

svn commit whatever.m -m 'my sweet new feature'

To add a completely new file or directory:

svn add nut_myawesomecode.m

To see a list of files with uncommitted changes or new versions available from the repository:

svn status

To see exactly what's different in your local file compared to the repository:

svn diff whatever.m

To roll back to a previous version for your local copy of NUTMEG:

svn log | less
or
svn log filename.m | less

Look at the logs to find out which revision number you want to roll back to. Then

svn update -r revisionnumber
or
svn update -r revisionnumber filename.m

To remove a bad commit:

svn update messedupfile.m
svn log messedupfile.m | less

Look at the logs to find out which revision number you want to roll back to. Then

svn merge messedupfile.m@HEAD messedupfile.m@revisionnumber

It should be relatively intuitive to find the TortoiseSVN equivalent to all the above commands.

Troubleshooting SVN issues

You may get a "Killed by signal 15" warning with some combinations of SVN and Mac/Linux OS versions. It's harmless.

Powered by MediaWiki
  • This page was last modified 11:39, 28 July 2011.
  • This page has been accessed 664 times.
  •