Reputation: 2792
I would like to use Bazaar for working with a project that uses Subversion and has a very long history. For example svn://svn.freebsd.org/base/head
.
There is a good plugin bzr-svn
which can be used to work with SVN repositories. There are some examples of relevant workflows here.
My issue is that everything that I have found seems to be written with an assumption that I want to import the full history from SVN. I do not want to do that. It takes too much disk space (and in reality the import will run out of memory if I try). I really do not care about any changes before a certain SVN revno/tag. But I do want to have each individual commit after the cutoff point to show up properly on the Bazaar side. How can I accomplish that?
I basically want the following logic for my vendor branch (from which I can make my local branches):
svn co svn://svn.freebsd.org/base/head -r CUTOFF_REVNO
while true
do
svn up -r NEXT # note: NEXT is not possible even though there is PREV
bzr commit
sleep N
done
Obviously the above does not store the commit messages and other such things in Bazaar, which is a problem. I could make this a daily cron job which just does svn up
and commits all the SVN changes within a day into the Bazaar branch in one single daily commit.
How can I accomplish this so that the meta-data and individual commits are properly converted to Bazaar (with the same granularity as they happen on the SVN side)? I do not need to be able to push into the SVN. All I need is a one-way solution. I hope there is a tool somewhere which can do exactly this!
Upvotes: 3
Views: 179
Reputation: 2792
I think I found a potential solution, so I am answering myself.
There is a tool called Tailor which can do exactly this. It is a generic solution, thus it works with most popular version control systems (such as CVS, SVN, Bazaar, Mercurial, Git, Darcs and some others).
To accomplish what I asked I need the following configuration file, for example freebsd-tailor.conf
:
[DEFAULT]
verbose = True
projects = freebsd-current
[freebsd-current]
root-directory = /home/tailor/freebsd-current
subdir = upstream
source = svn:freebsd-current
target = bzr:freebsd-current
start-revision = 225424
[svn:freebsd-current]
repository = svn://svn.freebsd.org/base
module = /head
encoding = iso-8859-1
[bzr:freebsd-current]
Then I just run tailor -c freebsd-tailor.conf
to do the initial synchronization at revno 225424 and re-run the command every time I want to incrementally fetch the new changes after that.
I am currently testing this. I will update my answer with any success or failure. Other solutions are still welcome. :)
UPDATE:
I made the configuration example a bit simpler and added encoding
entry which seems to be required with many projects.
The result of my testing so far is that tailor is unfortunately not very robust with large projects (such as in my example). One subdirectory is missing for some reason in my bzr repository and pulling the updates with tailor is very slow and takes a lot of resources. Maybe it works fine with small projects. I like how tailor has so many back-ends to different VCSes and is neutral about their differences.
Upvotes: 2