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.
It should only take a few minutes to begin. You only need to do the following once.
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”.
Now start up the program “Bazaar Explorer”. It will look like this (if not click the tab “Get project source from elsewhere”).
Click on “Checkout”. This window will pop-up. The “Branch source” is the location of the server, the current IP is 126.96.36.199 (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.
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.
The commit procedure will commit changes in your local copy to the server.
Right click on the directory where you keep you NBT code.
Select “Bazaar Commit”
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.
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.
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.
Bazaar will tell you if any conflict has been found.
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)
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”.
Solve the conflict by editing the file. Save it.
Click on “Resolve conflicts” (see Figure), and click on “Mark as resolved” (right click the file).
Click commit again. And finally click merge again
nbt_version_control.txt · Last modified: 2012/04/25 15:56 by Simon-Shlomo Poil