wiki:UfoRevisionControl

Version 3 (modified by Matthias Vogelgesang, 14 years ago) (diff)

--

Repositories

There were some problems with integration of Git repositories into Trac. Therefore, I decided to install bazaar as a revision control system: http://bazaar.canonical.com/en/. The good documentation on bazaar commands is available here: http://doc.bazaar.canonical.com/bzr.2.2/en/

I have installed the main repository for framework development. It is accessible with the following bazaar URL:

  bzr+ssh://user@ufo.kit.edu/framework 

You can create new branches with the following command. These branches will be writable by creator only, but accessible for everybody else. Changes to these branches will immediately appear in the Trac source browser.

  bzr init bzr+ssh://user@ufo.kit.edu/framework/branch1

After branch initialization you can create local repository. Just call 'bzr init' in root of the source folder. Files can be added with bzr add command and revision can be commited with bzr commit -m some_comment. This will work with local repository on your desktop computer. To submit a stable revision to the server, for public use, please issue:

  bzr push bzr+ssh://user@ufo.kit.edu/framework/branch1

Alternatively, it is possible to instruct bazaar to synchronize with the server after each commit. Just bind the local branch with the server using the following command:

  bzr bind bzr+ssh://user@ufo.kit.edu/framework/branch1

It is also possible to create a personal repository (for whatever reason). The access pattern will be the same: writable by creator and readable by everybody else. However, it will not automatically appear in Trac. The new repository should be first added through the Trac configuration page. The command:

  bzr init-repo bzr+ssh://user@ufo.kit.edu/repo1/

initializes the repository. Then, the branches can be created as usual:

  bzr init bzr+ssh://user@ufo.kit.edu/repo1/branch1

To get access, please, create a ticket specifying the desired login and attaching your public key.

Possible workflow

There are already very good branching models out there. Although it's up to everyone how he will work on his personal branches, I will show how I use Bazaar to ease my life.

First of all, I import some of the written code using the steps written above. Then I clean the project directory and clone the committed code as a named branch and bind to the server:

bzr clone bzr+ssh://user@ufo.kit.edu/user/project upstream
cd upstream && bzr bzr bind bzr+ssh://user@ufo.kit.edu/user/project

I never work directly in the upstream branch because every commit would be visible immediatly. Therefore, I branch from the upstream branch a local branch where development happens:

bzr clone upstream/ local

Whenever I need to work on the same project but tackling different problems, I branch from the local branch to a feature specific branch. To push my changes, I just pull (no merging needed) the changes from the local branch into the upstream branch

cd upstream && bzr pull ../local

In the future we should streamline the development process as shown in the blog post: There are named branches with specific purposes, which may or may not branch from each other in order to form a coherent system. The two main branches are master where one commit means a release of the product and develop where actual development happens. develop branches from master and from there everyone in the personal branches. Release and feature branches are tempory branches to aid in preparing the release and to help organizing the development of new features. They are deleted when changes in these branches are merged back to master and develop respectively.

The complete system can be seen in the following illustration:

Branch Model from http://nvie.com/posts/a-successful-git-branching-model/

Attachments (1)

Download all attachments as: .zip