The Neurophysiological Biomarker Toolbox (NBT)

Short introduction to version control

The NBT code is under version control. EEGlab and Fieldtrip use the CVS system (see the CVS repository for EEGlab). NBT use the Bazaar system because this is a more modern so-called distributed version control system.

The basis of version control is simple. All code is kept centrally at a server, and a folder at each users computer. If a user makes a change to the code; he/she does it locally on his/her computer, and then later uploads (“Commits”) the changes to the server. When the changes are uploaded, other users can download the changes (“Update”) to their computer.

Sometimes a conflict happens, e.g., when two users have made changes to the same line in the same file. The Bazaar program automatically identifies such conflicts and has tools to solve (“Merge”) these conflicts.

How to use Bazaar in Linux

How do I begin - the checkout

It should only take a few minutes to begin. You only need to do the following once.

  1. You need to download and install the Bazaar client. It will do all the communication with server etc. Go to this page - download the “Standalone” version, and install it. When the installer ask you which components you want to install, select “Full installation”.
  2. Now start up the program “Bazaar Explorer”. It will look like this (if not click the tab “Get project source from elsewhere”).
  3. Click on “Checkout”. This window will pop-up. The “Branch source” is the location of the server, the current IP is (only access from internal network, read here on how to get access from outside the VU network), and the code is stored in ”/home/bzr/NBT2/”. You should replace “yourusername” with your user name :!: (you get the username and password from Simon - it is not the same as your NBTwiki username/password). In the field “Local directory (…)” select a directory where you want the NBT code to be. Now click “Ok”, and enter your password when asked.
  4. Done. If you go to the directory you selected above you will find the NBT code. Now read below on how to use the version control.

How do I use it

Before making any changes to the code, make an “update” of your local copy. When done with your changes make a “Commit”.

How do I update my local copy

The update procedure will update your local copy with new changes.

  1. Right click on the directory where you keep you NBT code.
  2. Select “Bazaar Update”
  3. A window pops up. Usually the server location is correct in the field “Pull most recent changes from”. Click “Ok”, and enter you password when asked
  4. You done. Your local version has been updated.

How do I commit changes to the server?

The commit procedure will commit changes in your local copy to the server.

  1. Right click on the directory where you keep you NBT code.
  2. Select “Bazaar Commit”
  3. A window pops up. In the message field you write a very short description of the changes you made. In this case I made changes to the Content.m file - you can see the changes by clicking “Diff”. To commit the changes click “Ok”, and enter you password when asked.
  4. The changes have now been uploaded to server.

How do I solve conflicts?

A “Conflict” emerges if two users change the same file at the same time.

The aim of version control is keep the code consistent, and any conflict should therefore be solved. Bazaar simply does not allow you to upload new changes if they are in conflict with the server version.

You probably got a : “bzr: ERROR: These branches have diverged.” error message. This means that you need to merge your local copy with the server copy.

  1. Right click your NBT code directory. Point at “Tortoise Bazaar”, and click on “Merge”. A window pops up. Check that the “location” is correct (i.e. the server is correct). Click “Ok”, and enter your password when asked.
  2. Bazaar will tell you if any conflict has been found.
  3. Open the Bazaar Explorer program. Click on the “Open existing location” tab, click “Open” and select the directory where you keep you NBT code. See Figure, in this case a conflict exist in Contents.m, click on the file name - a wordpad window pops up (shown)
  4. Now you can see the conflict. In this case you are “user B”, and you see that “User A” has made change in the same line as you. You wrote “This is user B”, and user A, wrote “this is user A”.
  5. Solve the conflict by editing the file. Save it.
  6. Click on “Resolve conflicts” (see Figure), and click on “Mark as resolved” (right click the file).
  7. Click commit again. And finally click merge again
nbt_version_control.txt · Last modified: 2012/04/25 15:56 by Simon-Shlomo Poil
The NBTwiki platform - version 2.8 - 9 May 2013
Copyright (C) 2008-2015