cvs2bzr Documentation

# cvs2bzr

## Index

- Introduction
- Requirements
- Development status
- Documentation
- Usage

## Introduction

cvs2svn/cvs2bzr is a tool that can be used to migrate CVS repositories to newer version control tools, including Bazaar. Bazaar is an adaptive version control system that supports both centralised and distributed version control. It is most famous for being used for Ubuntu and MySQL development. The program used to convert to Bazaar, called cvs2bzr, is distributed as part of the cvs2svn project.

If you are reading this documentation on the cvs2svn website, then please be aware that it describes the current trunk version of cvs2svn, which may be different than the most recent released version. Please refer to the documentation that was included with your version of cvs2svn.

Conversion to Bazaar was added in release 2.3 of cvs2svn and may have improved significantly since then. Please make sure you are using an up-to-date version of cvs2svn--perhaps even the development trunk version.

## Requirements

cvs2bzr requires the following:

- Direct (filesystem) access to a copy of the CVS repository that you want to convert. cvs2bzr parses the files in the CVS repository directly, so it is not enough to have remote CVS access. See the FAQ for more information and a possible workaround.
- Python 2, version 2.4 or later. See http://www.python.org/. (cvs2bzr does not work with Python 3.x.)
- If you use the `--use-rcs` option, then RCS's `co' program is required. The RCS home page is http://www.cs.purdue.edu/homes/trinkle/RCS/. See the `--use-rcs` flag for more details.
- If you use the `--use-cvs` option, then the `cvs' command is required. The CVS home page is http://ccvs.cvshome.org/. See the `--use-cvs` flag for more details.
- Bazaar version 1.13 or later.
- The bzr-fastimport plugin version 0.9 or later.

## Development status

Most of the work of converting a repository from CVS to a more modern version control system is inferring the most likely history given the incomplete information that CVS records. cvs2svn has a long history of making sense of even the most convoluted CVS repositories, and cvs2bzr uses this same machinery. Therefore, cvs2bzr inherits the robustness and many of the features of cvs2svn. cvs2svn can convert just about every CVS repository we have ever seen, and includes a plethora of options for customizing your conversion.

The output of cvs2bzr is a "fastimport" dump file that can be imported into Bazaar using the bzr-fastimport plugin.

Although cvs2bzr is considerably newer than cvs2svn, and much less well tested, it is believed that cvs2bzr can (cautiously) be used for production conversions. If you use cvs2bzr, please let us know how it worked for you!

## cvs2bzr limitations

cvs2bzr still has many limitations compared to cvs2svn. The main cvs2svn developer has limited Bazaar experience and very limited time, so help would be much appreciated! Some of these missing features would be pretty easy to program, and I'd be happy to help you get started.

- The cvs2bzr documentation is still rather thin. See below for more references.
- CVS allows a branch to be created from arbitrary combinations of source revisions and/or source branches. cvs2bzr tries to create a branch from a single source, but if it can't figure out how to, it creates the branch using "merge" from multiple sources. In pathological situations, the number of merge sources for a branch can be arbitrarily large.
- There are no checks that CVS branch and tag names are legal names in Bazaar. This is unlikely to be a problem because Bazaar uses paths for branch names similar to CVS and Subversion. Tag naming in Bazaar is also more flexible than in git, say.
- Only single projects can be converted at a time. Given the way Bazaar is typically used, I don't think that this is a significant limitation.
- cvs2bzr is not especially fast. Among other things, it still uses RCS or CVS to extract the contents of the CVS revisions. Implementing the `--internal-co` option for cvs2bzr (using code that already exists in cvs2svn) might improve the conversion speed considerably.
- The cvs2svn test suite does not include meaningful tests of Bazaar output.
- cvs2bzr makes no attempt to convert `.cvsignore` files into `.bzrignore` files.
- cvs2bzr, like cvs2svn, does not support incremental conversion (i.e., tracking a live CVS repository). However, this possible workaround for using cvs2git along those lines might provide some assistance for anyone wanting to try doing that using cvs2bzr.

## Documentation

There is some documentation specific to cvs2bzr, and much of the cvs2svn documentation also applies fairly straightforwardly to cvs2bzr. See the following sources:

- This document.
- The cvs2bzr man page and the output of `cvs2bzr --help`.
- The cvs2svn documentation and the cvs2svn FAQ, which contain much general discussion and describe many features that can also be used for cvs2bzr.
- `cvs2bzr-example.options` in the cvs2svn source tree, which is an example of an options file that can be used to configure a cvs2bzr conversion. The file is extensively documented.
- The cvs2svn mailing lists, IRC channel, etc., as described in the cvs2svn FAQ.
- The Bazaar Data Migration Guide.

## Usage

This section outlines the steps needed to convert a CVS repository to Bazaar using cvs2bzr.

1. Be sure that you have the requirements, including either RCS or CVS (used to read revision contents from the CVS repository).
2. Obtain a copy of cvs2svn/cvs2bzr version 2.3 or newer. It is recommended that you use the most recent version available, or even the development version.
   - To install cvs2svn from a tarball, simply unpack the tarball into a directory on your conversion computer (cvs2bzr can be run directly from this directory).

   - To check out the current trunk version of cvs2svn, make sure that you have Subversion installed and then run:

         svn co --username=guest --password="" http://cvs2svn.tigris.org/svn/cvs2svn/trunk cvs2svn-trunk
         cd cvs2svn-trunk
         make man # If you want to create manpages for the main programs
         make check # ...optional

     Please note that the test suite includes tests that are marked "XFAIL" (expected failure); these are known and are not considered serious problems.

3. Configure cvs2bzr for your conversion. This can be done via command-line options or via an options file:
   - The command-line options for running cvs2bzr are documented in the cvs2bzr man page and in the output of `cvs2bzr --help`.

   - The more flexible options-file method requires you to create an options file, then start cvs2bzr with

         cvs2bzr --options=OPTIONS-FILE

     Use `cvs2bzr-example.options` in the cvs2svn source tree as your starting point; the file contains lots of documentation.

4. Run cvs2bzr. This creates an output file in fast-import format. The name of this file is specified by your options file or a command-line argument. In the example, the file is named `cvs2svn-tmp/dumpfile.fi`.

5. Load the dump file using bzr fast-import:

       bzr fast-import cvs2svn-tmp/dumpfile.fi project.bzr

Feedback would be much appreciated, including reports of success using cvs2bzr. Please send comments, bug reports, and patches to the cvs2svn mailing lists.