Bazaar

Bazaar

 




Wiki Tools

  • Find Page
  • Recent Changes
  • Page History
  • Attachments

Contents

Introduction

svn2bzr is a tool to convert Subversion repositories into Bazaar repositories.

It does that by reading a dump file with the history of a given Subversion repository, and creating the Bazaar repository according to the given parameters.

Features

  • Support for branches and tags - svn2bzr is able to convert all branches and tags of the subversion repository, splitting them into separate Bazaar branches, using a unique shared repository.

  • Flexible branch description - it is possible to fine tune what will be migrated and how the process will be done by using regular expressions to include/exclude paths, a provided prefix for consideration, and one of the predefined branch schemas.

  • Stable file and revision IDs - svn2bzr produces stable file and revision IDs, meaning that if the same subversion repository is converted twice, the resulting bzr branches will interoperate.

  • Metadata migration - data like committer, timestamp, and log message is automatically migrated to the Bazaar repository.

  • No external dependencies - svn2bzr doesn't depend on anything else besides a recent Python interpreter and Bazaar itself.

Basic usage

The basic command usage is:

svn2bzr.py [options] <dump file> <output dir>

Accepted options

The following options are accepted:

  • --prefix PATH

    • Will build the new repository as if the Subversion repository

      started at its PATH subdirectory.

    --include REGEXP

    • Add REGEXP to the ordered list of filtering expressions. If a path matches that expression before matching an exclude expression, the path will be converted. If no expressions match in the filtering list, the path is also considered.

    --exclude REGEXP

    • Add REGEXP to the ordered list of filtering expressions. If a path matches that expression before matching an include expression, the path won't be converted. If no expressions match in the filtering list, the path is considered.

    --scheme SCHEME

    • Define the conversion mechanism used. Currently there are two

      schemes: single, and trunk. The single scheme (the default) will convert everything into a single Bazaar branch. The trunk scheme expects the Subversion repository to be in the trunk/tags/branches format, and will split the trunk, each tag, and each branch into a different Bazaar branch.

    --log LEVEL

    • Define the logging level to LEVEL, which may be debug, info, warning, or error.

Examples

Convert everything inside a Subversion repository into a Bazaar branch:

svn2bzr.py svn.dump bzr/


Convert a repository using the trunk/tags/branches scheme into multiple Bazaar branches:

svn2bzr.py --scheme=trunk svn.dump bzr/


Convert just the trunk of a Subversion repository using the trunk/tags/branches scheme into a Bazaar branch:

svn2bzr.py --prefix=trunk svn.dump bzr/



Convert the trunk and the branches directories of a Subversion repository using the trunk/tags/branches scheme into multiple Bazaar branches:

svn2bzr.py --scheme=trunk --exclude=tags svn.dump bzr/

Another way to do the same thing:

svn2bzr.py --scheme=trunk --include=trunk --include=branches --exclude='.*' svn.dump bzr/

Download

The current development version may be obtained using the following Bazaar branch command:

  • bzr branch lp:svn2bzr

Check the Launchpad code tab to see how people have been working on the project.

Copyright (c) 2005-2009 Canonical Ltd.

License

svn2bzr is available under the GPL.

Author

svn2bzr was written by Gustavo Niemeyer <gustavo@niemeyer.net>