Adding version terminus
This commit is contained in:
parent
5749d16e4b
commit
2903a5a17f
@ -94,7 +94,7 @@ func (this *database) buildVersions(base string, names []string) ([]*version, er
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
ver, err := newVersion(path.Join(base, name), timestamp, this, parent)
|
ver, err := newVersion(path.Join(base, name), timestamp, this, parent, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -103,6 +103,10 @@ func (this *database) buildVersions(base string, names []string) ([]*version, er
|
|||||||
parent = ver
|
parent = ver
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for _, ver := range vers {
|
||||||
|
ver.terminus = vers[len(vers)-1]
|
||||||
|
}
|
||||||
|
|
||||||
return vers, nil
|
return vers, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -35,6 +35,7 @@ import (
|
|||||||
type version struct {
|
type version struct {
|
||||||
base string
|
base string
|
||||||
parent *version
|
parent *version
|
||||||
|
terminus *version
|
||||||
timestamp time.Time
|
timestamp time.Time
|
||||||
meta *versionMetadata
|
meta *versionMetadata
|
||||||
root *versionedDir
|
root *versionedDir
|
||||||
@ -45,7 +46,7 @@ type InodeAllocator interface {
|
|||||||
AllocInode() uint64
|
AllocInode() uint64
|
||||||
}
|
}
|
||||||
|
|
||||||
func newVersion(base string, timestamp time.Time, allocator InodeAllocator, parent *version) (*version, error) {
|
func newVersion(base string, timestamp time.Time, allocator InodeAllocator, parent, terminus *version) (*version, error) {
|
||||||
meta, err := newVersionMetadata(filepath.Join(base, "meta.json"))
|
meta, err := newVersionMetadata(filepath.Join(base, "meta.json"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@ -54,6 +55,7 @@ func newVersion(base string, timestamp time.Time, allocator InodeAllocator, pare
|
|||||||
ver := &version{
|
ver := &version{
|
||||||
base: base,
|
base: base,
|
||||||
parent: parent,
|
parent: parent,
|
||||||
|
terminus: terminus,
|
||||||
timestamp: timestamp,
|
timestamp: timestamp,
|
||||||
meta: meta,
|
meta: meta,
|
||||||
inodeAloc: allocator}
|
inodeAloc: allocator}
|
||||||
|
Loading…
Reference in New Issue
Block a user