added vcs support for svn and bzr
This commit is contained in:
parent
456d502b72
commit
c2597fd41a
10
vain.go
10
vain.go
@ -13,17 +13,27 @@ const (
|
|||||||
|
|
||||||
// Hg is mercurial
|
// Hg is mercurial
|
||||||
Hg
|
Hg
|
||||||
|
|
||||||
|
// Svn
|
||||||
|
Svn
|
||||||
|
|
||||||
|
// Bazaar
|
||||||
|
Bzr
|
||||||
)
|
)
|
||||||
|
|
||||||
var vcss = [...]string{
|
var vcss = [...]string{
|
||||||
"git",
|
"git",
|
||||||
"mercurial",
|
"mercurial",
|
||||||
|
"svn",
|
||||||
|
"bazaar",
|
||||||
}
|
}
|
||||||
|
|
||||||
var labelToVcs = map[string]vcs{
|
var labelToVcs = map[string]vcs{
|
||||||
"git": Git,
|
"git": Git,
|
||||||
"mercurial": Hg,
|
"mercurial": Hg,
|
||||||
"hg": Hg,
|
"hg": Hg,
|
||||||
|
"svn": Svn,
|
||||||
|
"bazaar": Bzr,
|
||||||
}
|
}
|
||||||
|
|
||||||
// String returns the name of the vcs ("git", "mercurial", ...).
|
// String returns the name of the vcs ("git", "mercurial", ...).
|
||||||
|
@ -28,6 +28,8 @@ func TestVcsStrings(t *testing.T) {
|
|||||||
}{
|
}{
|
||||||
{fmt.Sprintf("%+v", Git), "git"},
|
{fmt.Sprintf("%+v", Git), "git"},
|
||||||
{fmt.Sprintf("%+v", Hg), "mercurial"},
|
{fmt.Sprintf("%+v", Hg), "mercurial"},
|
||||||
|
{fmt.Sprintf("%+v", Svn), "svn"},
|
||||||
|
{fmt.Sprintf("%+v", Bzr), "bazaar"},
|
||||||
}
|
}
|
||||||
for _, test := range tests {
|
for _, test := range tests {
|
||||||
if test.got != test.want {
|
if test.got != test.want {
|
||||||
|
Loading…
Reference in New Issue
Block a user