grim/hgkeeper
Clone
Summary
Browse
Changes
Graph
Automatically add site.hgrc to all hg commands
2019-09-18, Gary Kramlich
0f2a86c692d6
Parents
fb15a51fc845
Children
5099511af23f
Automatically add site.hgrc to all hg commands
1 files changed, 13 insertions(+), 1 deletions(-)
+13
-1
hg/hg.go
--- a/hg/hg.go Wed Sep 18 10:39:58 2019 -0500
+++ b/hg/hg.go Wed Sep 18 10:40:12 2019 -0500
@@ -3,8 +3,12 @@
import (
"os"
"os/exec"
+ "path/filepath"
+ "strings"
log "github.com/sirupsen/logrus"
+
+ "bitbucket.org/rw_grim/hgkeeper/access"
)
type Command struct {
@@ -21,7 +25,15 @@
c.tmpHgrc = hgrc
- c.cmd.Env = append(os.Environ(), "HGRCPATH="+c.tmpHgrc)
+ rcs := []string{
+ filepath.Join(access.AdminRepoPath(), "site.hgrc"),
+ c.tmpHgrc,
+ }
+
+ c.cmd.Env = append(
+ os.Environ(),
+ "HGRCPATH="+strings.Join(rcs, string(filepath.ListSeparator)),
+ )
return nil
}