Currently I am using Subversion but after some synchronizing “problems” and a override-commit took ages to complete, I started looking around for other Version Control Systems.
There are some, and below are some of those that I’ll be looking into before deciding to either stick with Subversion (SVN) or move on to something else:
Concurrent Versions System (better known as CVS)
CVS is a version control system, an important component of Source Configuration Management (SCM). Using it, you can record the history of sources files, and documents. It fills a similar role to the free software RCS, PRCS, and Aegis packages.
Subversion
Subversion is an open source version control system. Founded in 2000 by CollabNet, Inc., the Subversion project and software have seen incredible success over the past decade. Subversion has enjoyed and continues to enjoy widespread adoption in both the open source arena and the corporate world.
Subversion is developed as a project of the Apache Software Foundation, and as such is part of a rich community of developers and users. We’re always in need of individuals with a wide range of skills, and we invite you to participate in the development of Apache Subversion.
GIT
Git is a free & open source, distributed version control system designed to handle everything from small to very large projects with speed and efficiency.
Every Git clone is a full-fledged repository with complete history and full revision tracking capabilities, not dependent on network access or a central server. Branching and merging are fast and easy to do.
Mercurial
Mercurial offers you the power and speed to efficiently handle projects of any size and kind. Every clone contains the whole project history, so committing, branching, tagging and merging are local, fast and convenient. You can use a multitude of workflows and easily enhance its functionality with extensions.
Bazaar
Bazaar is a version control system that helps you track project history over time and to collaborate easily with others. Whether you’re a single developer, a co-located team or a community of developers scattered across the world, Bazaar scales and adapts to meet your needs. Part of the GNU Project, Bazaar is free software sponsored by Canonical. For a closer look, see ten reasons to switch to Bazaar.
My needs
I am using Eclipse to code PHP web applications. This work is done on a laptop and I upload to a web server changes, new features or a new application. Because I am getting clients on some of the applications it is important to have changes stored somewhere, and also to have a Source code Version System (or a Version Control System (VCS).
I also travel mostly by bus and because of the length of the commute (70-80 minutes) I get quite a lot of work done on the road. Therefor it would be nice to commit even though you don’t have Internet access. It’s not a must-have feature, but rather a nice-to-have feature.
I also have an Windows XP laptop available, and so a Windows client/server is also a nice-to-have feature.
So my needs are:
- The VCS must have an eclipse plugin
(This is my most important feature at the moment.)
- Must be easy and understandable
- Must be used by more than one developer (It is always good practice to thing expansion ahead rather than afterwards)
- There must be a Linux, Apple and Windows version
- I do some of my work commuting (I have a 70-80 minutes bus ride to/from work/clients). So Offline committing is a nice feature
- Documentation. The VCS must have good documentation so that it is easy to start using it
I have learned that there are at least two types of Version Control Systems:
- Distributed revision control
- Revision control
Distributed revision control (DRC)
This VCS type keeps track of software revisions and allows many developers to work on a given project without necessarily being connected to a common network. Meaning: You have a repository locally on your computer.
GIT, Mercurial and Bazaar are typical examples or a DRC
Revision control (RC)
Revision control, also known as version control or source control (and an aspect of software configuration management or SCM), is the management of changes to documents, programs, and other information stored as computer files. It is most commonly used in software development, where a team of people may change the same files.
Subversion, Source Safe (Discontinued, only severe bugs are fixed – according to Wikipedia) and CVS are examples of a RC.
So my safe bet is to look at GIT, Mercurial and Bazaar.
Bazaar:
Created by Canonical, and so I am quite safe here as my laptop is running Ubuntu. But since I am also having a XP-machine available I need windows support. Bazaar has both covered.
Eclipse IDE plugin: Yes
So Bazaar seems like a nice option. I need to test this VCS before deciding of course.
Bazaar is being actively developed by a large community which is nice.
GIT
Created by Linus Thorvalds and used in projects like the linux kernel, Perl, Android, Eclipse and more.
Since GIT is being used by Eclipse there is of course an Eclipse plugin so that you can commit using GIT.
I have read that the learning curve for using GIT is quite steep.
GIT is being actively developed by a large community which is nice.
Mercurial
Created by Matt Mackall and according to the always reliable wikipedia, Mackall started developing Mercurial just days after Thorvalds started developing his GIT.
There is a Eclipse plugin for Mercurial, although this is not stated on the projects website.
Mercurial is being actively developed by a large community which is nice.
So currently my adventure towards a life with a new VCS starts here. And I will start with Bazaar.
Installing:
Quite easy. You either use apt-get or as I did Synaptic Package Manager. Remember that it is called bzr in ubuntu packages. When you choose bazaar in Synaptic it will automatically add bzrtools for you. I also added bzr-docs to get the documentation.
Migrating from Subversion:
Firstly, there are more than one way to migrate from SVN to BZR. Secondly, the information on how to migrate is spread across a few websites.
- The first way to migrate I found was to use the svnadmin dump command. This creates a dump file that I then had to copy from the server to the laptop. That took ages.
The command you use is : svnadmin dump /path/to/svn-repo > filetocontainsvnrepo
You can also use name-of-svn-repo instead of /path/to/svn-repo
The filetocontainsvnrepo can be / will be quite large, so have a quite empty disk to save your work on.
Also: Have plenty of time at your hand (or start this work late at night and hope/pray for non surprising messages when you wake up and check output of dump). The amount of time the dump will take of course depends on how many revisions there are in your repository. I had around 100 revisions. This of course the way subversion works – even though you have 1000 projects in the SVN-repository, they all use the same “counter”. Meaning: If you commit changes in Project X this will become revision 1, then you commit changes to Project Y which is stored in the repository, this will become revision 2 and so on.
- While copying I came over the bzr svn-import plugin (apt-get install bzr-svn) which worked much nicer.
With the bzr svn-import command you connect like you would with the svn+ssh command (on my system that is), or the command you normally use when you commit or do other changes to the repository.
Documentation
While dumping the SVN repository I decided to use the time wisely and looked at the documentation for Bazaar. Canonical provides two versions of the documentation for beginners: The five minute mini tutorial and the Bazaar Quick start Guide.
I decided to read the five minutes mini tutorial.
First I created a user, and since my name contains Norwegian characters I was a bit anxious to see how BZR handled those. No worries there.
This mini tutorial gives you an easy understanding on how to set up a repository and committing. It also teaches you how to commit to a central repository. I wanted to dig further – like to see how BZR suggest you set up a repository (Like they do in the SVN documentation). I found this chapter which tells you how to set up a repository, and so I will go for the preferred way of setting up a repository:
project1/ # A repository for project1
+- trunk/ # The mainline of development of project1
+- branches/ # A container directory
+- foo/ # Branch for developing feature foo of project1
One thing that didn’t come clear to me was:
- Should I enter the directory where the source code is now (as in – the local website on the local web server)
- or should I create a directory somewhere else on the laptop hard disk?
And so I had to find out. First I read the FAQ. No information there. Then I checked https://answers.launchpad.net/bzr/ to see if there could be anyone as dumb as me. So I found out that you don’t really do what you do in SVN.
What you do is to go to the directory where you have your project – like – on my system I have created a Project folder called www and below it I have for instance www.example.com. In www.example.com I have created log and www-directory.
So I go into this directory and type
bzr init
bzr add
bzr commit -m “Initial import”
And whoopsie all your files and directories in that directory is version controlled. Pretty neat, eh?
So now I needed to add BZR support in Eclipse:
Adding BZR-support is quite easy. All you do is to follow this link: http://wiki.bazaar.canonical.com/BzrEclipse/Installation