mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-10 15:35:49 +01:00
register hook on new repository creation
This commit is contained in:
@@ -60,7 +60,6 @@ import sonia.scm.web.HgWebConfigWriter;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
|
||||
import javax.xml.bind.JAXBContext;
|
||||
import javax.xml.bind.JAXBException;
|
||||
|
||||
@@ -241,7 +240,7 @@ public class HgRepositoryHandler
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes .hg/hgrc and disables hg access control
|
||||
* Writes .hg/hgrc, disables hg access control and added scm hook support.
|
||||
* see HgPermissionFilter
|
||||
*
|
||||
* @param repository
|
||||
@@ -264,6 +263,11 @@ public class HgRepositoryHandler
|
||||
webSection.setParameter("allow_push", "*");
|
||||
hgrc.addSection(webSection);
|
||||
|
||||
INISection hooksSection = new INISection("hooks");
|
||||
|
||||
hooksSection.setParameter("changegroup.scm", "python:scmhooks.callback");
|
||||
hgrc.addSection(hooksSection);
|
||||
|
||||
INIConfigurationWriter writer = new INIConfigurationWriter();
|
||||
|
||||
writer.write(hgrc, hgrcFile);
|
||||
|
||||
Reference in New Issue
Block a user