func vcsByCmd(cmd string) *vcsCmd {
	for _, vcs := range vcsList {
		if vcs.cmd == cmd {
			return vcs
		}
	}
	return nil
}
vcsByCmd returns the version control system for the given
command name (hg, git, svn, bzr).
package main
import (
	"bytes"
	"encoding/json"
	"errors"
	"fmt"
	"go/build"
	"log"
	"os"
	"os/exec"
	"path/filepath"
	"regexp"
	"strings"
)
type vcsCmd struct {
	name string
	cmd  string  
	createCmd   string  
	downloadCmd string  
	tagCmd         []tagCmd  
	tagLookupCmd   []tagCmd  
	tagSyncCmd     string    
	tagSyncDefault string    
	scheme  []string
	pingCmd string
}
type tagCmd struct {
	cmd     string  
	pattern string  
}
var vcsList = []*vcsCmd{
	vcsHg,
	vcsGit,
	vcsSvn,
	vcsBzr,
}