PublicShow sourcegitty_driver_bdb.pl -- Gitty BDB driver

This version of the driver uses library(bdb), the BerkeyDB database. This driver is particularly suited for large numbers of files. The store uses less disk space and starts much faster on large numbers of files.

The BDB database file contains two databases:

Source gitty_close(+Store) is det
Close the BDB environment associated with a gitty store
Source gitty_file(+Store, ?File, ?Head) is nondet
True when File entry in the gitty store and Head is the HEAD revision.
Source gitty_update_head(+Store, +Name, +OldCommit, +NewCommit) is det
Update the head of a gitty store for Name. OldCommit is the current head and NewCommit is the new head. If Name is created, and thus there is no head, OldCommit must be -.

This operation can fail because another writer has updated the head. This can both be in-process or another process.

Errors
- gitty(file_exists(Name) if the file already exists
- gitty(not_at_head(Name, OldCommit) if the head was moved by someone else.
Source delete_head(+Store, +Name) is det
Delete the named head.
Source set_head(+Store, +File, +Hash) is det
Set the head of the given File to Hash
Source load_plain_commit(+Store, +Hash, -Meta:dict) is semidet
Load the commit data as a dict. Fails if Hash does not exist or is not a commit.
Source store_object(+Store, +Hash, +Header:string, +Data:string) is det
Store the actual object. The store must associate Hash with the concatenation of Hdr and Data.
Source load_object(+Store, +Hash, -Data, -Type, -Size) is det
Load an object given its Hash. Data holds the content as a string, Type is the object type (an atom) and Size is the size of the object in bytes.
Source gitty_hash(+Store, ?Hash) is nondet
True when Hash is an object in the store.
Source delete_object(+Store, +Hash)
Delete an existing object