Bazaar for Subversion users (was: Short, task-based bzr doclets for real-world use cases.)

Ben Finney bignose+hates-spam at benfinney.id.au
Fri Jan 16 09:39:17 GMT 2009


Matt Doran <matt.doran at papercut.com> writes:

> In addition to Karl's "getting started" use-cases, I think something
> that would *greatly* help the bzr adoption rate is simple guides to
> transitioning from other VCSs (like subversion). There are millions
> of svn users out there, and simplifying the transition will
> definitely bring users to bzr.

You may not be aware of <URL:http://bazaar-vcs.org/BzrForSVNUsers>
which appears intended to address exactly this audience.

If you're not aware of it, that certainly is something that needs to
be fixed. Where would you expect to find such a document?

I know that I didn't find it by searching for "bazaar for subversion
users"; perhaps that's a first approximation to a fix.

> Some of the things I've wondered an not found simple/obvious answers
> to:

Caveat: I'm a Bazaar user primarily, and a Subversion user only to the
extent that I need to interact with other Subversion users.

>    * How do I convert my svn repo to bzr and then publish it?

You need to enable Bazaar to talk with Subversion. That's done by
installing the +IBg-bzr-svn+IBk- plugin, preferably via your operating
system's package manager.

To command to branch from a Subversion branch to a new Bazaar one is:

    $ bzr branch svn://example.com/repo-name/branch-name/ ./branch-name/

To publish the branch, use existing publishing protocols :-) Make the
directory accessible via one of the remote-access schemes Bazaar
supports: HTTP, SFTP, SSH, +ICY-.

There is an optional +IBw-smart server+IB0-, but it's not needed. Optional,
actually.

>    * My svn repo contains multiple independent projects, each with
>    their own trunk/branches/tags sub folders .... how would I
>    convert this to bzr?

Administration of Bazaar repositories isn't a centralised affair, and
having multiple branches in a repository is only helpful if those
branches are likely to share much of their revision data.

>      Can I have a single repository? Or a separate one for each
>      project?

The recommendation is to have one repository per project (if you want
to create repositories manually).

    $ bzr init-repository project-name/
    $ cd project-name/
    $ bzr init trunk/
    $ cd trunk/
    $ # hack hack
    $ make test
    $ bzr add
    $ bzr commit

Alternatively, you don't have to manage repositories at all, and
Bazaar will create one per branch.

>    * Which bzr repo format should I use?

Unless you know specifically that you want some non-default, you
should use the default format created by whatever version of Bazaar
you're using.

>    * How does using a foreign branch (bzr branch svn://blah)

Note that +IBg-branch+IBk- creates a new, local, branch. Use it when you
intend to commit into that branch and want the revision data separate
from the parent branch's revision data.

You will likely be comfortable with checkouts, which allow Bazaar to
use the centralised development model: the revision data is stored in
a remote repository while the working tree is local.

I use checkouts very frequently, and it's a killer feature of Bazaar
as I see it. No other VCS makes it within *my* power how centralised
or distributed I want to be, and change when it makes sense to do so.

>      differ from converting the repo using svn-import (or svn2bzr)?
>      When would I choose one over the other?

Use a checkout if you want to continue following the upstream
Subversion branch as it changes. Use an +IBw-import+IB0- process to one-time
get all the revision data into a Bazaar branch.

> There's scattering of information on these topics ... but it's hard
> to get a clear picture of the steps. It would be great if the
> transition from other VCSs could also be added to your list!

Agreed. There are corresponding BzrForGitUsers et al, but I think
they're insufficiently publicised +IBQ- or perhaps they don't yet do the
job? I don't know.

-- 
 +AFw-       +IBw-Instead of having +IBg-answers+IBk- on a math test, they should just |
  `+AFw-               call them +IBg-impressions+IBk-, and if you got a different |
_o__)   +IBg-impression+IBk-, so what, can't we all be brothers?+IB0- +IBQ-Jack Handey |
Ben Finney




More information about the bazaar mailing list