#!/bin/bash

## Create a void development directory with 1st level folders: 'trunk', 'branches' and 'releases'
svn co --depth immediates http://forge.ipsl.jussieu.fr/nemo/svn/NEMO NEMO_dev

## Switch from user to developer role if ID is provided
if [ -n "$1" ]; then
	svn sw --relocate    http://forge.ipsl.jussieu.fr                       \
							svn+ssh://$1@forge.ipsl.jussieu.fr/ipsl/forge/projets \
		NEMO_dev
fi

cd NEMO_dev

## Get the 1st level tree under 'branches' and 'releases'
svn up --set-depth immediates branches releases

## Download the trunk and last release, the same procedure can be used for any sub-content
svn up --set-depth infinity   trunk    releases/release-3.6

cd ..

exit 0
