1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

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

View file

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