@@ -53,11 +53,11 @@ func (s service) List(_ context.Context, repo string, opt change.ListOptions) ([ State: state, Title: firstParagraph(cl.Commit.Msg), //Labels: labels, // TODO. Author: gerritUser(cl.Commit.Author), CreatedAt: cl.Created, //Replies: len(cl.Messages), Replies: len(cl.Messages), }) return nil }) if err != nil { return nil, err @@ -110,12 +110,12 @@ func (s service) Get(_ context.Context, repo string, id uint64) (change.Change, State: state(cl.Status), Title: firstParagraph(cl.Commit.Msg), //Labels: labels, // TODO. Author: gerritUser(cl.Commit.Author), CreatedAt: cl.Created, //Replies: len(cl.Messages), Commits: int(cl.Version), Replies: len(cl.Messages), Commits: int(cl.Version), }, nil } func (s service) ListTimeline(_ context.Context, repo string, id uint64, opt *change.ListTimelineOptions) ([]interface{}, error) { s.c.RLock() @@ -130,10 +130,15 @@ func (s service) ListTimeline(_ context.Context, repo string, id uint64, opt *ch } var timeline []interface{} for _, m := range cl.Messages { label, body, ok := parseMessage(m.Message) if !ok { timeline = append(timeline, change.Comment{ User: gerritUser(m.Author), CreatedAt: m.Date, Body: m.Message, }) continue } var state change.ReviewState switch label { default: @@ -233,12 +238,19 @@ func (s service) GetDiff(_ context.Context, repo string, id uint64, opt *change. } cl := project.CL(int32(id)) if cl == nil || cl.Private { return nil, os.ErrNotExist } var c *maintner.GitCommit switch opt { case nil: c = cl.Commit default: c = project.GitCommit(opt.Commit) } var fds []*diff.FileDiff for _, f := range cl.Commit.Files { for _, f := range c.Files { fds = append(fds, &diff.FileDiff{ OrigName: f.File, NewName: f.File, Hunks: []*diff.Hunk{}, // Hunk data isn't present in maintner.Corpus. })