fix mercurial pre-receive hooks

This commit is contained in:
Sebastian Sdorra
2011-10-12 08:26:03 +02:00
parent 965df35f18
commit fe6a033b54
3 changed files with 23 additions and 15 deletions

View File

@@ -81,6 +81,21 @@ public class AbstractHgHandler
/** Field description */ /** Field description */
public static final String ENV_REVISION = "SCM_REVISION"; public static final String ENV_REVISION = "SCM_REVISION";
/** Field description */
public static final String ENV_PAGE_LIMIT = "SCM_PAGE_LIMIT";
/** Field description */
public static final String ENV_PAGE_START = "SCM_PAGE_START";
/** Field description */
public static final String ENV_REVISION_END = "SCM_REVISION_END";
/** Field description */
public static final String ENV_REVISION_START = "SCM_REVISION_START";
/** Field description */
public static final String ENV_NODE = "HG_NODE";
/** the logger for AbstractHgHandler */ /** the logger for AbstractHgHandler */
private static final Logger logger = private static final Logger logger =
LoggerFactory.getLogger(AbstractHgHandler.class); LoggerFactory.getLogger(AbstractHgHandler.class);
@@ -396,6 +411,11 @@ public class AbstractHgHandler
if (context.isPending()) if (context.isPending())
{ {
env.put(ENV_PENDING, directory.getAbsolutePath()); env.put(ENV_PENDING, directory.getAbsolutePath());
if ( extraEnv.containsKey( ENV_REVISION_START ) )
{
env.put(ENV_NODE, extraEnv.get(ENV_REVISION_START));
}
} }
env.put(ENV_PYTHON_PATH, Util.nonNull(config.getPythonPath())); env.put(ENV_PYTHON_PATH, Util.nonNull(config.getPythonPath()));

View File

@@ -55,18 +55,6 @@ public class HgChangesetViewer extends AbstractHgHandler
implements ChangesetViewer implements ChangesetViewer
{ {
/** Field description */
public static final String ENV_PAGE_LIMIT = "SCM_PAGE_LIMIT";
/** Field description */
public static final String ENV_PAGE_START = "SCM_PAGE_START";
/** Field description */
public static final String ENV_REVISION_END = "SCM_REVISION_END";
/** Field description */
public static final String ENV_REVISION_START = "SCM_REVISION_START";
/** Field description */ /** Field description */
public static final String RESOURCE_LOG = "/sonia/scm/hglog.py"; public static final String RESOURCE_LOG = "/sonia/scm/hglog.py";