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

[Subclipse-users] JavaHL/svnClientAdapter issue and potential fix

From: Scott Horn <scottjacobhorn_at_gmail.com>
Date: Tue, 11 Nov 2008 17:14:17 +1000

I've had a problem with the java svnClientAdapter so I took a look and
came up with the following potential fix.

The issue relates to the missing environment value "SystemDrive" on windows.
Hope it helps someone.

Note this is based on the Trunk I checked out from:

http://subclipse.tigris.org/svn/subclipse/trunk/svnClientAdapter

Line 118: org.tigris.subversion.svnclientadapter.commandline.CommandLine.java

protected String[] getEnvironmentVariables()
        {
                final String systemDrive =
CmdLineClientAdapter.getEnvironmentVariable("SystemDrive");
                final String path = CmdLineClientAdapter.getEnvironmentVariable("PATH");
                final String systemRoot =
CmdLineClientAdapter.getEnvironmentVariable("SystemRoot");
                final String aprIconv =
CmdLineClientAdapter.getEnvironmentVariable("APR_ICONV_PATH");
                
                int i = 3;
                if (path != null)
                        i++;
                if (systemRoot != null)
                        i++;
                if (systemDrive != null)
                        i++;
                if (aprIconv != null)
                        i++;
                String[] lcVars = getLocaleVariables();
                String[] env = new String[i + lcVars.length];
                i = 0;
                //Clear the LC_ALL, we're going to override the LC_MESSAGES and LC_TIME
                env[i] = "LC_ALL=";
                i++;
                //Set the LC_MESSAGES to "C" to avoid translated svn output. (We're
parsing the english one)
                env[i] = "LC_MESSAGES=C";
                i++;
                env[i] = "LC_TIME=C";
                i++;
                if (path != null) {
                        env[i] = "PATH=" + path;
                        i++;
                }
                if (systemDrive != null) {
                        env[i] = "systemDrive=" + systemDrive;
                        i++;
                }
                if (systemRoot != null) {
                        env[i] = "SystemRoot=" + systemRoot;
                        i++;
                }
                if (aprIconv != null) {
                        env[i] = "APR_ICONV_PATH=" + aprIconv;
                        i++;
                }
                //Add the remaining LC vars
                for (int j = 0; j < lcVars.length; j++) {
                        env[i] = lcVars[j];
                        i++;
                }
                return env;
        }

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_subclipse.tigris.org
For additional commands, e-mail: users-help_at_subclipse.tigris.org
Received on 2008-11-11 08:19:54 CET

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.