// Hg is a simple command wrapper for hg.
Hg is a simple command wrapper for hg.
// Hg is a simple command wrapper for hg .
func (this *HgPkg) Hg(params ...string) (*exec.Cmd, error) {
	cmd := exec.Command("hg", params...)
	cmd.Dir = this.Path
	stdout := bytes.Buffer{}
	stderr := bytes.Buffer{}
	cmd.Stdout = &stdout
	cmd.Stderr = &stderr
	err := cmd.Run()
	if err != nil {
		err = fmt.Errorf("Error\n%s: hg %s => %s", this.Name, strings.Join(params, " "), stderr.String())
		return cmd, err
	}
	return cmd, nil
}
func ( this * HgPkg ) Hg ( params ... string ) ( * exec . Cmd , error ) { cmd := exec . Command ( " " , params ... ) cmd . Dir = this . Path stdout := bytes . Buffer { } stderr := bytes . Buffer { } cmd . Stdout = & stdout cmd . Stderr = & stderr err := cmd . Run ( ) if err != nil { err = fmt . Errorf ( " \n " , this . Name , strings . Join ( params , " " ) , stderr . String ( ) ) return cmd , err } return cmd , nil }
Hg is a simple command wrapper for hg.
Hg is a simple command wrapper for hg .