mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-11 07:55:47 +01:00
fix wrong mercurial changeset ids during hooks
This commit is contained in:
@@ -68,6 +68,9 @@ import javax.xml.bind.JAXBException;
|
|||||||
public class AbstractHgHandler
|
public class AbstractHgHandler
|
||||||
{
|
{
|
||||||
|
|
||||||
|
/** Field description */
|
||||||
|
protected static final String ENV_ID_REVISION = "SCM_ID_REVISION";
|
||||||
|
|
||||||
/** Field description */
|
/** Field description */
|
||||||
protected static final String ENV_NODE = "HG_NODE";
|
protected static final String ENV_NODE = "HG_NODE";
|
||||||
|
|
||||||
@@ -219,8 +222,7 @@ public class AbstractHgHandler
|
|||||||
Map<String, String> extraEnv)
|
Map<String, String> extraEnv)
|
||||||
throws IOException
|
throws IOException
|
||||||
{
|
{
|
||||||
return createProcess(
|
return createProcess(extraEnv, handler.getConfig().getPythonBinary(),
|
||||||
extraEnv, handler.getConfig().getPythonBinary(),
|
|
||||||
script.getFile(SCMContext.getContext()).getAbsolutePath());
|
script.getFile(SCMContext.getContext()).getAbsolutePath());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -383,6 +385,12 @@ public class AbstractHgHandler
|
|||||||
env.put(ENV_PYTHONIOENCODING, ENCODING);
|
env.put(ENV_PYTHONIOENCODING, ENCODING);
|
||||||
env.put(ENV_HGENCODING, ENCODING);
|
env.put(ENV_HGENCODING, ENCODING);
|
||||||
|
|
||||||
|
//J-
|
||||||
|
env.put(ENV_ID_REVISION,
|
||||||
|
String.valueOf(handler.getConfig().isShowRevisionInId())
|
||||||
|
);
|
||||||
|
//J+
|
||||||
|
|
||||||
if (context.isSystemEnvironment())
|
if (context.isSystemEnvironment())
|
||||||
{
|
{
|
||||||
env.putAll(System.getenv());
|
env.putAll(System.getenv());
|
||||||
|
|||||||
@@ -75,7 +75,10 @@ def appendWrappedListNodes(doc, parentNode, wrapperName, name, values):
|
|||||||
appendListNodes(doc, wrapperNode, name, values)
|
appendListNodes(doc, wrapperNode, name, values)
|
||||||
|
|
||||||
def getId(ctx):
|
def getId(ctx):
|
||||||
return str(ctx.rev()) + ':' + hex(ctx.node()[:6])
|
id = ''
|
||||||
|
if os.environ['SCM_ID_REVISION'] == 'true':
|
||||||
|
id = str(ctx.rev()) + ':'
|
||||||
|
return id + hex(ctx.node())
|
||||||
|
|
||||||
def appendAuthorNodes(doc, parentNode, ctx):
|
def appendAuthorNodes(doc, parentNode, ctx):
|
||||||
authorName = ctx.user()
|
authorName = ctx.user()
|
||||||
|
|||||||
Reference in New Issue
Block a user