Exemplo n.º 1
0
func handleHistory(ctx *cli.Context, client *daemon.Client) error {
	repoPath := prefixSlash(ctx.Args().First())

	history, err := client.History(repoPath)
	if err != nil {
		return ExitCode{
			UnknownError,
			fmt.Sprintf("Unable to retrieve history: %v", err),
		}
	}

	fmt.Println(colors.Colorize(repoPath, colors.Magenta))
	for idx := range history {
		checkpoint := history[len(history)-idx-1]
		printCheckpoint(checkpoint, idx, len(history))

	}
	return nil
}