Search code examples
svnhttp-redirectdnstortoisesvnsvn-externals

How can I redirect svn urls to another domain?


background: DynDNS has now started to require a once a month logon to keep their free accounts active (previously you only had to renew your IP address once a month). I am sure sooner or later I will forget to do that and lose my account.

I use mysvn.dyndns.org for accessing my subversion repository on a server which can (as of now) also be reached by svn.mydomain.com. Unfortunately most projects also refer to externals which are also located at mysvn.dyndns.org and I don't really want to go through all projects (>100) and change the externals, because that would probably take several hours and is rather error prone.

Is there any way to configure Windows or the subversion / TortoiseSVN clients to redirect one domain to another?

e.g.:

https://mysvn.dyndns.org/svn/blablub

should be redirected to

https://svn.mydomain.com/svn/blablub

I know that I can add an entry to hosts to redirect to an IP address, but I would prefer redirection to a domain name.


Solution

  • Apparently there is no solution as easy as I thought it might be. I ended up writing a small Delphi program based on the Version Insight source code which changes the externals for all projects checked out into subdirectories of a given directory and committing these changes. Then I used the svn relocate command to relocate the projects themselves.

    @rem calls svn relocate for all directories
    @echo off
    
    for /d %%i in (*) do call :HandleDir %%i
    pause
    goto :eof
    
    :HandleDir
    echo *** handling dir %1
    
    svn relocate --ignore-externals https://mysvn.dyndns.org/svn/ https://svn.mydomain.com/svn/ %1
    goto :eof