Attempting to import svn repository gives apparently empty directory

Asked by Martin Morrison

I have an svn repository with ~1000 revisions, and the following layout:

endets/
  branches/
    endets-2.1/
  tags/
    endets-2.0.0/
    endets-2.0.1/
  trunk/
<project2>/
<project3>/

(only the 'endets' project is of interest here. The others have similar structures though)

Subversion is not meeting my needs, so I'd like to switch to bzr. The best case scenario will allow me to easily use the new bzr repo/branches to merge changes committed to the trunk since the 2.1 branch was created into the 2.1 branch. This doesn't work in svn because the 2.1 branch involves a total reshuffle of all the code, and so things don't patch.

However, I'd be happy just to have the branch history imported (and manually resolve things this once), so that I can in future use bzr to handle merges between branches.

The problem is when I try to import, I get apparently empty directories:

With Intrepid (bzr 1.6.1-1, bzr-svn 0.4.13-2), and the command 'bzr svn-import --all --scheme=trunk --prefix=endets/ svn+ssh://<hostname>/var/repository endets', it appears to work, but 'bzr branches' gives no output at all on the target directory. 'bzr branch' and 'bzr co' give 'bzr: ERROR: Not a branch: "/home/martin/bzr/endets/.bzr/branch/".

Using the latest bzr (bzr 1.12-1~bazaar1~intrepid1, bzr-svn 0.5.0-1) from the PPA, I get:

- 'bzr svn-import --all --layout=trunk --prefix=endets/ svn+ssh://<hostname>/var/repository endets' gives the error 'bzr: ERROR: The specified path is inside a branch. Specify a different URL or a different repository layout.'

- 'bzr svn-import --all svn+ssh://<hostname>/var/repository repo' again appears to do something, but 'bzr branches' now prints a single empty line.

All of the above svn-import commands return 0, and there doesn't appear to be anything odd in .bzr.log (it mentions the files it is importing as it goes, then reports '0.421 return code 0' or similar).

Where am I going wrong? :-) It is possible to achieve what I'm trying to achieve, and if so how?

Cheers,
Martin

Question information

Language:
English Edit question
Status:
Answered
For:
Bazaar Subversion Plugin Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Jelmer Vernooij (jelmer) said :
#1

Looks like you want the trunk1 scheme (since there's one level of
indentation). Not specifying a scheme should also do the right thing.

You might also want to try bzr-svn 0.5.0 instead of 0.4.x.

Cheers,

Jelmer
--
Jelmer Vernooij <email address hidden> - http://samba.org/~jelmer/
Jabber: <email address hidden>

Revision history for this message
Martin Morrison (isoschiz) said :
#2

Thank Jelmer. However, this still hasn't quite worked!

(all of this was done with bzr-svn 0.5.0)

If I use the trunk1 layout, with no prefix, then it works successfully, but imports all of the branches for all of the projects in the Subversion repository:

~/bzr$ bzr svn-import --all --layout=trunk1 svn+ssh://<hostname>/var/repository/ endets/
Using repository layout: trunk1
~/bzr$ bzr branches endets/
endets/branches/endets-2.1
endets/trunk
entunnel/trunk
enwiki/trunk
enxr-test/trunk
greasemonkey/trunk
<etc, etc>

If I attempt to import using a --prefix, I get:

~/bzr$ bzr svn-import --all --layout=trunk1 --prefix=endets/ svn+ssh://<hostname>/var/repository/ endets/
bzr: ERROR: The specified path is inside a branch. Specify a different URL or a different repository layout.

I get the same error if I use 'trunk' (my logic being that by the time you've removed the 'endets/' prefix, that is the layout) or omit the --layout completely.

Is there a way I can extract *just* the two 'endets' branches from the repository? Or, perhaps, a way of separating the repositories after the initial all-in-one import from svn?

Thanks for your help,
Martin

Revision history for this message
Jelmer Vernooij (jelmer) said :
#3

On Fri, 2009-02-27 at 00:16 +0000, Martin Morrison wrote:
> Question #61528 on Bazaar Subversion Plugin changed:
> https://answers.launchpad.net/bzr-svn/+question/61528
>
> Status: Answered => Open
>
> Martin Morrison is still having a problem:
> Thank Jelmer. However, this still hasn't quite worked!
>
> (all of this was done with bzr-svn 0.5.0)
>
> If I use the trunk1 layout, with no prefix, then it works successfully,
> but imports all of the branches for all of the projects in the
> Subversion repository:
>
> ~/bzr$ bzr svn-import --all --layout=trunk1 svn+ssh://<hostname>/var/repository/ endets/
> Using repository layout: trunk1
> ~/bzr$ bzr branches endets/
> endets/branches/endets-2.1
> endets/trunk
> entunnel/trunk
> enwiki/trunk
> enxr-test/trunk
> greasemonkey/trunk
> <etc, etc>
>
> If I attempt to import using a --prefix, I get:
>
> ~/bzr$ bzr svn-import --all --layout=trunk1 --prefix=endets/ svn+ssh://<hostname>/var/repository/ endets/
> bzr: ERROR: The specified path is inside a branch. Specify a different URL or a different repository layout.
I think this may actually be a bzr-svn bug, fixed in trunk.

> Is there a way I can extract *just* the two 'endets' branches from the
> repository? Or, perhaps, a way of separating the repositories after
> the
> initial all-in-one import from svn?
You can just "bzr branch" into a different bzr repository after the
initial import. Similarly, you can "bzr branch" the individual endets
branches.

Cheers,

Jelmer

--
Jelmer Vernooij <email address hidden> - http://samba.org/~jelmer/
Jabber: <email address hidden>

Can you help with this problem?

Provide an answer of your own, or ask Martin Morrison for more information if necessary.

To post a message you must log in.