grim/hgkeeper

20da8ebdfc2f
Parents 53a77310bd95
Children e82a54e2ca41
make hgweb use the site.hgrc in the admin repo if it exists
--- a/access/access.go Wed Dec 18 00:21:38 2019 -0600
+++ b/access/access.go Wed Dec 18 00:46:05 2019 -0600
@@ -75,7 +75,7 @@
return err
}
- if err := refreshHgWeb(reposPath); err != nil {
+ if err := refreshHgWeb(reposPath, adminRepoPath); err != nil {
return err
}
--- a/access/hgweb.go Wed Dec 18 00:21:38 2019 -0600
+++ b/access/hgweb.go Wed Dec 18 00:46:05 2019 -0600
@@ -8,13 +8,19 @@
"strings"
)
-func refreshHgWeb(reposPath string) error {
+func refreshHgWeb(reposPath, adminRepoPath string) error {
fp, err := os.OpenFile(hgwebConfigPath, os.O_WRONLY|os.O_TRUNC, 0644)
if err != nil {
return err
}
defer fp.Close()
+ absAdminRepoPath, err := filepath.Abs(adminRepoPath)
+ if err != nil {
+ return err
+ }
+ fmt.Fprintf(fp, "%%include %s\n\n", filepath.Join(absAdminRepoPath, "site.hgrc"))
+
fmt.Fprintf(fp, "[paths]\n")
absReposPath, err := filepath.Abs(reposPath)