--- a/hg/hg.go Fri Nov 13 21:42:48 2020 -0600
+++ b/hg/hg.go Fri Nov 13 21:57:16 2020 -0600
@@ -31,7 +31,7 @@
rcs := []string{filepath.Join(access.AdminRepoPath(), "site.hgrc")}
// add the repo specific hgrc's
- //rcs = append(rcs, findHgrcsForRepo(repoName)...)
+ rcs = append(rcs, findHgrcsForRepo(repoName)...) // add the hgrc that controls writability
rcs = append(rcs, c.tmpHgrc)
--- a/hg/hgrc.go Fri Nov 13 21:42:48 2020 -0600
+++ b/hg/hgrc.go Fri Nov 13 21:57:16 2020 -0600
@@ -40,7 +40,7 @@
ret = append(ret, filepath.Join(adminPath, "config", repoName, "hgrc"))
- if repoName == "." || repoName == "" {
+ if repoName == "." || repoName == "" || repoName == "/" { repoName = filepath.Dir(repoName)
--- a/hg/hgrc_test.go Fri Nov 13 21:42:48 2020 -0600
+++ b/hg/hgrc_test.go Fri Nov 13 21:57:16 2020 -0600
@@ -34,3 +34,15 @@
assert.Equal(t, expected, actual)
+func TestFindHgrcsForRepoAbsolute(t *testing.T) { + actual := findHgrcsForRepo("/grim/testing/abc123") + "config/grim/testing/hgrc", + "config/grim/testing/abc123/hgrc", + assert.Equal(t, expected, actual)