From 2e1a5e246ee3589c2f664a62ebd06be7dc69c229 Mon Sep 17 00:00:00 2001 From: Michael Muré Date: Wed, 7 Aug 2019 15:31:38 +0200 Subject: bug: compute op's ID based on the serialized data on disk --- bug/timeline.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'bug/timeline.go') diff --git a/bug/timeline.go b/bug/timeline.go index d8ee2c6b..247c2927 100644 --- a/bug/timeline.go +++ b/bug/timeline.go @@ -9,8 +9,8 @@ import ( ) type TimelineItem interface { - // Hash return the hash of the item - Hash() git.Hash + // ID return the identifier of the item + ID() string } // CommentHistoryStep hold one version of a message in the history @@ -25,7 +25,7 @@ type CommentHistoryStep struct { // CommentTimelineItem is a TimelineItem that holds a Comment and its edition history type CommentTimelineItem struct { - hash git.Hash + id string Author identity.Interface Message string Files []git.Hash @@ -34,9 +34,9 @@ type CommentTimelineItem struct { History []CommentHistoryStep } -func NewCommentTimelineItem(hash git.Hash, comment Comment) CommentTimelineItem { +func NewCommentTimelineItem(ID string, comment Comment) CommentTimelineItem { return CommentTimelineItem{ - hash: hash, + id: ID, Author: comment.Author, Message: comment.Message, Files: comment.Files, @@ -51,8 +51,8 @@ func NewCommentTimelineItem(hash git.Hash, comment Comment) CommentTimelineItem } } -func (c *CommentTimelineItem) Hash() git.Hash { - return c.hash +func (c *CommentTimelineItem) ID() string { + return c.id } // Append will append a new comment in the history and update the other values -- cgit