Hi,
I have a project with two different repositories, named "Base" and
"Develop" that I want to merge into one common repository. The simplest
way would surely be to say:
$ svnadmin dump Base/ base.dmp
$ svnadmin dump Develop/ develop.dmp
$ svnadmin load --parent-dir "Base/" Merged/ < base.dmp
$ svnadmin load --parent-dir "Develop/" Merged/ < develop.dmp
However, this does not semantically respect the correct time order, e.g.
files that have been developed in Develop/ and then later on moved to Base/
will appear earlier (= at a smaller revision number) in the merged repo
than their origins.
(In addition, I don't really know what happens with the dates of commits.
Will "svnadmin load" keep the commit dates and if so, what would be the
outcome of, say, "svn update -r {someDate}"?)
There is a script out there that does what I want:
http://www.cri.ensmp.fr/~coelho/svn-merge-repos.html
It does not much more than sort the commits from the input repositories by
date, dump each revision using --incremental and then load it into the
specified new repository. Now this becomes a problem when a commit (say,
rev100) from repoA refers to some commit in the past of repoA (say,
rev98).
- With a normal "svnadmin load" (loading repoA:rev100 into repoC:rev500),
this will work, as this command internally seems to say "don't use
revision number 98, but the commit two revisions before", which isn't 98
any more, but 498 now.
- However, if there has been an incremental dump from repoB loaded into
repoC in between, this will break, as "two commits before (in the old
repository)" will not refer to the same commit as "two commits before (in
the merged repository)" and - in my case - will refer to files that are not
existing any more.
Did the problem get clear to you?
How can I work around this? It is not a hard task, I guess, to store a
mapping "revision X from repoA means now revision Y in repoC" and compute
the correct revision number of the merged repository that I have to refer
to. But how can I make "svnadmin load" really *use* this newly computed
revision number?
Thanks for your help,
Tobias
Received on 2010-03-25 11:50:50 CET