Apply the new WalkHistory prototype to merge

This commit is contained in:
creack 2013-03-21 10:12:05 -07:00
parent da266e6c7b
commit f246cc9cdd
1 changed files with 2 additions and 1 deletions

View File

@ -331,13 +331,14 @@ func (srv *Server) CmdHistory(stdin io.ReadCloser, stdout io.Writer, args ...str
return err return err
} }
var child *Image var child *Image
return image.WalkHistory(func(img *Image) { return image.WalkHistory(func(img *Image) error {
if child == nil { if child == nil {
fmt.Fprintf(stdout, " %s\n", img.Id) fmt.Fprintf(stdout, " %s\n", img.Id)
} else { } else {
fmt.Fprintf(stdout, " = %s + %s\n", img.Id, strings.Join(child.ParentCommand, " ")) fmt.Fprintf(stdout, " = %s + %s\n", img.Id, strings.Join(child.ParentCommand, " "))
} }
child = img child = img
return nil
}) })
} }