Using local Bazaar checkouts from a remote Subversion repository

John Szakmeister john at szakmeister.net
Tue Oct 19 16:58:02 BST 2010


On Tue, Oct 19, 2010 at 11:10 AM, Tom Browder <tom.browder at gmail.com> wrote:
> I think I'm in trouble and I know folks here can set me straight again.
>
> Step 1:  I wanted a local network bzr checkout from a subversion repo
> on remote host A.  On local network host B I started a bzr repo:
>
> $ bzr init repodir
> $ cd repodir
> $ bzr checkout svn+ssh://hostA//path/to/svn/repo repo
>
> Step 2:  On local host C I started another bzr repo:
>
> $ bzr init repodir
> $ cd repodir
> $ bzr checkout bzr+ssh://hostB//path/to/bzr/repodir repo
>
> Then, on host C, worked happily away:
>
> $ cd repodir
> # hack, commit, hack, commit
> # all commits accepted on host B
>
> Now I want to go back to host B and commit changes back to the
> subversion repo on host A
> $ ssh hostB
> $ cd repodir
> $ bzr update
> $ bzt commit
> # nothing to commit!!!
> # specific attempts to merge back to host A don't work

Judging by the output, are you certain you made a checkout on hostB?
I'm guessing you may have actually created a branch.  In which case,
update isn't talking to the remote repository.  Either that, or your
connection has been up the whole time, and the changes are already in
Subversion.

> I think, after step 1 on host B, I should have made a branch of the
> bzr/svn checkout and then, in Step 2 on host C, checked out from that
> branch.
>
> Note that I never gave any unbind commands, and the remote host A is
> normally not available because I have to vpn to it from local host B.

If that's the case, I'm not sure how your commits to B succeeded,
unless the checkout on B was indeed a branch (if you were committing
to a checkout, I'd expect them to be automatically mirrored into
Subversion).  Perhaps you said to commit locally (via --local)?

> My rationale for my strange setup is that B is my local server and
> backup host, and C is my laptop, my primary working device, that must
> be able to work off any network.
>
> So two questions, please:
>
> 1. How can I recover and get the new stuff from my local network
> branch on host B pushed or merged back into the subversion repository
> on remote host A?

To start, you need to know what you have on B (whether it's a branch
or a checkout).

> 2. Is there a better solution to my requirements: subversion
> repository => bzr repository => bzr repository?

You may want to read a couple of blog entries that I wrote.  I've been
talking about some of my experiences with Bazaar and Subversion
integration, and some of the pitfalls I've been running into.  I'm
certainly willing to answer any other questions you might have on this
front too.  The blog posts are here:
  * http://www.szakmeister.net/blog/2009/oct/12/bazaar-subversion-super-client/
  * http://www.szakmeister.net/blog/2010/may/30/bzr-svn-round-2/

I'm still learning things, and trying to understand all the
integration details, but it may help you get to a more useful
workflow.  FWIW, I'd be more tempted to use branches (versus
checkouts) for more of your workflow.  But it really depends on you
and your comfort with doing that.

HTH!

-John



More information about the bazaar mailing list