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

Re: Recreate repository with proper structure trunk/branches/tags - without losing change history?

From: Dave Neary <david_at_phenix.fr>
Date: 2004-09-29 17:41:32 CEST

Hi,

Ian Brockbank wrote:
>>Is there a simple way of recreating/changing my repository
>>without losing change history?
>
> svn mkdir http://path/to/repos/trunk/
> [for each entry in the repository root:]
> svn move http://path/to/repos/entry http://path/to/repos/trunk/entry
> svn mkdir http://path/to/repos/branches/
> svn mkdir http://path/to/repos/tags/

An alternative way to do this is
$ svnadmin dump /path/to/repos > dumpfile
$ mv /path/to/repos /path/to/repos_saved_just_in_case
$ sed -e 's/^\(Node-path: \)\(.*\)/\1trunk\/\2/;s/^\(Copy-from-path:
\)\(.*\)/\1trunk\/\2/' dumpfile > dumpfile.new
$ svnadmin create /path/to/repos
$ svnadmin load dumpfile.new
$ svn mkdir file:///path/to/repos/branches
$ svn mkdir file:///path/to/repos/tags

That is, dump, and manually change the Node-path: and Copy-to-path:
headers to insert trunk/.

The only problem is that if the strings "Node-path: " or "Copy-to-path:
" occur at the start of a line in any text file you have created, that
will get changed too.

It's slightly less tedious than "svn mv"ing everything to the trunk dir.
There may even a way to do it "properly" with svndumpfilter...

Cheers,
Dave.

-- 
David Neary
Phenix Engineering
110 ave Jean Jaures, 69007 Lyon
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Wed Sep 29 17:42:20 2004

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