grim/hgkeeper

Introduce "rm <repo>" command

13 months ago, aklitzing
7485b844616f
Introduce "rm " command

It is possible to create a new repository with "hg init" but it is not possible
to remove any repositories. So let's use "ssh command" to allow this.

$ ssh hg.host.com rm repoName

Bugs closed: HGKEEPER-25

Reviewed at https://reviews.imfreedom.org/r/2421/
package access
import (
"fmt"
"os"
)
func refreshHgWeb() error {
fp, err := os.OpenFile(hgwebConfigPath, os.O_WRONLY|os.O_TRUNC, 0644)
if err != nil {
return err
}
defer fp.Close()
fmt.Fprintf(fp, "[paths]\n")
for relativeRepoPath, repoPath := range repositories {
rootedPath := "/" + relativeRepoPath
// check if it's publicly readable
if CanRead("public", rootedPath) {
fmt.Fprintf(fp, "%s = %s\n", rootedPath, repoPath)
}
}
return nil
}