Пример #1
0
	"os"
	"os/exec"
	"strings"
)

// Config options
type Config struct {
	GitCommand []string
}

// Active config
var conf = Config{
	GitCommand: []string{"git"},
}

var log = l.New("git")

// Set config options for the package
func SetConfig(c Config) {
	if len(c.GitCommand) < 1 {
		log.Panicf("Invalid command line for git: too short: %#v", c.GitCommand)
	}
}

// Test whether git is runnable with current config
func TestInstall() bool {
	log.Debugf("Current git config: %+v", conf)

	// check if bzr is runnable
	log.Info("Testing whether Git is runnnable")
	if err := git("help").Run(); err != nil {
Пример #2
0
	"os"
	"os/exec"
	"strings"
)

// Config options
type Config struct {
	BzrCommand []string
}

// Active config
var conf = Config{
	BzrCommand: []string{"bzr"},
}

var log = l.New("bzr")

// Set config options for the package
func SetConfig(c Config) {
	if len(c.BzrCommand) < 1 {
		log.Panicf("Invalid command line for bzr: too short: %+v", c.BzrCommand)
	}
}

// Test whether bzr is runnable with current config and has correct version of
// fast-export plugin
func TestInstall() bool {
	log.Debugf("Current bzr config: %+v", conf)

	// check if bzr is runnable
	log.Info("Testing whether Bazaar is runnnable")
Пример #3
0
	"bufio"
	"encoding/json"
	"flag"
	"fmt"
	"io"
	"io/ioutil"
	"math/rand"
	"os"
	"os/exec"
	"sort"
	"strconv"
	"strings"
	"time"
)

var log = l.New("git-bzr-bridge")

// some constants
const bzrRepo = "bzr"
const branchConfigName = "git-bzr-bridge-branches.cfg"
const bzrMarks = "git-bzr-bridge-bzr.marks"
const gitMarks = "git-bzr-bridge-git.marks"
const tmpDir = "git-bzr-bridge-tmp"

type commandInfo struct {
	cmd         func([]string)
	description string
}

var commands = map[string]commandInfo{
	"branches":     {branchesCmd, "list branches"},