Search code examples
svnimportenvironment-variablesubersvn

using svn_load_dirs.pl with ubersvn on Windows - where is the path $ENV{HOME}?


When using svn_load_dirs.pl with ubersvn on Windows - where is the path $ENV{HOME} meant to be.

In the svn_load_dirs.pl code $ENV{HOME} is not defined. It is not already defined on my system either. Where is it meant to be?

My guess is that it would be the location of the UberSVN install: C:\Program Files (x86)\WANdisco\uberSVN

HOWEVER the svn_load_dirs.pl code tacks on a sub path: $ENV{HOME}/.subversion/config

folder/directory path .subversion/config does not exist beneath C:\Program Files (x86)\WANdisco\uberSVN

So I am stuck because I don't think that the svn_load_dirs.pl script can work correctly with UberSVN on Windows without this setup correctly.


Solution

  • $ENV{HOME} should refer to the current user's home directory. On Windows Vista/7 this is "C:\Users\USER-NAME\" and on older versions of Windows it would be "C:\Documents and Settings\USER-NAME\"

    Here is a perl script which might fix your problem with the script not getting the $ENV{HOME} value:

    BEGIN {
    if ( substr ( $^O, 0, 5 ) eq q{MSWin} ) {
    if ( $ENV{HOME} ) {
    # leave as is
    }
    elsif ( $ENV{USERPROFILE} ) {
    $ENV{HOME} = $ENV{USERPROFILE};
    }
    elsif ( $ENV{HOMEDRIVE} and $ENV{HOMEPATH} ) {
    $ENV{HOME} = $ENV{HOMEDRIVE} . $SENV{HOMEPATH};
    }
    else {
    $ENV{HOME} = '.';
    } } }
    

    However, according to this SVN documentation page, the configuration for SubVersion is located in the registry and not on the file system. So I guess the script will need to be updated to work on Windows:

    Subversion clients running on Windows platforms may also use the Windows Registry to hold the configuration data