aboutsummaryrefslogtreecommitdiffstats
path: root/bug
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2018-10-01 23:34:45 +0200
committerMichael Muré <batolettre@gmail.com>2018-10-01 23:34:45 +0200
commit8ec1dd092656aed5dae22a0301bd3f85b5dabb88 (patch)
tree26ee832a2d629d48e9ac9f43fc808f17a4a77154 /bug
parentf18c2d278352f556b90ad9a52c33499665e16fa2 (diff)
downloadgit-bug-8ec1dd092656aed5dae22a0301bd3f85b5dabb88.tar.gz
github: working incremental + comment history for the first comment
Diffstat (limited to 'bug')
-rw-r--r--bug/operation.go8
-rw-r--r--bug/snapshot.go1
-rw-r--r--bug/timeline.go1
3 files changed, 10 insertions, 0 deletions
diff --git a/bug/operation.go b/bug/operation.go
index f42a1192..bb88af1f 100644
--- a/bug/operation.go
+++ b/bug/operation.go
@@ -21,6 +21,7 @@ const (
SetStatusOp
LabelChangeOp
EditCommentOp
+ NoOpOp
)
// Operation define the interface to fulfill for an edit operation of a Bug
@@ -43,6 +44,8 @@ type Operation interface {
SetMetadata(key string, value string)
// GetMetadata retrieve arbitrary metadata about the operation
GetMetadata(key string) (string, bool)
+ // AllMetadata return all metadata for this operation
+ AllMetadata() map[string]string
}
func hashRaw(data []byte) git.Hash {
@@ -145,3 +148,8 @@ func (op *OpBase) GetMetadata(key string) (string, bool) {
val, ok := op.Metadata[key]
return val, ok
}
+
+// AllMetadata return all metadata for this operation
+func (op *OpBase) AllMetadata() map[string]string {
+ return op.Metadata
+}
diff --git a/bug/snapshot.go b/bug/snapshot.go
index 28a92961..1004b625 100644
--- a/bug/snapshot.go
+++ b/bug/snapshot.go
@@ -33,6 +33,7 @@ func (snap *Snapshot) HumanId() string {
return fmt.Sprintf("%.8s", snap.id)
}
+// Deprecated:should be moved in UI code
func (snap *Snapshot) Summary() string {
return fmt.Sprintf("C:%d L:%d",
len(snap.Comments)-1,
diff --git a/bug/timeline.go b/bug/timeline.go
index b5aa22a9..359389a6 100644
--- a/bug/timeline.go
+++ b/bug/timeline.go
@@ -56,6 +56,7 @@ func (c *CommentTimelineItem) Append(comment Comment) {
c.Files = comment.Files
c.LastEdit = comment.UnixTime
c.History = append(c.History, CommentHistoryStep{
+ Author: comment.Author,
Message: comment.Message,
UnixTime: comment.UnixTime,
})