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

Re: Scripting an svn:externals change

From: Ryan Schmidt <subversion-2010b_at_ryandesign.com>
Date: Thu, 2 Sep 2010 21:52:45 -0500

On Sep 2, 2010, at 18:51, BRM wrote:

> ----- Original Message ----
>
>> From: BRM <bm_witness_at_yahoo.com>
>> To: Ryan Schmidt <subversion-2010b_at_ryandesign.com>
>> ----- Original Message ----
>>> On Sep 2, 2010, at 11:27, BRM wrote:
>>> If you can afford to have the repository offline, make a dumpfile, twiddle it, load it into a new repository, and have everybody check out new working copies, you
>>> may want to consider doing that.

> Okay - well, I decided to try this route, but was advised to try it on a test
> repository first.
> Good thing - as there is a bit of an issue, and one I need to avoid if I can...
>
> The issue is that an existing working copy's externals are not being updated
> when 'svn update' runs,
> even though the externals have changed on the server through the update.
>
> Here's my test:
>
> 1. Create a file-based repository:
>
> $ cd /
> $ mkdir svnTest && cd svnTest
> $ svnadmin create Example1
>
> $ mkdir -p ~/testsvn && cd ~/testsvn
> $ export SVNROOT=/svnTest
> $ svn co ${SVNROOT}/Example1 example1.wc
> $ cd example1.wc
> $ mkdir sub1 sub2
> $ svn add sub1 sub2
> $ svn commit -m "Adding some structure for test"
> $ touch sub1/file1
> $ svn add sub1/file1
> $ svn commit -m "Adding a file for test"
> $ svn pedit svn:externals sub2
>
> set the svn:externals to:
>
> sub2a file:///svnTest/Example1
>
> save and quit
>
> $ svn update
> $ svn commit -m "Adding an external for test"
>
> 2. Make a backup of the working copy
> $ cd ~/testsvn
> $ tar -jcvvf example1.wc.tar.bz2 example1.wc
>
> 3. Dump the repository
>
> $ cd /svnTest
> $ svnadmin dump Example1 > Example1.dump
>
> 4. Switch the external reference from Example1 to Example2
>
> $ cat Example1.dump | sed
> 's/file:\/\/\/svnTest\/Example1/file:\/\/\/svnTest\/Example2/' >
> Example1-edited.dump

Do not use sed to edit a dumpfile. Use a tool designed for the task, like svndumptool.

http://svn.borg.ch/svndumptool/

> 5. Load the edited dump into a new repository (Example2)
>
> $ cd /svnTest
> $ svnadmin create Example2
> $ svnadmin load Example2 < Example1-edited.dump

Because this repository is now different than it was before (the history has been edited), you must give the new repository a new UUID.

svnadmin load --ignore-uuid Example2 < Example1-edited.dump

Since the UUID has changed, everyone must check out new working copies; it is not possible to update or switch existing working copies to this new changed repository.
Received on 2010-09-03 04:53:45 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.