1.6. Updating from Mercurial Repositories

Our source code and most documentation are in Mercurial repositories to allow version control, documentation of changes, and access over the web. Mercurial also provides an easy and efficient way to update your code.

Note

Although the CODAS processing code can be updated using Mercurial, there are occasional changes to the installation procedure that can cause problems with a normal update, in which case it is sometimes better to just throw away the old version and start over – it all depends on how old your installation is. The most recent such examples were the change from distutils to setuptools for “installation” of the the main two Python libraries (Jan 2020), and onship in Feb 2021.

If you have a question about this, please email uhdas@hawaii.edu and we’ll help you figure out the best way forward.


Contents:

1.6.1. 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 ~/adcpcode/programs
hg clone  https://currents.soest.hawaii.edu/hg/pycurrents

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 ~/adcpcode/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

1.6.2. Updating CODAS from Mercurial repositories

If you used Mercurial and “hg clone” to populate your adcp_programs directory, you should be able to update the contents of those directories and recompile, without having to upgrade all the underlaying tools (python, compiler, …).

  1. Update the documentation and demos

    There is no upgrade path for adcp_doc or adcp_py3demos. These must be deleted and replaced from the zip archives located here

  2. Update CODAS programs

    Change directories to your adcp programs directory and update the repositores as follows:

    cd codas3
    hg pull -u   https://currents.soest.hawaii.edu/hg/codas3
    cd ..
    
    cd pycurrents
    hg pull -u    https://currents.soest.hawaii.edu/hg/pycurrents
    cd ..
    
    cd onship
    hg pull -u    https://currents.soest.hawaii.edu/hg/onship
    cd ..
    
    cd uhdas
    hg pull -u    https://currents.soest.hawaii.edu/hg/uhdas
    cd ..
    
  3. recompile and install components

    Follow the instructions for your type of installation to recompile and install codas3 and pycurrents, and install uhdas and onship.

    • Was it a virtual machine? (might be better to just replace it: check by asking uhdas@hawaii.edu)

    • Was it build with conda?

    • Was it Ubuntu?