You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by solo turn <so...@yahoo.com> on 2003/04/07 18:08:48 UTC

switch -relocate script

i tried to do a switch with a script ... but somehow this seems not
to work. can it be that the path length is stored in dir-wcprops?

K 25
svn:wc:ra_dav:version-url
V 35
/svn/rep/!svn/ver/675/trunk/doc/adm

if yes, why is there so many dependencies in the working copy schema?
should it not be sufficient to have the url once, and thats it (like
in a normalized db-schema)?


the script (try) was:

#! /usr/bin/env bash
# svnswitchurl based oldurl newurl oldfile newfile
# based:  the basedirectory where to start the find
# oldurl: the old url of the repository, url consists of protocol,
host and port
#         example: http://svn.collab.net:81
# newurl: the new url of the repository
#         example: https://svn.collab.net
# olddir: the old url of the repository, with leading slash
#         example: /repos/svn
# olddir: the new url of the repository, with leading slash
#         example: /repos/svn
# backup-files are created, and can be moved back with a separate
command.

# first, change the file in all the files, and createing *.1bck
backup files
find $1 -type d -name .svn -exec find {} \; | xargs grep -l $4 |
xargs perl -pi.1bck -e "s-^$4-$5-g"

# second, change the urls in the entries file, excluding 1bck files,
#  and create a *.2bck backup file
find $1 -type d -name .svn -exec find {} -name entries \; | xargs
perl -pi.2bck -e "s-$2$4-$3$5-g"
 

__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - File online, calculators, forms, and more
http://tax.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: switch -relocate script

Posted by Karl Fogel <kf...@newton.ch.collab.net>.
solo turn <so...@yahoo.com> writes:
> i tried to do a switch with a script ... but somehow this seems not
> to work. can it be that the path length is stored in dir-wcprops?
> 
> K 25
> svn:wc:ra_dav:version-url
> V 35
> /svn/rep/!svn/ver/675/trunk/doc/adm

If you're writing a script to modify the svn hashdump format, you'll
need to get it right, yes :-).  The lengths are stored right there.

(But there may be more to the `version-url' properties than that.  You
should treat them as opaque.)

> if yes, why is there so many dependencies in the working copy schema?
> should it not be sufficient to have the url once, and thats it (like
> in a normalized db-schema)?

It's a DAV thing.

Solo, why on earth are you writing a script to do `switch'? :-) Why
would you expect that to work?

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org