![]() |
Tutorial: Bazaar Version Control
Semi-inspired by this thread http://www.chiefdelphi.com/forums/sh...ad.php?t=79446 (would recommend reading that thread as well) I find Bazaar is an easy to use source code revision tool that should leave teams with a warm productive feeling during the build season.
Here's what you might be using right now to go back to earlier versions of your teams code: http://i50.tinypic.com/wwkkr8.jpg The problem with organizing dated code like this:
There's a way to avoid this, and just have your original code structure, no repetitions. Imagine this:
You can have the same features as the picture above (plus more), and have it looking like this: http://i50.tinypic.com/wu2v7m.jpg That one folder hierarchy, stores all your previous revisions/dates of code. Liking this concept? Now to show you how. *Note: Bazaar is my personal favourite decentralized SRCS out there. If you have an enterprise of teams that want to share code among themselves (hey! anybody want to host a source code server for FIRST teams?) then an alternative such as git/svn might be better.* Anyhow, Bazaar is available at their website for Windows, Mac, Ubuntu and a whole boatload of other platforms. In Ubuntu it's available under Synaptic as "bzr" It comes by default as a command-line interface but each platform has many GUI's for it (most bundled with the Bazaar binaries/source code). I'll let you figure out how to install it for yourself, it's quick and easy but writing here on how for each platform might take a while ;) Anyways once you've got it up and running the first thing we have to do is identify yourself - you should do this for all new users. This solves the great question of "Who made the code stop working?" ;) In the CLI: Code:
bzr whoami "Andrew H. minirobotics@gmail.com"In the CLI: Code:
cd ~/RobotCode09Currently, the branch is entirely blank - files need to be added. Everytime you want to send off a new revision, you'll need to add the files you've created since the last revision. When first initializing a branch in a directory, you'll want to commit the initial data. Start by adding the files using the "add" argument. In the CLI: Code:
cd ~/RobotCode09In the CLI: Code:
cd ~/RobotCode09Code:
cd ~/RobotCode09Code:
bzr addCode:
# We've edited some code, and added a new library!The next step is to be able to view your logs, and revert back to an old revision if the worst happens. You can view the entire revision log with the "log" argument. Code:
bzr logCode:
bzr log > "Log01_01_2010.txt"Unfortunately the log only provides so much information using the bare minimum commands as we did above. What you'll find so far:
Especially in the world of robotics you're definitely looking for more information than that. Luckily the "log" argument has even more sub-arguments to it. Such as the -v option; this allows makes the log display details on which files were edited, added and removed. Code:
bzr log -v > "Log01_01_2010__Detailed.txt"Tagging a revision is simple enough with the "tag" argument. By default running this command will tag the current revision but you can also use the -r to tag older revisions. For example... Code:
bzr tag "works, epic, didnotfail, autonomous" # Tags current revision with "works", "epic", "didnotfail", and "autonomous"You can list all tags with their revision number associated beside it... Code:
bzr tags # List all tagsCode:
bzr log -r tag:worksCode:
bzr log # Find the revisionCode:
# We have some code in a directory that we want to put under revision control.Code:
bzr cat -r 1 autonomous.c > autonomous.cCode:
mkdir RobotCode09 # Create a directory for the code~Happy coding!~ |
Re: Tutorial: Bazaar Version Control
Thanks for this wonderful tutorial. I have heard the concept of version control before but this is my first time using it so bare with me.
What is the best way to handle two people doing a checkout, changing files, committing and pushing. If I'm not mistaken the second person will get an error when they try to push saying there local branch is out of date. If you follow the suggestion of updating then you end up with conflicts. When you use resolve you end up with a file with lines like these. <<<<<<< TREE ======= >>>>>>> MERGE-SOURCE You are then able to push but then you have those added lines to break the compiler. |
| All times are GMT -5. The time now is 01:08. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi