You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Ingo Schmidt <ic...@der-ingo.de> on 2007/03/06 16:04:13 UTC

svndumpfilter

Hi everyone!

Let's say I do have a dumpfile of a repository with projects name like
that:

/ProjectA
/ProjectAB
/ProjectABC

Now I want to use svndumpfilter to split this up into 3 single
dumpfiles. One would think to do something like this:

cat dumpfile | svndumpfilter include ProjectA > project_a.dump
cat dumpfile | svndumpfilter include ProjectAB > project_ab.dump
cat dumpfile | svndumpfilter include ProjectABC > project_abc.dump

This, however, fails, because project_a.dump still contains all
projects. No wonder, the project names all start with the same string.

So I thought, mabye something like this would do the trick:
svndumpfilter include "ProjectA/"

But no, svndumpfilter simply ignores a trailing slash. It is picky
about leading slashes though (according to svn book), why does it not
accept trailing ones?

So my only way to achieve the splitting is really to write a big set
of exclude filters, so many, that only the desired project remains?

You may think, where the big deal is to write a set of excludes. Well,
the dumpfile I had to work on was really big, had tons of projects in
it and was auto created by a VSS->SVN conversion script. So it also
included some poject names I had no idea that they actually exist.

It just made the whole conversion process so much more complicated and
awkward.

Or do I not know svndumpfilter well enough and oversaw a simple
solution?



Cheers, Ingo =;->

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

svndumpfilter

Posted by Ingo Schmidt <ic...@der-ingo.de>.
Hi everyone!

I have asked this before but got no reply, so lets bring this up
again.

Let's assume I have an svn dumpfile that would create the following
repository if I "svnadmin load" it:

trunk
  Project A
    Sub A1
    Sub A2
  Project AB
    Sub AB1
    Sub AB2
  Project ABC
    Sub ABC1
    Sub ABC2

Now I want to split this into 3 single repositories called "Project
A","Project AB" and "Project ABC" respectively.
The layout of the to-be-created repositories shall be like that (X = {A, AB, ABC}):

Project X:
trunk
  Sub X1
  Sub X2

So let's say I want to split off Project A. I tried:

1. cat dumpfile | svndumpfilter include "trunk/Project A" > "Project A"
2. cat dumpfile | svndumpfilter include "trunk/Project A/" > "Project A"

This fails. All projects get included, since all project names start
with "Project A". I do understnad this in the first case, but not in
the second.

So the only approach left seems to be to exclude everything except
what I want:

cat dumpfile | svndumpfilter exclude "trunk/Project AB" "trunk/Project ABC" > "Project A"

In my example case this is no problem, but given a really big
repository one will have to write really long exclude filters. Is that
really the only way?

Ok, now that I have written up all my exclude filters comes the
second problem:

I do want to get rid of the folders called "Project X". In my split up
repositories there will be one folder level less!

So I could run svndumpfilter again, this time on one of the split
dumpfiles and including "trunk/Project X". That will exclude the node
where "trunk" is being created. Then, in the dumpfile, I rename
"trunk/Project X" to "trunk" (e.g. via sed) and I am done.

That is a lot of svndumpfilter and also sed and it takes bloody ages
to do it like that. I have come across this while porting a rather big
VSS database to Subversion. In the end I succeeded, everything got
ported and split up well. But it took many many hours, because working
like this with svndumpfilter and sed on dumpfiles of the size > 2GB is
not that cool, IMHO.

Or did I simply not see easier ways of splitting this?


Cheers, Ingo =;->

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org