/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar
4871.1.1 by Neil Martinsen-Burrell
Put in place a structure for the admin-guide
1
Migration
2
=========
3
4871.3.1 by Neil Martinsen-Burrell
A simple section on migration with pointers to the official Migration Guide.
4
Migrating between version control systems can be a complicated process, and
5
Bazaar has extensive documentation on the process at 
5050.22.1 by John Arbash Meinel
Lots of documentation updates.
6
http://doc.bazaar.canonical.com/migration/en and we won't attempt to repeat that
4871.3.1 by Neil Martinsen-Burrell
A simple section on migration with pointers to the official Migration Guide.
7
here.  We will try to give a few motivating examples for conversion from
8
Mercurial and Subversion.
9
4871.1.1 by Neil Martinsen-Burrell
Put in place a structure for the admin-guide
10
Fast Import
11
-----------
12
4871.3.1 by Neil Martinsen-Burrell
A simple section on migration with pointers to the official Migration Guide.
13
In many projects wishing to use Bazaar, there is pre-existing history for the
14
codebase that should be taken into consideration.  Bazaar leverages an
15
interchange format originally developed for Git called `fast-import` to
7490.130.1 by Jelmer Vernooij
Rename bzr to brz in a few more places.
16
provide migration strategies for many other version control systems.
4871.3.1 by Neil Martinsen-Burrell
A simple section on migration with pointers to the official Migration Guide.
17
18
The way that fast-import can be used for migration is to export the existing
7490.130.1 by Jelmer Vernooij
Rename bzr to brz in a few more places.
19
history into a fast-import file, then use the ``brz fast-import`` command.
4871.3.1 by Neil Martinsen-Burrell
A simple section on migration with pointers to the official Migration Guide.
20
The `fastimport` plugin includes exporters for Subversion, CVS, Git, Mercurial
21
and darcs, accessible as the ``fast-export-from-XXX`` commands.  Note that
22
``fast-import`` should not be used in a branch with existing history.
23
24
Assuming that ProjectX was first developed in Mercurial before switching to
25
Bazaar, and that the Mercurial repository is in ``/srv/hg/projectx``, the
26
following commands will import that history into a newly created ``trunk``
27
branch.  (Recall that in `Further Configuration
28
<simple-setups.html#further-configuration>`_ we created the
29
``/srv/bzr/projectx`` directory as a shared repository.)
30
31
::
32
33
  $ cd /srv/bzr/projectx
7192.3.4 by Jelmer Vernooij
s/bzr/brz.
34
  $ brz fast-export-from-hg ../../hg/projectx projectx.fi
35
  $ brz init trunk
36
  $ brz fast-import projectx.fi trunk
4871.3.1 by Neil Martinsen-Burrell
A simple section on migration with pointers to the official Migration Guide.
37
4871.1.1 by Neil Martinsen-Burrell
Put in place a structure for the admin-guide
38
Subversion Conversion
39
---------------------
4871.3.1 by Neil Martinsen-Burrell
A simple section on migration with pointers to the official Migration Guide.
40
41
As the most common centralized version control system, migration from
42
Subversion is particularly important for any *new* version control system.
43
Bazaar's `svn`_ plugin provides tools for interaction with Subversion
44
projects.  In fact, Bazaar can be used transparently with projects stored in
45
Subversion, but that is beyond the scope of this document.  (See
6437.5.1 by Vincent Ladeuil
Fix wrong url in admin guide
46
http://doc.bazaar.canonical.com/migration/en/foreign/bzr-on-svn-projects.html for
4871.3.1 by Neil Martinsen-Burrell
A simple section on migration with pointers to the official Migration Guide.
47
more on that subject.)  What is relevant here is the ``svn-import`` command
48
provided by that plugin.  This can import an entire subversion repository
49
including tags and branches, particularly if they are stored in Subversion's
50
recommended directory structure: ``/tags/``, ``/branches/`` and ``/trunk/``.
51
52
This command has flexible ways to specify what paths within the Subversion
53
repository contain branches and which contain tags.  For example, the
54
recommended layout for Subversion projects (called ``trunk`` by the svn
7290.2.1 by Jelmer Vernooij
Update references to home location.
55
plugin) could be specified in ``~/.config/breezy/subversion.conf`` as
4871.3.1 by Neil Martinsen-Burrell
A simple section on migration with pointers to the official Migration Guide.
56
57
::
58
59
  [203ae883-c723-44c9-aabd-cb56e4f81c9a]
60
  branches = branches/*
61
  tags = tags/*
62
63
This allows substantially complicated Subversion repositories to be converted
64
into a set of separate Bazaar branches.  After installing the svn plugin, see
7490.130.1 by Jelmer Vernooij
Rename bzr to brz in a few more places.
65
``brz help svn-import`` and ``brz help svn-layout``.
66
67
.. _svn: http://launchpad.net/brz-svn
68
69
.. TODO: Legacy VCS to brz sync.  Tailor?  Incremental conversions?