mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-10 07:25:44 +01:00
fix mercurial python path for commit, source and blame on windows
This commit is contained in:
@@ -450,21 +450,7 @@ public class AbstractHgHandler
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
String pythonPath = Util.nonNull(config.getPythonPath());
|
env.put(ENV_PYTHONPATH, HgUtil.getPythonPath(config));
|
||||||
|
|
||||||
if (Util.isNotEmpty(pythonPath))
|
|
||||||
{
|
|
||||||
pythonPath = pythonPath.concat(":");
|
|
||||||
}
|
|
||||||
|
|
||||||
//J-
|
|
||||||
pythonPath = pythonPath.concat(
|
|
||||||
HgPythonScript.getScriptDirectory(
|
|
||||||
SCMContext.getContext()
|
|
||||||
).getAbsolutePath()
|
|
||||||
);
|
|
||||||
//J+
|
|
||||||
env.put(ENV_PYTHONPATH, pythonPath);
|
|
||||||
env.put(ENV_REPOSITORY_PATH, directory.getAbsolutePath());
|
env.put(ENV_REPOSITORY_PATH, directory.getAbsolutePath());
|
||||||
env.putAll(extraEnv);
|
env.putAll(extraEnv);
|
||||||
|
|
||||||
|
|||||||
@@ -228,18 +228,7 @@ public class HgCGIServlet extends HttpServlet
|
|||||||
{
|
{
|
||||||
String name = repository.getName();
|
String name = repository.getName();
|
||||||
File directory = handler.getDirectory(repository);
|
File directory = handler.getDirectory(repository);
|
||||||
String pythonPath = HgPythonScript.getScriptDirectory(
|
String pythonPath = HgUtil.getPythonPath(handler.getConfig());
|
||||||
SCMContext.getContext()).getAbsolutePath();
|
|
||||||
HgConfig config = handler.getConfig();
|
|
||||||
|
|
||||||
if (config != null)
|
|
||||||
{
|
|
||||||
if (Util.isNotEmpty(config.getPythonPath()))
|
|
||||||
{
|
|
||||||
pythonPath =
|
|
||||||
pythonPath.concat(File.pathSeparator).concat(config.getPythonPath());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
CGIExecutor executor = cgiExecutorFactory.createExecutor(configuration,
|
CGIExecutor executor = cgiExecutorFactory.createExecutor(configuration,
|
||||||
getServletContext(), request, response);
|
getServletContext(), request, response);
|
||||||
|
|||||||
@@ -35,6 +35,10 @@ package sonia.scm.web;
|
|||||||
|
|
||||||
//~--- non-JDK imports --------------------------------------------------------
|
//~--- non-JDK imports --------------------------------------------------------
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import sonia.scm.SCMContext;
|
||||||
|
import sonia.scm.repository.HgConfig;
|
||||||
|
import sonia.scm.repository.HgPythonScript;
|
||||||
import sonia.scm.util.Util;
|
import sonia.scm.util.Util;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -49,6 +53,39 @@ public class HgUtil
|
|||||||
|
|
||||||
//~--- get methods ----------------------------------------------------------
|
//~--- get methods ----------------------------------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method description
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @param config
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static String getPythonPath(HgConfig config)
|
||||||
|
{
|
||||||
|
String pythonPath = Util.EMPTY_STRING;
|
||||||
|
|
||||||
|
if ( config != null )
|
||||||
|
{
|
||||||
|
pythonPath = Util.nonNull(config.getPythonPath());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Util.isNotEmpty(pythonPath))
|
||||||
|
{
|
||||||
|
pythonPath = pythonPath.concat(File.pathSeparator);
|
||||||
|
}
|
||||||
|
|
||||||
|
//J-
|
||||||
|
pythonPath = pythonPath.concat(
|
||||||
|
HgPythonScript.getScriptDirectory(
|
||||||
|
SCMContext.getContext()
|
||||||
|
).getAbsolutePath()
|
||||||
|
);
|
||||||
|
//J+
|
||||||
|
|
||||||
|
return pythonPath;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Method description
|
* Method description
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user