Can someone help describe the workflow when using bzr-svn...
Jean-Francois Roy
bahamut at macstorm.org
Sat May 2 05:58:00 BST 2009
I've been working for a while now with Bazaar as my main VCS system at
work, where interfacing with Subversion repositories is absolutely
critical. Here's the workflow I have more or less settled on:
- For each project, create yourself a repository with no trees using
the 1.9-rich-root or 1.14-rich-root formats (bzr init-repo --
format=1.14-rich-root --no-trees). This will allow efficient storage
of the branches for the project and fast switching between local
branches. I also enjoy having a single working tree per project, so
the no trees option suits me.
- Branch the Subversion branch you're interested in for a given
project. So for example branch in trunk.
- Make a lightweight checkout to create your working tree (bzr co --
lightweight <branch> <working tree directory>). If you're going with
this workflow, you'll only have one working tree per project and
switch which branch the checkout points to as needed. This is very
similar to what you would get with git. I find that having a single
working tree path per project makes things easier and is less
confusing than having multiple working trees.
- To switch branch, all you have to do is 'bzr switch <branch name> '
within the working tree. bzr is smart enough to look next to the
branch the checkout is pointing to for other branches. You can of
course use any other path.
- I always branch any Subversion branch to a local work branch.
Otherwise, you will either have to use rebasing if the Subversion
branch has diverged (received commits since you last pulled from it)
or need to re-branch it and merge. In order words, I never commit to
the direct child of a Subversion branch.
- When I want to push to Subversion, I switch to the direct Subversion
child branch, pull, merge in my work branch, commit and push.
Alternatively, you can use checkouts for the direct Subversion child
branches. I don't like that as much as the above because checkouts
always have a working tree, but on the other hand it prevents the
local direct child from diverging from its Subversion parent.
Jeff
On Apr 30, 2009, at 18:35, John Szakmeister wrote:
> On Thu, Apr 30, 2009 at 5:54 PM, Jelmer Vernooij <jelmer at samba.org>
> wrote:
> [snip]
>> This matches the actual contents in your local branch though; only
>> the
>> last revision in your branch would contain the other revisions on
>> mainline that you merged (see the output of "bzr log" on your local
>> branch).
>
> I realize that... nut it's awkward for svn users to see. It looks
> like I changed much more than I actually did. And makes merging that
> much more difficult, because you don't know which revision of the
> commit to apply to a branch. We ran into this in one case, and
> decided it was we definitely didn't want to directly push our local
> branches back into trunk after that.
>
> [snip]
>> Can you specify a bit more information? Even just the backtrace
>> with any
>> private data removed would be a big help.
>
> Unfortunately, I can't do that. But I did take the time to reproduce
> it in a script. The short form: you make have an svn:author value
> set. When I was playing with this stuff locally, I just gave anon
> write access to make things go. Turns out that's what causes the
> backtrace. I've attached a script demonstrating this. If you
> uncomment the commented lines (and remove the one svn ci line), you'll
> see everything work as expected.
>
>> If you don't want mainline to be changed you definitely don't want to
>> use merge on the mainline that you're going to push to. You can
>> e.g. use
>> rebase with dpush. Or you can use a checkout and work in a svn-like
>> manner.
>
> I thought I had done the rebase and dpush thing before, and wasn't so
> sure when I encountered the backtrace. But looking at my scripts, I
> tested all this stuff before... but was more interested in maintaining
> a separate branch, so I didn't play with this much. It absolutely
> looks like 'bzr rebase' and 'bzr dpush' are what I want to use.
>
> Thanks Jelmer!
>
> -John
> <kill-bzr-svn.sh>
More information about the bazaar
mailing list