Previously, when scm-manager was first installed, if you created an hg repository and then tried to click on the link to view the repository, you'd get an error saying that the CGI didn't exist. This was because the CGI was only being written to the .scm/cgi-bin directory when the HgConfig was "set". However, Hg should be perfectly usable with the initial config (assuming that the defaults actually match your system config). Thus, now, scm-manager will write out the CGI upon constructing an initial HgConfig as well.

This commit is contained in:
David M. Carr
2010-12-17 13:41:21 -05:00
parent a3a68f13bb
commit 79190db6a3

View File

@@ -42,6 +42,7 @@ import sonia.scm.io.Command;
import sonia.scm.io.CommandResult;
import sonia.scm.io.SimpleCommand;
import sonia.scm.util.IOUtil;
import sonia.scm.web.HgWebConfigWriter;
//~--- JDK imports ------------------------------------------------------------
@@ -111,6 +112,14 @@ public class HgInitialConfigBuilder
config.setRepositoryDirectory(repoDirectory);
config.setHgBinary(search("hg"));
config.setPythonBinary(search("python"));
try {
new HgWebConfigWriter(config).write();
} catch(IOException ioe) {
if(logger.isErrorEnabled()) {
logger.error("Could not write Hg CGI for inital config. " +
"HgWeb may not function until a new Hg config is set", ioe);
}
}
return config;
}