CFx SDK Documentation 2024 SP0
|
#include <TfRevisionControl.h>
Static Public Member Functions | |
static OdTfRepositoryPtr | createObject (OdStreamBufPtr pStream, OdDbHostAppServices *pHostApp) |
Static Public Member Functions inherited from OdRxObject | |
static OdRxObjectPtr | cast (const OdRxObject *pointer) |
static OdRxClass * | desc () |
Additional Inherited Members | |
Protected Member Functions inherited from OdTfStorage | |
void | makePatch (OdStreamBuf *s, const OdTfDigestArray &from, const OdTfDigestArray &to, const OdTfRevisionControl::ReferenceList &refs) const |
Protected Attributes inherited from OdTfStorage | |
OdTfStorageImpl * | m_pImpl |
Storage of drawing revisions with history tracking. Drawing databases checked out from this repository will have check out tracking information associated with it (branch tracking, parent commit, merge tracking, etc.).
Definition at line 891 of file TfRevisionControl.h.
OdDbDatabasePtr OdTfRepository::checkout | ( | const OdString & | branch, |
bool | partial = false |
||
) |
Convenience checkout() method using a branch for both as source and as current branch for commits.
branch | [in] Branch for both source and to be set as current for commits. |
partial | [in] Flag that determines whether all the objects are loaded in memory (false) or not (true). |
OdDbDatabasePtr OdTfRepository::checkout | ( | const OdString & | reference, |
const OdString & | localBranch, | ||
bool | partial = false |
||
) |
Convenience checkout() method using a reference as a source.
reference | [in] Source branch to check out a database from. |
localBranch | [in] Branch to be set as current for commits. |
partial | [in] Flag that determines whether all the objects are loaded in memory (false) or not (true). |
OdDbDatabasePtr OdTfRepository::checkout | ( | const OdTfDigest & | sha, |
const OdString & | localBranch, | ||
bool | partial = false |
||
) |
Reads a database from the repository. The database is checked out from a specific revision from the repository. A "localBranch" sets a default branch for commit. If "localBranch" is an empty string, the database will be detached from any branch. If "partial" is false, all the objects are loaded in memory. If they will be eventually loaded anyway, it is much faster not to set "partial" flag to true.
sha | [in] Source commit to check out a database from. |
localBranch | [in] Branch to be set as current for commits. |
partial | [in] Flag that determines whether all the objects are loaded in memory (false) or not (true). |
OdTfDigest OdTfRepository::commit | ( | OdDbDatabase * | pDb, |
const OdTfDigestArray & | parents, | ||
const OdTfCommitAnnotation & | message = OdTfCommitAnnotation() , |
||
const OdDbObjectIdArray * | objectsToSave = 0 |
||
) |
Commit a .dwg database into the .dsf repository. Can be used for both the initial import in the repository or for integrating changes made by third party editors.
The parameter "parents" specifies the parent commits for which this database state is considered the next revision. "Parents" is empty for an initial commit, contains a single commit for a regular revision, or contains multiple commits for a merge revision.
Importing does not update any references/branches so the returned hash must be stored as a reference, otherwise the commit will become inaccessible.
pDb | [in] Database to be imported to the storage. |
parents | [in] Parent commits of the imported database. |
message | [in] Commit information. |
objectsToSave | [in] List of objects to be saved. Optional. Used to perform a partial commit. |
|
static |
Opens an existing .dsf storage or creates a new .dsf storage.
pStream | [in] Stream associated with the storage. |
pHostApp | [in] Platform specific host application services. |
OdTfCommitInfo OdTfRepository::getCommitInfo | ( | const OdTfDigest & | sha | ) | const |
Reads from the storage a structure describing relationships of a commit in the revision control database.
sha | [in] Commit hash. |
OdTfDigest OdTfRepository::import | ( | OdDbDatabase * | pDb, |
const OdString & | localbranch | ||
) |
The initial import to store a .dwg database into the .dsf storage.
pDb | [in] Database to be stored in the storage. |
localbranch | [in] Branch to be set as current for commits. |
void OdTfRepository::init | ( | const bool | isNewStorage | ) |
Initializes a storage after creation by OdTfRepository::createObject(OdStreamBufPtr, OdDbHostAppServices*).
isNewStorage | [in] True to create a new storage. |
OdStreamBufPtr OdTfRepository::makePatch | ( | const OdTfDigestArray & | from, |
const OdTfDigest & | to, | ||
const OdTfRevisionControl::ReferenceList & | refs = OdTfRevisionControl::ReferenceList() |
||
) | const |
Intermediate commits along the branch(es) are automatically included.
Collects all the changes since the "from" set of commits to the "to" set of commits. Together with applyPatch() it is designed to transfer changes between repositories.
The "from" set of commits is considered available in the remote repository. The "to" set of commits are the commits that need to be made available on the remote. Also "to" must contain hashes "from". Each names a single commit to be included. So, if all commits of a branch need to be included, then each commit from that branch needs to be included in the "to" set.
Consider the following example scenarios:
Remote: – C7 / C0 – C1 – C2 -----— C5 – C6 \ / ^ – C3 – C4 – master
Local: master v C0 – C1 – C2 \ – C3 ^ branch1
If the local repository has commit C3 and wants to update to head of master, it makes a request to the remote 'update({C3}, {master})' which is translated on the remote to 'makePatch({C3}, {C6})'. This will only include the differences between commit C3 and commit C6 into the patch {C3, C4, C5, C6}.
If the local repository has two branches up to C2, C3 (C0, C1, C2, C3) and wants to pull the remote changes up to C6, it makes a request to the remote 'pull({C2, C3}, master)' which is translated on the remote to 'makePatch({C0, C1, C2, C3}, {C2, C3, C4, C5, C6, C7})'. This will include all objects from C2, C3, C4, C5, C6 and C7 in the patch not already available in any of the local branches. C2, C3 must be included in the patch. Reason: the local repository stores C2, C3 without compression. But on the remote repository commits, that are not branch head commits, will be compressed {C0, C1, C2, C3, C4, C5}. Patch in the local repository replaces not compressed {C2, C3} to compressed. C7 must be included because it branched from C2.
This can also be used for the initial clone of a repository by making a request to the remote 'pull({}, master)' which is thus translated to 'makePatch({}, {C0, C1, C2, C3, C4, C5, C6, C7})' 'update({}, {master})' which only includes all objects for C6 in the patch.
from | [in] Set of commit hashes for the starting commits. |
to | [in] Commit hash of the end commit. |
refs | [in] Set of references to be included in the patch. |
OdStreamBufPtr OdTfRepository::makePatch | ( | const OdTfDigestArray & | from, |
const OdTfDigestArray & | to, | ||
const OdTfRevisionControl::ReferenceList & | refs = OdTfRevisionControl::ReferenceList() |
||
) | const |
Intermediate commits along the branch(es) are automatically included.
Collects all the changes since the "from" set of commits to the "to" set of commits. Together with applyPatch() it is designed to transfer changes between repositories.
The "from" set of commits is considered available in the remote repository. The "to" set of commits are the commits that need to be made available on the remote. Also "to" must contain hashes "from". Each names a single commit to be included. So, if all commits of a branch need to be included, then each commit from that branch needs to be included in the "to" set.
Consider the following example scenarios:
Remote: – C7 / C0 – C1 – C2 -----— C5 – C6 \ / ^ – C3 – C4 – master
Local: master v C0 – C1 – C2 \ – C3 ^ branch1
If the local repository has commit C3 and wants to update to head of master, it makes a request to the remote 'update({C3}, {master})' which is translated on the remote to 'makePatch({C3}, {C6})'. This will only include the differences between commit C3 and commit C6 into the patch {C3, C4, C5, C6}.
If the local repository has two branches up to C2, C3 (C0, C1, C2, C3) and wants to pull the remote changes up to C6, it makes a request to the remote 'pull({C2, C3}, master)' which is translated on the remote to 'makePatch({C0, C1, C2, C3}, {C2, C3, C4, C5, C6, C7})'. This will include all objects from C2, C3, C4, C5, C6 and C7 in the patch not already available in any of the local branches. C2, C3 must be included in the patch. Reason: the local repository stores C2, C3 without compression. But on the remote repository commits, that are not branch head commits, will be compressed {C0, C1, C2, C3, C4, C5}. Patch in the local repository replaces not compressed {C2, C3} to compressed. C7 must be included because it branched from C2.
This can also be used for the initial clone of a repository by making a request to the remote 'pull({}, master)' which is thus translated to 'makePatch({}, {C0, C1, C2, C3, C4, C5, C6, C7})' 'update({}, {master})' which only includes all objects for C6 in the patch.
from | [in] Set of commit hashes for the starting commits. |
to | [in] Set of commit hashes for the ending commits. |
refs | [in] Set of references to be included in the patch. |
OdTfDigest OdTfRepository::writeCommitInfo | ( | OdTfCommitInfo & | commitInfo | ) |
Writes to the storage a structure describing relationships of a commit in the revision control database.
commitInfo | [in] Structure describing relationships of a commit in the revision control database. |