The Linux Foundation

 
Bazaar

From The Linux Foundation

(Difference between revisions)
(Installing Base Software)
(Migration Status)
Line 83: Line 83:
 
At the moment, only the OpenPrinting, LSB development, and unofficial repositories are live; the rest are still being managed in CVS.  These bzr repositories are synchronized with CVS nightly.  They can be branched, modified, and merged through the [[Bazaar-NG Patch Queue Manager]], but any merges will be overwritten nightly when CVS changes are pulled in.   
 
At the moment, only the OpenPrinting, LSB development, and unofficial repositories are live; the rest are still being managed in CVS.  These bzr repositories are synchronized with CVS nightly.  They can be branched, modified, and merged through the [[Bazaar-NG Patch Queue Manager]], but any merges will be overwritten nightly when CVS changes are pulled in.   
  
So, for those projects which are still being synchronized with CVS, the proper place to make real changes is still CVS.  Merging changes with these project is still possible, but only as a test of the merge process.
+
So, for those projects which are still being synchronized with CVS, the proper place to make real changes is still CVS.  Merging changes with these projects is still possible, but only as a test of the merge process.
 +
 
 +
When a project switches to bzr, the CVS repository will become read-only, the following error message will appear on attempted checkins:
 +
<pre>
 +
cvs commit: Pre-commit check failed
 +
cvs [commit aborted]: correct above errors first!
 +
</pre>
 +
Note that at this time, migrated repositories do not sync back to cvs XXXX
  
 
== Issues with Bazaar-NG ==
 
== Issues with Bazaar-NG ==

Revision as of 18:34, 3 August 2006

Contents

Bazaar-NG

Bazaar-NG (or "bzr") is the primary candidate for replacing CVS as the FSG's preferred Version Control system. (The other is Mercurial.)

Getting Started

Bazaar-NG is available in several distributions, although most of them currenly provide an older version. Access to the FSG's repositories is recommended with bzr 0.8 or higher.

Installing Base Software

Users of Fedora Core 5, Debian "etch", or Ubuntu "Dapper" can use their distribution's version of bzr. For Debian 3.1 ("sarge"), a backport is available. The bzr project also maintains a list of available bzr ports at their distro downloads page. There may be more up-to-date information on availability. Remember that the FSG repositories require bzr 0.8 or higher.

If a packaged version won't work or doesn't exist, the current version of bzr can be downloaded from the Bazaar-NG download page. It requires Python 2.4 and the ElementTree and cElementTree modules at minimum. To use the "sftp" method of talking to external repositories, the paramiko and pycrypto modules are required.

Installing Plugins

Plugins are add-on code modules which extend bzr, enhancing current features and adding new ones.

Distributions which package bzr itself often package plugins as well; search for a "bzrtools" package to see. For unpackaged plugins, the bzr site has good installation instructions.

One plugin in particular used at the FSG is "tags". You must have this plugin installed to access tagging information in our repositories, or to add new tags. See the Bazaar-NG Tags page for more details.

Another plugin that looks useful for projects (such as LSB) which have multiple repositories is the "update-mirrors" plugin. With this plugin, a single command "bzr update-mirrors" in a directory that holds branches of multiple repositories can do the effect of a "bzr pull" on each.

Initial Setup

(modified from [[1]]):

One function of a version control system is to keep track of who changed what. In a decentralized system, that requires an identifier for each author that is globally unique. Most people already have one of these: an email address. Bzr will auto-generate an email address by looking up your username and hostname, but this may not be the global identifier you want, especially if you use several different machines or want to be identified by a different address (such as @freestandards.org). We definitely prefer that a user's commits all have the same identifier over time! Here are some options:

  1. Set the email address in the ~/.bazaar/bazaar.conf by adding the following lines. Please note that [DEFAULT] is case sensitive:
    [DEFAULT]
    email = Your Name <email@isp.com>
    
  2. Override the previous setting on a branch by branch basis by creating a branch section in ~/.bazaar/branches.conf by adding the following lines:
    [/the/directory/to/the/branch]
    email = Your Name <email@isp.com>
    
  3. Override the two previous options by setting the global environment variable $BZREMAIL or $EMAIL ($BZREMAIL will take precedence) to your full email address.

Documentation

We document our use of bzr in several places: Bazaar-NG User Branches, Bazaar-NG Patch Queue Manager, Bazaar-NG Tags.

CVS wizards may (or may not) benefit from Bazaar-NG For CVS Users.

The Bazaar-NG Web site is also available. In particular, the following links are useful:

Repositories

All FSG repositories are available at the following URL:

http://bzr.freestandards.org/

The repository is browseable, and has roughly the same functionality as cvsweb. Unofficial user branches are stored in "unofficial"; official branches from the workgroups are stored in a workgroup directory, with released and development versions in subdirectories.

To check out a copy:

bzr branch http://bzr.freestandards.org/unofficial/(project) (localdir)

or:

bzr branch http://bzr.freestandards.org/lsb/3.1/(project) (localdir)

The webserve interface in the browser has links to the repository that work.

Migration Status

At the moment, only the OpenPrinting, LSB development, and unofficial repositories are live; the rest are still being managed in CVS. These bzr repositories are synchronized with CVS nightly. They can be branched, modified, and merged through the Bazaar-NG Patch Queue Manager, but any merges will be overwritten nightly when CVS changes are pulled in.

So, for those projects which are still being synchronized with CVS, the proper place to make real changes is still CVS. Merging changes with these projects is still possible, but only as a test of the merge process.

When a project switches to bzr, the CVS repository will become read-only, the following error message will appear on attempted checkins:

cvs commit: Pre-commit check failed
cvs [commit aborted]: correct above errors first!

Note that at this time, migrated repositories do not sync back to cvs XXXX

Issues with Bazaar-NG

Speed

By far, the biggest problem with bzr is its speed, particularly at doing the initial checkout. The initial checkout of the "build_env" repositiory in the trial has been timed to take as long as 25 minutes, and others have reported even longer times. Local operations, and updates after the initial checkout, are much faster.

The bzr developers have blamed this on an initial focus on correctness and functionality, rather than speed. Optimizing bzr is the primary goal of the 0.9 series. The current goal is to release bzr 1.0 within the next few months, so it's hoped that current speed problems are temporary.

An automated tarball download feature has been implemented in the current trial. In the changelog mode, there is a "download" link, which will create and send a tarball to the user consisting of the .bzr directory of the repository. This can be made into a working copy by untarring the tarball, changing into the root of the resulting tree, and running "bzr revert". After this, the directory is functionally identical to a tree created with "bzr branch".

Project Reorganization

It's been pointed out that bzr does not allow the checking out of subdirectories alone; you must check out the entire branch. Thus, it may not make sense to lump as many of the sub-projects together as they are currently organized in CVS.

Commit Rights

With CVS, since it is very difficult to maintain a local branch, pretty much anyone who did serious development on the LSB was granted commit rights. With bzr, since each branch is local, that's no longer needed. Thus, many fewer developers need commit rights. The problem then becomes: how do we get changes made by individual developers back into the main tree?

We are planning to use an approach the bzr developers also use: an add-on for bzr called a "patch queue manager". Under this approach, maintenance of the official main tree is automated to some degree. Development is done on local branches, which are then made available online, and a request for a merge is submitted via a web interface, linked to from the bzr-webserve browser interfaces (via the "merge" link).

Access to PQM requires authentication. Access to merge patches is granted on a per-workgroup basis.

For more information, see the Bazaar-NG Patch Queue Manager page.

User Branches

Without CVS as a method of distributing patches through the official tree, we will need some other means of making new development available. Allowing users to publish their bzr branches on an FSG site is the best way for this to happen. The question, of course, is how to best do this.

The current trial has a "unofficial" section for user branches. For more information on how they work, see Bazaar-NG User Branches.

Tags

As of 0.8.x, bzr does not have a native tagging facility. This page explains the proposals for adding tags to bzr. In the short term, Martin Pool has recommended to us that we use the tags plugin (local branch), which gives us approximately what Mercurial tags give us. See the Bazaar-NG Tags page for more details.

Other Problems

If you notice other issues, please add them to the wiki, or discuss them on the Discussion page if you prefer.


[Article] [Discussion] [View source] [History]