mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-09 23:15:43 +01:00
support for mercurial 2.1
This commit is contained in:
@@ -128,6 +128,12 @@ public class DefaultCGIExecutor extends AbstractCGIExecutor
|
||||
File command = new File(cmd);
|
||||
EnvList env = new EnvList(environment);
|
||||
|
||||
// workaround for mercurial 2.1
|
||||
if (isContentLengthWorkaround())
|
||||
{
|
||||
env.set(ENV_CONTENT_LENGTH, Integer.toString(request.getContentLength()));
|
||||
}
|
||||
|
||||
if (workDirectory == null)
|
||||
{
|
||||
workDirectory = command.getParentFile();
|
||||
@@ -161,7 +167,7 @@ public class DefaultCGIExecutor extends AbstractCGIExecutor
|
||||
|
||||
if (logger.isTraceEnabled())
|
||||
{
|
||||
logger.trace(environment.toString());
|
||||
logger.trace(env.toString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -169,8 +175,7 @@ public class DefaultCGIExecutor extends AbstractCGIExecutor
|
||||
|
||||
try
|
||||
{
|
||||
p = Runtime.getRuntime().exec(execCmd, environment.getEnvArray(),
|
||||
workDirectory);
|
||||
p = Runtime.getRuntime().exec(execCmd, env.getEnvArray(), workDirectory);
|
||||
execute(p);
|
||||
}
|
||||
catch (Throwable ex)
|
||||
@@ -205,8 +210,33 @@ public class DefaultCGIExecutor extends AbstractCGIExecutor
|
||||
return exceptionHandler;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public boolean isContentLengthWorkaround()
|
||||
{
|
||||
return contentLengthWorkaround;
|
||||
}
|
||||
|
||||
//~--- set methods ----------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
*
|
||||
* @param contentLengthWorkaround
|
||||
*/
|
||||
@Override
|
||||
public void setContentLengthWorkaround(boolean contentLengthWorkaround)
|
||||
{
|
||||
this.contentLengthWorkaround = contentLengthWorkaround;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
@@ -593,6 +623,9 @@ public class DefaultCGIExecutor extends AbstractCGIExecutor
|
||||
/** Field description */
|
||||
private ScmConfiguration configuration;
|
||||
|
||||
/** Field description */
|
||||
private boolean contentLengthWorkaround = false;
|
||||
|
||||
/** Field description */
|
||||
private ServletContext context;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user