How do you import a subdirectory from svn into bzr

Asked by Jason Spashett on 2008-06-18

My subversion repository is structured like this:

/trunk/gltest
/trunk/other-stuff
...and so on

I ran bzr svn-import --prefix=/trunk/gltest main.bistromath main.bzr

The result is an apparently empty bzr repository. I've tried variations of the prefix option to no avail. Running without the --prefix option works correctly but imports the whole svn repository, which isn't what I would like.

bzr-svn Version: 0.4.9-1 from the hardy repository

Question information

Language:
English Edit question
Status:
Solved
For:
Bazaar Subversion Plugin Edit question
Assignee:
No assignee Edit question
Solved by:
Jason Spashett
Solved:
2008-06-23
Last query:
2008-06-23
Last reply:
2008-06-23
Jelmer Vernooij (jelmer) said : #1

On Wed, Jun 18, 2008 at 03:24:52PM -0000, Jason Spashett wrote:
> New question #36625 on Bazaar Subversion Plugin:
> https://answers.launchpad.net/bzr-svn/+question/36625

> My subversion repository is structured like this:

> /trunk/gltest
> /trunk/other-stuff
> ...and so on

> I ran bzr svn-import --prefix=/trunk/gltest main.bistromath main.bzr

> The result is an apparently empty bzr repository. I've tried variations of the prefix option to no avail. Running without the --prefix option works correctly but imports the whole svn repository, which isn't what I would like.

> bzr-svn Version: 0.4.9-1 from the hardy repository
You may want to set a branching scheme for your repository to make
bzr-svn deal with the unusual layout. Alternatively (and simpler, probably),
just run "bzr branch <repos-url>/trunk/gltest", etc for each branch in
your repository.

Cheers,

Jelemr
--

Jason Spashett (jspashett) said : #2

I don't understand what you mean by "bzr branch <repos-url>/trunk/gltest" I've tried both of these anyway:

where /tmp/main.bzr is a full svn repository converted to bzr
and /var/svn/main is the svn repository.

I didn't think you could use bzr branch to branch a subdirectory.

jason@firefly:/tmp$ bzr branch file:///tmp/main.bzr/trunk/gltest
bzr: ERROR: Not a branch: "/tmp/main.bzr/trunk/gltest/".
jason@firefly:/tmp$ bzr branch file:///var/svn/main/trunk/gltest
bzr: ERROR: Not a branch: "/var/svn/main/trunk/gltest".

What I am after is the subdirectory gltest from the svn repository converted to a bzr repository/branch, with all the history.

Jelmer Vernooij (jelmer) said : #3

You can't use bzr branch to branch a subdirectory.

However, /var/svn/main/ is not a branch but rather a repository. Subversion doesn't have the
concept of branches so it's up to bzr-svn to decide what is considered a branch.

The command:

jason@firefly:/tmp$ bzr branch file:///var/svn/main/trunk/gltest

should work. What error do you see in ~/.bzr.log ?

Jason Spashett (jspashett) said : #4

I get:

jason@firefly:/tmp$ bzr branch file:///var/svn/main/trunk/gltest
bzr: ERROR: Not a branch: "/var/svn/main/trunk/gltest".

But I see that infact the url I have supplied is wrong.

It should have been file:///var/svn/main/gltest and it now does work just as you said.

Sorry about my erroneous url and thank you for your help Jelmer.