grim/hgkeeper

Add a caching layer to the hgweb portion. This should take some strain off of mercurial anf our cpu quota
package commands
import (
"testing"
"github.com/stretchr/testify/assert"
)
type testCase struct {
input string
expected Command
}
func TestRepoFromCommand(t *testing.T) {
assert := assert.New(t)
cases := []testCase{
{
"hg serve --stdio",
NewServe("repos", ""),
},
{
"hg -R foo serve --stdio",
NewServe("repos", "foo"),
},
{
"hg -R foo/bar serve --stdio",
NewServe("repos", "foo/bar"),
},
}
for _, testCase := range cases {
cmd, err := Find(testCase.input, "repos")
assert.Nil(err)
assert.NotNil(cmd)
assert.Equal(cmd, testCase.expected)
}
}