[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Merging 2 divergent copies of the same repository.

From: David Wilson <dw_at_botanicus.net>
Date: Wed, 28 May 2008 19:51:39 +0100

[Please CC: dw_at_botanicus.net in replies, I am not subscribed]

Some time ago I made a copy of a personal repository on another host.
I made several new local checkouts of this repository and made a
number of commits. In the meantime, I managed to forget that I hadn't
completed migrating from the old copy, and so committed several
changes in old working copies to that repository too.

A year later, I now have 2 repositories with the same UUID and mostly
the same content, diverging in the later revisions.

Thinking about the problem, I supposed I could use "svnadmin dump
--incremental|svnadmin load" to fix this, as long as there are no
conflicting revisions in either repository. I checked this with:

   B=file:///Users/dmw/dw_from_b/
   P=file:///Users/dmw/Library/Subversion/dw/
   FIRST_DIVERGENT_REV=661

   svn log -vr $FIRST_DIVERGENT_REV:HEAD $B|grep '^ [A-Z] /'|cut
-c6- |sort|uniq > b.changed
   svn log -vr $FIRST_DIVERGENT_REV:HEAD $P|grep '^ [A-Z] /'|cut
-c6- |sort|uniq > p.changed
   comm -12 [bp].changed

This builds a list of files changed in the two repositories, then uses
the comm program to discover if either set of revisions modifies the
same set of files. I was glad to discover that the two sets of
revisions do not affect the same files.

So my thinking is that this should work fine:

   svnadmin dump --incremental -r 661:HEAD dw_from_b | svnadmin load dw

I tried this and it seems to work.

My question is: what sanity checks does svnadmin apply while loading
revisions? Can I assume that if svnadmin succeeded, any invocation of
"svn diff", "svn co -r", etc., should succeed and return a consistent
working copy?

In my mind, what I have tested for (conflicting changes to files), and
my svnadmin invocations should fix things up, but I'm terrified of not
checking for something that I really should be checking, and
potentially corrupting my personal repository, only to find out in 5
years time or something.

Help!

Thanks,

David.

-- 
Science without religion is lame, religion without science is blind.
 — Einstein
Received on 2008-05-29 08:44:33 CEST

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.