CFx SDK Documentation 2024 SP0
|
Typedefs | |
typedef std::map< OdString, OdTfDigest > | ReferenceList |
typedef std::map< OdDbHandle, ChangeType > | ChangeList |
Enumerations | |
enum | ChangeType { kObjectUnmodified = 0 , kObjectAdded = 1 , kObjectDeleted , kObjectModified } |
enum | MergeFlags { kMergeFlagBase = 0 , kMergeFlagMine = 1 , kMergeFlagTheirs = 2 , kMergeFlagFull = 4 , kMergeMaskMineTheirs = kMergeFlagMine | kMergeFlagTheirs , kMergeMaskResolution = kMergeMaskMineTheirs | kMergeFlagFull } |
enum | MergeResolution { kMergeRevertFull = kMergeFlagBase | kMergeFlagFull , kMergeMineConflict = kMergeFlagMine , kMergeMineFull = kMergeFlagMine | kMergeFlagFull , kMergeTheirsConflict = kMergeFlagTheirs , kMergeTheirsFull = kMergeFlagTheirs | kMergeFlagFull , kMergePostpone = kMergeMineFull , kMergeNoResolution = 0 } |
This namespace contains revision control specific definitions.
typedef std::map<OdDbHandle, ChangeType> OdTfRevisionControl::ChangeList |
Change list.
Definition at line 161 of file TfRevisionControl.h.
typedef std::map<OdString, OdTfDigest> OdTfRevisionControl::ReferenceList |
Reference list.
Definition at line 141 of file TfRevisionControl.h.
Declares change types.
Enumerator | |
---|---|
kObjectUnmodified | Object not modified or not existing |
kObjectAdded | Object added to database |
kObjectDeleted | Object deleted from database |
kObjectModified | Object modified |
Definition at line 146 of file TfRevisionControl.h.
Flags for defining the MergeResolution values.
Enumerator | |
---|---|
kMergeFlagBase | |
kMergeFlagMine | |
kMergeFlagTheirs | |
kMergeFlagFull | |
kMergeMaskMineTheirs | |
kMergeMaskResolution |
Definition at line 166 of file TfRevisionControl.h.
Declares merge resolutions.
Enumerator | |
---|---|
kMergeRevertFull | Reject changes of both sides and revert to the object revision of the base. |
kMergeMineConflict | Resolve the conflict by preferring my changes over their changes for conflicting properties of the object. |
kMergeMineFull | Resolve the conflict by preserving all my changes and discard all their changes to the object. |
kMergeTheirsConflict | Resolve the conflict by preferring their changes over my changes for conflicting properties of the object. |
kMergeTheirsFull | Resolve the conflict by discarding all my changes and integrate all their changes to the object. |
kMergePostpone | Do not resolve the conflict in any way yet. The conflict should be recorded for later resolving. |
kMergeNoResolution | Passed in autoResolution to OdTfMergeHandler if the conflict can not be resolved automatically and requires an explicit decision. Not to be returned by OdTfMergeHandler! |
Definition at line 179 of file TfRevisionControl.h.
TFDLL_EXPORT void OdTfRevisionControl::beginPartialImport | ( | OdStreamBufPtr | pStream, |
OdDbDatabase * | pDb | ||
) |
Begins partial import of the database into the revision control storage if the full import cannot be performed or not needed.
pStream | [in] Stream, associated with the storage. |
pDb | [in] Database to be imported to the storage. |
TFDLL_EXPORT OdTfDigest OdTfRevisionControl::commit | ( | OdDbDatabase * | pDb, |
const OdTfCommitAnnotation & | message, | ||
const OdDbObjectIdArray * | objectsToSave = 0 |
||
) |
Saves changes in the database to the repository, creates a commit object and shifts the current branch tip if not checkout as detached. The "objectsToSave" optional parameter is a list of objects to save. It can be used to perform a partial commit.
Includes all tracked merged commits as parents of the commit.
pDb | [in] The database, which state has to be saved. |
message | [in] Commit message. |
objectsToSave | [in] A list of objects to be saved. Optional. Used to perform a partial commit. |
TFDLL_EXPORT OdStreamBufPtr OdTfRevisionControl::compressData | ( | OdDbDatabase * | pDb | ) |
Creates a new OdStreamBufPtr with compressed data from the OdTfStorage linked to the OdDbDatabase.
pDb | [in] Database linked to the OdTfStorage. |
TFDLL_EXPORT OdTfRepositoryPtr OdTfRevisionControl::detachRepository | ( | OdDbDatabase * | pDb | ) |
Removes the link between the OdDbDatabase and the OdTfStorage.
pDb | [in] Database linked to the OdTfStorage. |
TFDLL_EXPORT bool OdTfRevisionControl::dryMerge | ( | const OdDbDatabase * | pDb, |
const OdString & | reference, | ||
OdTfMergeHandler & | mergeHandler | ||
) |
TFDLL_EXPORT bool OdTfRevisionControl::dryMerge | ( | const OdDbDatabase * | pDb, |
const OdTfDigest & | sha, | ||
OdTfMergeHandler & | mergeHandler | ||
) |
Dry merge operation for calculating all the changes and conflicts.
Does not perform any real merge operation. Only useful for recording/inspecting callbacks to mergeHandler in order to have the full picture before performing the actual merge operation. The return value of the mergeHandler is ignored.
pDb | [in] The database to be used as my side for the merge. |
sha | [in] Commit to use as their side for merge. |
reference | [in] Branch to use as their side for merge. |
mergeHandler | [in] Callback for recording/inspecting all changes. |
TFDLL_EXPORT void OdTfRevisionControl::endPartialImport | ( | OdDbDatabase * | pDb | ) |
Ends the partial import to the revision control storage creating a first revision.
pDb | [in] Database to end the partial import. |
TFDLL_EXPORT bool OdTfRevisionControl::getCommonAncestor | ( | OdDbDatabase * | pDb, |
const OdTfDigest & | theirSha, | ||
OdTfDigest & | ancestor | ||
) |
Find common parent of two commits.
pDb | [in] Database linked to the OdTfStorage. |
theirSha | [in] Hash code of other(their) commit. |
ancestor | [out] Hash code of common parent for theirSha and current branch. |
Note: local(mine) hash code of commit is taken from the local branch it is currently in the OdTfStorage.
TFDLL_EXPORT OdString OdTfRevisionControl::getLocalBranch | ( | OdDbDatabase * | pDb, |
OdTfDigest * | head = 0 |
||
) |
Returns the name of the current working branch.
pDb | [in] Database to get the working branch from. |
head | [out] Hash code of the branch head commit. |
TFDLL_EXPORT OdDbObjectIdArray OdTfRevisionControl::getLocalChanges | ( | OdDbDatabase * | pDb | ) |
Gets a list of objects that were changed since the last commit.
pDb | [in] Database to get the list of changes. |
TFDLL_EXPORT OdTfRepository * OdTfRevisionControl::getRepository | ( | OdDbDatabase * | pDb | ) |
Gets an existing .dsf storage.
pDb | [in] Database linked to the OdTfStorage. |
TFDLL_EXPORT void OdTfRevisionControl::getRevisionDifference | ( | OdDbDatabase * | pDb, |
const OdTfDigest & | newRevision, | ||
const OdTfDigest & | oldRevision, | ||
ChangeList & | result | ||
) |
Gets a list of handles of the objects that differ between revisions. Revisions may actually be unrelated.
pDb | [in] Database which storage to get the list of differences from. |
newRevision | [in] Hash code of the first revision. |
oldRevision | [in] Hash code of the second revision. |
result | [out] List of changes, containing IDs of objects that differ between revisions. |
|
inline |
Check if my and their changes of the object conflict and requires an explicit resolution.
Changes conflict when both sides are modified or when one side is modified and the other side has been deleted.
myChange | ChangeType of the object of my side. |
theirChange | ChangeType of the object of their side. |
Definition at line 218 of file TfRevisionControl.h.
TFDLL_EXPORT void OdTfRevisionControl::loadObjects | ( | OdDbDatabase * | pDb, |
OdDbObjectIterator * | pObjects, | ||
OdMTLoadReactor * | pReactor = 0 |
||
) |
Loads objects from the storage if earlier a partial checkout was performed.
pDb | [in] Database to load objects to. |
pObjects | [in] Iterator that contains a list of objects to be loaded. |
pReactor | [in] Reactor for multi-threaded loading. Optional. |
TFDLL_EXPORT bool OdTfRevisionControl::merge | ( | OdDbDatabase * | pDb, |
const OdString & | reference, | ||
OdTfMergeHandler & | mergeHandler, | ||
bool | noFastForward = false |
||
) |
TFDLL_EXPORT bool OdTfRevisionControl::merge | ( | OdDbDatabase * | pDb, |
const OdTfDigest & | sha, | ||
OdTfMergeHandler & | mergeHandler, | ||
bool | noFastForward = false |
||
) |
Merges changes from the repository to the database. Merge operation does not automatically commit changes, only runtime database is changed.
Adds the source commit as a tracked merge parent for this drawing. This makes the source commit as a parent when committing the changes to the repository.
pDb | [in] A database to merge into. |
sha | [in] Commit to use as their side for merge. |
reference | [in] Branch to use as their side for merge. |
conflictHandler | [in/out] Callback for handling merge conflicts. |
noFastForward | [in] Flag that prohibits fast forward merging (when true). |
TFDLL_EXPORT void OdTfRevisionControl::switchBranch | ( | OdDbDatabase * | pDb, |
const OdString & | branch, | ||
bool | hard = true |
||
) |
Updates the database to the revision on the tip of the specified branch and makes this branch default for commits. All uncommitted changes in the runtime database will be lost. This behavior can be modified by setting the "hard" flag. If "hard" is set to false and there are non-committed changes in the database, operation will fail. If "hard" is true (default), all non-committed changes will be lost.
pDb | [in] Database which storage to switch the branch in. |
branchName | [in] Name of the branch to switch to. |
hard | [in] Flag that defines the behavior of the function if there are non-committed changes in the database. |
TFDLL_EXPORT void OdTfRevisionControl::writeObjectPartial | ( | OdDbObjectId | id, |
bool | pageObjectToDisk = true |
||
) |
Imports an object to the storage.
id | [in] ID of the object to be imported to the storage. |
pageObjectToDisk | [in] If true (default) flushes the stream buffer to the file after importing the object. |