aboutsummaryrefslogtreecommitdiffstats
path: root/bug/operations
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2018-08-06 20:31:20 +0200
committerMichael Muré <batolettre@gmail.com>2018-08-06 20:31:20 +0200
commit435be2b693aee89ed34a2d1e7291b3b141b19717 (patch)
tree89244a9dcb995c27002995e9f25f9be631101713 /bug/operations
parent593891b8e01fd89866b30854a60aece1dad5f6ab (diff)
downloadgit-bug-435be2b693aee89ed34a2d1e7291b3b141b19717.tar.gz
bug: add a Lamport logical clock to be able to sort bugs by creation time and edit time without having to rely on a timestamp
Diffstat (limited to 'bug/operations')
-rw-r--r--bug/operations/add_comment.go3
-rw-r--r--bug/operations/label_change.go8
-rw-r--r--bug/operations/set_status.go5
-rw-r--r--bug/operations/set_title.go5
4 files changed, 4 insertions, 17 deletions
diff --git a/bug/operations/add_comment.go b/bug/operations/add_comment.go
index f2e76b73..7ae6f2dd 100644
--- a/bug/operations/add_comment.go
+++ b/bug/operations/add_comment.go
@@ -12,7 +12,8 @@ var _ bug.Operation = AddCommentOperation{}
type AddCommentOperation struct {
bug.OpBase
Message string
- files []util.Hash
+ // TODO: change for a map[string]util.hash to store the filename ?
+ files []util.Hash
}
func (op AddCommentOperation) Apply(snapshot bug.Snapshot) bug.Snapshot {
diff --git a/bug/operations/label_change.go b/bug/operations/label_change.go
index f289fedc..85bae595 100644
--- a/bug/operations/label_change.go
+++ b/bug/operations/label_change.go
@@ -2,11 +2,11 @@ package operations
import (
"fmt"
- "github.com/MichaelMure/git-bug/bug"
- "github.com/MichaelMure/git-bug/util"
"io"
"io/ioutil"
"sort"
+
+ "github.com/MichaelMure/git-bug/bug"
)
// LabelChangeOperation will add or remove a set of labels
@@ -51,10 +51,6 @@ AddLoop:
return snapshot
}
-func (op LabelChangeOperation) Files() []util.Hash {
- return nil
-}
-
func NewLabelChangeOperation(author bug.Person, added, removed []bug.Label) LabelChangeOperation {
return LabelChangeOperation{
OpBase: bug.NewOpBase(bug.LabelChangeOp, author),
diff --git a/bug/operations/set_status.go b/bug/operations/set_status.go
index 87ca14bf..ed6c328c 100644
--- a/bug/operations/set_status.go
+++ b/bug/operations/set_status.go
@@ -2,7 +2,6 @@ package operations
import (
"github.com/MichaelMure/git-bug/bug"
- "github.com/MichaelMure/git-bug/util"
)
// SetStatusOperation will change the status of a bug
@@ -20,10 +19,6 @@ func (op SetStatusOperation) Apply(snapshot bug.Snapshot) bug.Snapshot {
return snapshot
}
-func (op SetStatusOperation) Files() []util.Hash {
- return nil
-}
-
func NewSetStatusOp(author bug.Person, status bug.Status) SetStatusOperation {
return SetStatusOperation{
OpBase: bug.NewOpBase(bug.SetStatusOp, author),
diff --git a/bug/operations/set_title.go b/bug/operations/set_title.go
index d6186f41..fab01d8a 100644
--- a/bug/operations/set_title.go
+++ b/bug/operations/set_title.go
@@ -2,7 +2,6 @@ package operations
import (
"github.com/MichaelMure/git-bug/bug"
- "github.com/MichaelMure/git-bug/util"
)
// SetTitleOperation will change the title of a bug
@@ -20,10 +19,6 @@ func (op SetTitleOperation) Apply(snapshot bug.Snapshot) bug.Snapshot {
return snapshot
}
-func (op SetTitleOperation) Files() []util.Hash {
- return nil
-}
-
func NewSetTitleOp(author bug.Person, title string) SetTitleOperation {
return SetTitleOperation{
OpBase: bug.NewOpBase(bug.SetTitleOp, author),