register hook on new repository creation

This commit is contained in:
Sebastian Sdorra
2011-07-22 12:25:59 +02:00
parent 3d9601415e
commit b5b91865bf

View File

@@ -60,7 +60,6 @@ import sonia.scm.web.HgWebConfigWriter;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException; 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 * see HgPermissionFilter
* *
* @param repository * @param repository
@@ -264,6 +263,11 @@ public class HgRepositoryHandler
webSection.setParameter("allow_push", "*"); webSection.setParameter("allow_push", "*");
hgrc.addSection(webSection); hgrc.addSection(webSection);
INISection hooksSection = new INISection("hooks");
hooksSection.setParameter("changegroup.scm", "python:scmhooks.callback");
hgrc.addSection(hooksSection);
INIConfigurationWriter writer = new INIConfigurationWriter(); INIConfigurationWriter writer = new INIConfigurationWriter();
writer.write(hgrc, hgrcFile); writer.write(hgrc, hgrcFile);