improve handling of mercurial hooks

This commit is contained in:
Sebastian Sdorra
2012-02-12 17:41:18 +01:00
parent f41f3274b9
commit 89b50bf7f3
2 changed files with 27 additions and 158 deletions

View File

@@ -77,6 +77,9 @@ import javax.servlet.http.HttpSession;
public class HgCGIServlet extends HttpServlet
{
/** Field description */
public static final String ENV_CHALLENGE = "SCM_CHALLENGE";
/** Field description */
public static final String ENV_PYTHON_PATH = "PYTHONPATH";
@@ -89,6 +92,9 @@ public class HgCGIServlet extends HttpServlet
/** Field description */
public static final String ENV_SESSION_PREFIX = "SCM_";
/** Field description */
public static final String ENV_URL = "SCM_URL";
/** Field description */
private static final long serialVersionUID = -3492811300905099810L;
@@ -225,8 +231,6 @@ public class HgCGIServlet extends HttpServlet
}
}
hookManager.writeHookScript(request);
CGIExecutor executor = cgiExecutorFactory.createExecutor(configuration,
getServletContext(), request, response);
@@ -234,6 +238,8 @@ public class HgCGIServlet extends HttpServlet
executor.getEnvironment().set(ENV_REPOSITORY_NAME, name);
executor.getEnvironment().set(ENV_REPOSITORY_PATH,
directory.getAbsolutePath());
executor.getEnvironment().set(ENV_URL, hookManager.createUrl(request));
executor.getEnvironment().set(ENV_CHALLENGE, hookManager.getChallenge());
executor.getEnvironment().set(ENV_PYTHON_PATH, pythonPath);
HttpSession session = request.getSession();