You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Tobias Pfeiffer <tg...@web.de> on 2010/03/25 10:48:23 UTC
merging repositories
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
Re: merging repositories
Posted by "Tobias G. Pfeiffer" <tg...@web.de>.
Hi,
thanks for your reply!
Am Donnerstag, 25. März 2010, 12:48 schrieb Jon Foster:
> Tobias wrote:
> > I have a project with two different repositories,
> > that I want to merge into one common repository.
>
> Would "svndumptool merge" do what you want?
>
> http://svn.borg.ch/svndumptool/
A comment at the top of svndump/merge.py says "handle copyfrom-rev !!!",
so I'm afraid it does not ;-)
I hoped that this repository merging would be a problem that many people
before me have experienced and that there would be an easy solution for
that... and still hope I don't have to touch the dumps to modify
revision numbers myself... but if so, is my interpretation (see below)
of what "svnadmin load" does correct, w.r.t. references to previous
revisions?
> ...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.
Regards,
Tobias
--
I may disagree with what you have to say, but I shall
defend to the death your right to say it.
-- Voltaire
RE: merging repositories
Posted by Jon Foster <Jo...@cabot.co.uk>.
Hi,
Tobias wrote:
> I have a project with two different repositories,
> that I want to merge into one common repository.
Would "svndumptool merge" do what you want?
http://svn.borg.ch/svndumptool/
(I haven't tried it, it's just something I found and
bookmarked when investigating Subversion)
> 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
>[...]
> Will "svnadmin load" keep the commit dates
Yes. They're just a revision property.
> and if so, what would be the outcome of, say,
> "svn update -r {someDate}"?)
Undefined (and unpredictable). My understanding is that this
does a binary search, which will go haywire if your dates
aren't monotonically increasing. So you can't use it on
such repositories.
Kind regards,
Jon
--
(Please direct all replies to the mailing list)
**********************************************************************
This email and its attachments may be confidential and are intended solely for the use of the individual to whom it is addressed. Any views or opinions expressed are solely those of the author and do not necessarily represent those of Cabot Communications Ltd.
If you are not the intended recipient of this email and its attachments, you must take no action based upon them, nor must you copy or show them to anyone.
Cabot Communications Limited
Verona House, Filwood Road, Bristol BS16 3RY, UK
+44 (0) 1179584232
Co. Registered in England number 02817269
Please contact the sender if you believe you have received this email in error.
**********************************************************************
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________