mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-11 07:55:47 +01:00
fix wrong scope error on mercurial post receive hooks
This commit is contained in:
@@ -45,6 +45,38 @@ import com.google.inject.servlet.RequestScoped;
|
||||
public class HgContext
|
||||
{
|
||||
|
||||
/**
|
||||
* Constructs ...
|
||||
*
|
||||
*/
|
||||
public HgContext() {}
|
||||
|
||||
/**
|
||||
* Constructs ...
|
||||
*
|
||||
*
|
||||
* @param pending
|
||||
*/
|
||||
public HgContext(boolean pending)
|
||||
{
|
||||
this.pending = pending;
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs ...
|
||||
*
|
||||
*
|
||||
* @param pending
|
||||
* @param systemEnvironment
|
||||
*/
|
||||
public HgContext(boolean pending, boolean systemEnvironment)
|
||||
{
|
||||
this.pending = pending;
|
||||
this.systemEnvironment = systemEnvironment;
|
||||
}
|
||||
|
||||
//~--- get methods ----------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
|
||||
@@ -408,8 +408,24 @@ public class HgRepositoryHandler
|
||||
* @return
|
||||
*/
|
||||
HgChangesetViewer getChangesetViewer(File repositoryDirectory)
|
||||
{
|
||||
return getChangesetViewer(repositoryDirectory, hgContextProvider.get());
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @param repositoryDirectory
|
||||
* @param context
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
HgChangesetViewer getChangesetViewer(File repositoryDirectory,
|
||||
HgContext context)
|
||||
{
|
||||
AssertUtil.assertIsNotNull(repositoryDirectory);
|
||||
AssertUtil.assertIsNotNull(context);
|
||||
|
||||
if (!repositoryDirectory.isDirectory())
|
||||
{
|
||||
@@ -417,7 +433,7 @@ public class HgRepositoryHandler
|
||||
}
|
||||
|
||||
return new HgChangesetViewer(this, changesetPagingResultContext,
|
||||
changesetContext, hgContextProvider.get(),
|
||||
changesetContext, context,
|
||||
repositoryDirectory);
|
||||
}
|
||||
|
||||
|
||||
@@ -128,7 +128,7 @@ public class HgRepositoryHookEvent extends AbstractRepositoryHookEvent
|
||||
File directory = handler.getConfig().getRepositoryDirectory();
|
||||
File repositoryDirectory = new File(directory, repositoryName);
|
||||
|
||||
return handler.getChangesetViewer(repositoryDirectory);
|
||||
return handler.getChangesetViewer(repositoryDirectory, new HgContext(true));
|
||||
}
|
||||
|
||||
//~--- fields ---------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user