Import from a svn repository with non standard layout
Hi,
I would like to convert a svn repository to multiple bzr branches. However the svn repo does not have exacly the classic {trunk, branches, tags} layout.
The first point is that the root of the project is a subdirectory of the repository.
Second, the branches/ directory was subdivided into several parts. For example each user has its own "private" directory for his branches. In each user directory, some directory are branches (svn cp) of trunk, other directory are branches of branches.
(see figure below)
repository/
+- ProjectFoo/
+-trunk/ # normal trunk
|
| +- User1/
| | +- feature1/ # trunk branch for feature1
| | |
| | +- feature2/ # trunk branch for feature2
| | |
| | +- feature2b/ # feature 2b is a svn cp of feature2 (a branch of the branch)
| |
| |+- User2/
| |
| |+- feature3/ # some branches do not belong
| # to any user but are directly in the
| # branches/ directory
|
|
|+- tags/
I'm looking for a way to extract each individual branch into a bzr branch, keeping the history from the first revision of trunk when possible. For example, say that feature1/ is a "svn cp" of trunk from revision 100. I would like to keep in the bzr branch the history from revisions 1 to 100, as well as additional features added in revisions 102 to the latest one (here rev 101 is just the svn cp command. I don't know if this must be translated into bzr concepts).
I have tried with the svn2bzr tool but I did't find a correct set of options to do what I want. The best I could obtain was a partial history of feature2, from revision 101 to the latest one. So revision 1 in the new bzr branch was the state of trunk at rev 100, all 99 previous commits information were lost.
I'm now trying to better with bzr fast-export/
Can someone give me some hints about the correct commands for fast-export-
import feature2 and feature2b directories, OR any working method to correctly convert out svn history to bzr branches.
Thanks for your time.
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- Bazaar Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Adrien Saladin
- Solved:
- 2010-01-29
- Last query:
- 2010-01-29
- Last reply:
Hello again,
Just somme more information about the bzr internal error. This happens when I try to do a bzr fast-import of my fast-exported svn repository. I have tried several options for the fast-export command, like changing paths for trunk and/or branches.
I can't tell if it's really a bzr bug since I don't know if I'm correctly using fast-export-
Thank you.
$ bzr fast-import ptools.fi ptoolsbzr
01:10:23 Collecting statistics ...
01:10:23 Starting import of 255 commits ...
ABORT: exception occurred processing commit @211
bzr: ERROR: exceptions.
Traceback (most recent call last):
File "/usr/lib/
return the_callable(*args, **kwargs)
File "/usr/lib/
ret = run(*run_argv)
File "/usr/lib/
return self.run(
File "/usr/lib/
params, verbose, user_map=user_map)
File "/usr/lib/
return proc.process(
File "/usr/lib/
self.
File "/usr/lib/
processor.
File "/usr/lib/
handler(self, cmd)
File "/usr/lib/
handler.
File "/usr/lib/
self.
File "/usr/lib/
super(
File "/usr/lib/
self.revision = self.build_
File "/usr/lib/
self.
File "/usr/lib/
name_no_ext = self._git_
IndexError: list index out of range
bzr 2.0.2 on python 2.5.4 (Linux-
arguments: ['/usr/bin/bzr', 'fast-import', 'ptools.fi', 'ptoolsbzr']
encoding: 'UTF-8', fsenc: 'UTF-8', lang: 'fr_FR.UTF-8'
plugins:
bzrtools /usr/lib/
explorer /home/adrien/
fastimport /usr/lib/
launchpad /usr/lib/
netrc_
qbzr /home/adrien/
rebase /usr/lib/
search /usr/lib/
svn /usr/lib/
*** Bazaar has encountered an internal error. This probably indicates a
bug in Bazaar. You can help us fix it by filing a bug report at
https:/
including this traceback and a description of the problem.
Hi Adrien,
It looks like a bzr-fastimport bug. I'll take a look.
Adrien,
Can you try with the latest bzr-fastimport trunk, .i.e. rev 271 or later. (That code in branch_mapper.py no longer exists.)
I have updated bzr-fastimport to rev 271. Since the error message is different I guess bzr is using this new version instead of my linux distribution version.
However I still have an error. The error message is clearer and does not trigger an exception:
$ bzr fast-import ptools.fi ptools.bzr
13:03:41 Collecting statistics ...
13:03:41 Starting import of 255 commits ...
ABORT: exception occurred processing commit @211
bzr: ERROR: An inconsistent delta was supplied involving u'/SConstruct', 'sconstruct-
reason: New path is not consistent with parent path.
OK. Let's convert this to an bug on bzr-fastimport. Could you try running with -Derror and recording the full exception in the bug report please?
Hi Ian,
I pasted the log below. Please tell me if you need an access to the svn repository.
Thanks,
$ bzr fast-import ptools.fi ptools.bzr -Derror
09:06:47 Collecting statistics ...
09:06:47 Starting import of 255 commits ...
ABORT: exception occurred processing commit @211
bzr: ERROR: bzrlib.
reason: New path is not consistent with parent path.
Traceback (most recent call last):
File "/usr/lib/
return the_callable(*args, **kwargs)
File "/usr/lib/
ret = run(*run_argv)
File "/usr/lib/
return self.run(
File "/home/
params, verbose, user_map=user_map)
File "/home/
return proc.process(
File "/home/
self.
File "/home/
processor.
File "/home/
handler(self, cmd)
File "/home/
handler.
File "/home/
self.
File "/home/
self.
File "/home/
builder.
File "/usr/lib/
self.parents)
File "/usr/lib/
basis_
File "/usr/lib/
"New path is not consistent with parent path.")
InconsistentDelta: An inconsistent delta was supplied involving u'/SConstruct', 'sconstruct-
reason: New path is not consistent with parent path.
Ok, I solved my problem of importing from svn with "bzr svn-import".
(thanks to mzz for the suggestion).
I will fill a separated bug report for bzr-fastimport.
