1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-27 04:30:59 +01:00
This commit is contained in:
Wouter den Breejen 2007-07-27 16:22:53 +00:00
parent 856251df03
commit 83ec65edf5
10 changed files with 262 additions and 179 deletions

View file

@ -66,6 +66,9 @@ private:
/* TODO */
int getNewRevisionNumber(const Transaction & txn, TableId table, const Path & statePath);
/* */
bool revisionToTimeStamp(const Transaction & txn, TableId revisions_table, const Path & statePath, const int revision, int & timestamp);
public:
Database();
~Database();
@ -103,24 +106,28 @@ public:
void splitStatePathRevision(const Path & revisionedStatePath, Path & statePath, int & revision);
/* Set the stateReferences for a specific revision (and older until the next higher revision number in the table) */
void setStateReferences(const Transaction & txn, TableId table,
void setStateReferences(const Transaction & txn, TableId references_table, TableId revisions_table,
const Path & statePath, const Strings & references, int revision = -1);
/* Returns the references for a specific revision (and older until the next higher revision number in the table) */
bool queryStateReferences(const Transaction & txn, TableId table,
const Path & statePath, Strings & references, int revision = -1);
/* Returns the referrers for a specific revision (and older until the next higher revision number in the table) */
bool queryStateReferrers(const Transaction & txn, TableId table,
const Path & statePath, Strings & referrers, int revision = -1);
bool queryStateReferences(const Transaction & txn, TableId references_table, TableId revisions_table,
const Path & statePath, Strings & references, int revision = -1, int timestamp = -1);
/* Set the stateReferences for a specific revision (and older until the next higher revision number in the table) */
void setStateReferrers(const Transaction & txn, TableId referrers_table, TableId revisions_table,
const Path & statePath, const Strings & referrers, int revision = -1);
/* Returns the referrers for a specific revision (and older until the next higher revision number in the table) */
bool queryStateReferrers(const Transaction & txn, TableId referrers_table, TableId revisions_table,
const Path & statePath, Strings & referrers, int revision = -1, int timestamp = -1);
/* Set the revision number of the statePath and the revision numbers of all state paths in the references closure */
void setStateRevisions(const Transaction & txn, TableId revisions_table, TableId snapshots_table,
const Path & statePath, const RevisionClosure & revisions);
const RevisionClosure & revisions);
/* Returns all the revision numbers of the state references closure of the given state path */
bool queryStateRevisions(const Transaction & txn, TableId revisions_table, TableId snapshots_table,
const Path & statePath, RevisionClosure & revisions, int root_revision = -1);
const Path & statePath, RevisionClosure & revisions, RevisionClosureTS & timestamps, int root_revision = -1);
/* Returns all available revision numbers of the given state path */
bool queryAvailableStateRevisions(const Transaction & txn, TableId revisions_table,