Over the past week or so I've been working on ways to mirror
Subversion repositories over our RA layers. Initially, I started out
trying to clone the work that clkao did in his SVN::Mirror perl
module, with the slight simplification that I was only interested in
copying an entire repository, not a subset of one.
Unfortunately, I came to the conclusion that you can't actually create
an exact copy of a repository via the current RA API. Since the diff
and update editors don't provide you with copyfrom information, you
have to use the log API to get that information. Once you have that
you can recreate the copies correctly (although it takes a fair amount
of hairy logic to get it right), but there's still one problem, you
can't tell the difference between a plain copy and a copy that
includes additional textual modifications.
I suppose I could try detecting that case by diffing copied files with
the source, but that was one hoop too many for me to be willing to
jump through, so I broke down and started thinking of what kind of RA
API I'd really like to use for this sort of thing.
What I came up with was the idea of exposing the svn_repos_replay API
(which is what svn_repos_dump uses under the hood), so you can
actually drive an editor through the correct sequence of commands
needed to reproduce the change in a given revision. This isn't quite
as straitforward as just exposing the existing API, since the current
replay code doesn't actually produce text and property deltas (since
dump doesn't really need them, since it calculates them on its own),
but the change to enable that behavior is pretty small.
I'm kind of hoping that this sort of API will be useful to other
programs that try to copy revision history from one repository to
another, like SVK, but I honestly don't know enough about their exact
needs to say if this is correct. It does work for the use case I was
working on though, full repository replication.
Anyway, here's a preliminary patch people can look at, it doesn't
implement the ra_dav side of things (I only had time to get ra_svn and
ra_local working today), doesn't update the ra_svn protocol document,
and it doesn't include the actual tool I'm writing to make use of this
API, because I still need to clean that up a bit, but it should be
able to give people something to comment on.
So what do you think? Good idea? Bad idea?
-garrett
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Nov 10 02:25:50 2005