aboutsummaryrefslogtreecommitdiffstats
path: root/identity
diff options
context:
space:
mode:
Diffstat (limited to 'identity')
-rw-r--r--identity/identity.go9
-rw-r--r--identity/identity_actions_test.go4
-rw-r--r--identity/version.go3
3 files changed, 13 insertions, 3 deletions
diff --git a/identity/identity.go b/identity/identity.go
index 3da8c5a3..c1bca4d6 100644
--- a/identity/identity.go
+++ b/identity/identity.go
@@ -332,7 +332,14 @@ func (i *Identity) Commit(repo repository.ClockedRepo) error {
}
// get the times where new versions starts to be valid
- v.time = repo.EditTime()
+ // TODO: instead of this hardcoded clock for bugs only, this need to be
+ // a vector of edit clock, one for each entity (bug, PR, config ..)
+ bugEditClock, err := repo.GetOrCreateClock("bug-edit")
+ if err != nil {
+ return err
+ }
+
+ v.time = bugEditClock.Time()
v.unixTime = time.Now().Unix()
blobHash, err := v.Write(repo)
diff --git a/identity/identity_actions_test.go b/identity/identity_actions_test.go
index 713b3246..48652438 100644
--- a/identity/identity_actions_test.go
+++ b/identity/identity_actions_test.go
@@ -9,8 +9,8 @@ import (
)
func TestPushPull(t *testing.T) {
- repoA, repoB, remote := repository.SetupReposAndRemote(t)
- defer repository.CleanupTestRepos(t, repoA, repoB, remote)
+ repoA, repoB, remote := repository.SetupReposAndRemote()
+ defer repository.CleanupTestRepos(repoA, repoB, remote)
identity1 := NewIdentity("name1", "email1")
err := identity1.Commit(repoA)
diff --git a/identity/version.go b/identity/version.go
index 757b029f..2359bd11 100644
--- a/identity/version.go
+++ b/identity/version.go
@@ -20,6 +20,9 @@ type Version struct {
// The lamport time at which this version become effective
// The reference time is the bug edition lamport clock
// It must be the first field in this struct due to https://github.com/golang/go/issues/599
+ //
+ // TODO: BREAKING CHANGE - this need to actually be one edition lamport time **per entity**
+ // This is not a problem right now but will be when more entities are added (pull-request, config ...)
time lamport.Time
unixTime int64