Part 1: Getting CODAS with Mercurial


As of April 2013, this version of the documentation is no longer maintained; however, it is consistent with the last (now retired) version of CODAS processing that used Matlab. We no longer update or fix the Matlab processing code, but we will maintain the Matlab code that reads CODAS Matlab output. Although the notes refer to both Python and Matlab processing, none of the code here will be maintained. This (now retired) documentation and code will remain available for awhile longer.

Python processing code is actively maintained and developed, and CODAS Python processing is documented here.

Download and install Mercurial

Mercurial is a distributed version control system. We use it to store and monitor changes in CODAS software.

Download and install Mercurial (recommend “download and build from source” for unix, binary install for Windows)

See bottom of page: Mercurial: A Short Introduction

Getting Mercurial repository CODAS software

Make a directory in which all the subdirectories will live, for example “adcp_programs”. All codas mercurial repositories (zip files, if no repository exists) must land in this directory, and it is also the directory in which you will run “hg clone” to make repositories in section (2) , below.

This method is fast and easy, especially for subsequent updates.

Change directories to your adcp_programs directory and clone these four (4) repositories as follows:

hg clone  adcp_templates
hg clone          codas3
hg clone          matlab
hg clone      pycurrents

Now clone these additional two (2) repositories. These two are new, for Python single-ping processing:

hg clone      onship
hg clone       uhdas

That’s it. You you have the code. (you still have to compile it)

You can browse the code at the web site You could download archives of these directories (zip, tar.gz, or bz2) and install from those zips, but then the hg update mechanism is lost.

Mercurial: A Short Introduction

Here is a brief introduction to the control that Mercurial gives you:

Use “hg clone” to create the directories (the first time):

cd adcp_programs
hg clone

Later, if you see that we have made changes and you want to take advantage of them, or help us find the new bugs, use “hg pull -u” to update a directory:

cd adcp_programs/pycurrents
hg pull -u

This will pull changes from the repository that you cloned; if you need to pull from a different location, you can specify that location on the command line. To see what the last 5 revisions were:

hg log -l 5

To switch your working directory back to an earlier version, say 237:

hg update -r 237

And then restore it to the latest:

hg update -r tip

Or just see what the changes were from 237 to the latest:

hg diff -r 237

See the wiki for more information, and use the quick help, e.g.:

hg help
hg help pull
hg help clone