0
- RAW_HEAD_VERSION_UUID = Util.sha1_uuid("strokedb-internal:head-version").to_raw_uuid
0
+ def self.head(branch="master")
0
+ Util.sha1_uuid(branch).to_raw_uuid
0
+ RAW_MASTER_HEAD_VERSION_UUID = head()
0
class FileStorage < Storage
0
@@ -14,7 +19,7 @@ module StrokeDB
0
def find(uuid, version=nil, opts = {}, &block)
0
uuid_version = uuid + (version ? ".#{version}" : "")
0
- key = uuid.to_raw_uuid + (version ? version.to_raw_uuid : RAW_
HEAD_VERSION_UUID)
0
+ key = uuid.to_raw_uuid + (version ? version.to_raw_uuid : RAW_
MASTER_HEAD_VERSION_UUID)
0
if (ptr = @uindex.find(key)) && (ptr[0,20] != "\x00" * 20) # no way ptr will be zero
0
raw_doc = StrokeDB::deserialize(read_at_ptr(ptr[0,20]))
0
unless opts[:no_instantiation]
0
@@ -28,7 +33,7 @@ module StrokeDB
0
def include?(uuid,version=nil)
0
- key = uuid.to_raw_uuid + (version ? version.to_raw_uuid : RAW_
HEAD_VERSION_UUID)
0
+ key = uuid.to_raw_uuid + (version ? version.to_raw_uuid : RAW_
MASTER_HEAD_VERSION_UUID)
0
!@uindex.find(key).nil?
0
@@ -47,7 +52,7 @@ module StrokeDB
0
@uindex.each do |key, value|
0
timestamp = StrokeDB.deserialize(read_at_ptr(value[20,20]))
0
next if after && (timestamp <= after)
0
- if key[16,16] == RAW_
HEAD_VERSION_UUID || include_versions
0
+ if key[16,16] == RAW_
MASTER_HEAD_VERSION_UUID || include_versions
0
yield Document.from_raw(options[:store],StrokeDB.deserialize(read_at_ptr(value[0,20])))
0
@@ -59,7 +64,7 @@ module StrokeDB
0
ts_ptr = DistributedPointer.pack(@archive.raw_uuid,ts_position)
0
ptr = DistributedPointer.pack(@archive.raw_uuid,position)
0
uuid = document.raw_uuid
0
- @uindex.insert(uuid + RAW_
HEAD_VERSION_UUID, ptr + ts_ptr) if options[:head] || !document.is_a?(VersionedDocument)
0
+ @uindex.insert(uuid + RAW_
MASTER_HEAD_VERSION_UUID, ptr + ts_ptr) if options[:head] || !document.is_a?(VersionedDocument)
0
@uindex.insert(uuid + document.version.to_raw_uuid, ptr + ts_ptr) unless options[:head]
0
rescue ArchiveVolume::VolumeCapacityExceeded