25#ifndef _TFREVISIONCONTROL_H_INCLUDED_
26#define _TFREVISIONCONTROL_H_INCLUDED_
69 return memcmp(
data, other.
data, 20) < 0;
81 return memcmp(
data, other.
data, 20) == 0;
93 return memcmp(
data, other.
data, 20) != 0;
102 memset(res.
data, 0, 20);
114 char test[20] = { 0 };
115 return memcmp(test,
data, 20) == 0;
286 :annotation(author, message, date, arbitraryUserData) {}
336template<OdTfRevisionControl::MergeResolution conflictResolution = OdTfRevisionControl::kMergeTheirsConflict>
349 return autoResolution ? autoResolution : conflictResolution;
380 return autoResolution;
405struct OdTfStorageImpl;
881 friend struct OdTfStorageImpl;
910 void init(
const bool isNewStorage);
963 bool partial =
false);
bool operator!=(T left, const OdGiVariant::EnumType right)
bool operator==(T left, const OdGiVariant::EnumType right)
bool operator<(const OdString &s1, const OdString &s2)
OdSmartPtr< OdTfRepository > OdTfRepositoryPtr
OdArray< OdTfDigest, OdMemoryAllocator< OdTfDigest > > OdTfDigestArray
OdSmartPtr< OdTfStorage > OdTfStoragePtr
size_type append(const T &value)
virtual void getBytes(void *buffer, OdUInt32 numBytes)
virtual void putBytes(const void *buffer, OdUInt32 numBytes)
FIRSTDLL_EXPORT_STATIC static const OdString kEmpty
static OdTfRepositoryPtr createObject(OdStreamBufPtr pStream, OdDbHostAppServices *pHostApp)
OdDbDatabasePtr checkout(const OdTfDigest &sha, const OdString &localBranch, bool partial=false)
void init(const bool isNewStorage)
OdTfDigest writeCommitInfo(OdTfCommitInfo &commitInfo)
OdTfCommitInfo getCommitInfo(const OdTfDigest &sha) const
OdStreamBufPtr makePatch(const OdTfDigestArray &from, const OdTfDigestArray &to, const OdTfRevisionControl::ReferenceList &refs=OdTfRevisionControl::ReferenceList()) const
OdDbDatabasePtr checkout(const OdString &branch, bool partial=false)
OdDbDatabasePtr checkout(const OdString &reference, const OdString &localBranch, bool partial=false)
OdStreamBufPtr makePatch(const OdTfDigestArray &from, const OdTfDigest &to, const OdTfRevisionControl::ReferenceList &refs=OdTfRevisionControl::ReferenceList()) const
OdTfDigest commit(OdDbDatabase *pDb, const OdTfDigestArray &parents, const OdTfCommitAnnotation &message=OdTfCommitAnnotation(), const OdDbObjectIdArray *objectsToSave=0)
GLint GLenum GLsizei GLsizei GLint GLsizei const void * data
TFDLL_EXPORT bool dryMerge(const OdDbDatabase *pDb, const OdTfDigest &sha, OdTfMergeHandler &mergeHandler)
TFDLL_EXPORT void getRevisionDifference(OdDbDatabase *pDb, const OdTfDigest &newRevision, const OdTfDigest &oldRevision, ChangeList &result)
TFDLL_EXPORT OdTfDigest commit(OdDbDatabase *pDb, const OdTfCommitAnnotation &message, const OdDbObjectIdArray *objectsToSave=0)
TFDLL_EXPORT void endPartialImport(OdDbDatabase *pDb)
bool isConflict(ChangeType myChange, ChangeType theirChange)
TFDLL_EXPORT OdString getLocalBranch(OdDbDatabase *pDb, OdTfDigest *head=0)
TFDLL_EXPORT OdDbObjectIdArray getLocalChanges(OdDbDatabase *pDb)
TFDLL_EXPORT OdTfRepository * getRepository(OdDbDatabase *pDb)
std::map< OdDbHandle, ChangeType > ChangeList
TFDLL_EXPORT bool merge(OdDbDatabase *pDb, const OdTfDigest &sha, OdTfMergeHandler &mergeHandler, bool noFastForward=false)
TFDLL_EXPORT OdStreamBufPtr compressData(OdDbDatabase *pDb)
TFDLL_EXPORT void writeObjectPartial(OdDbObjectId id, bool pageObjectToDisk=true)
TFDLL_EXPORT void loadObjects(OdDbDatabase *pDb, OdDbObjectIterator *pObjects, OdMTLoadReactor *pReactor=0)
TFDLL_EXPORT OdTfRepositoryPtr detachRepository(OdDbDatabase *pDb)
TFDLL_EXPORT void switchBranch(OdDbDatabase *pDb, const OdString &branch, bool hard=true)
std::map< OdString, OdTfDigest > ReferenceList
TFDLL_EXPORT void beginPartialImport(OdStreamBufPtr pStream, OdDbDatabase *pDb)
TFDLL_EXPORT bool getCommonAncestor(OdDbDatabase *pDb, const OdTfDigest &theirSha, OdTfDigest &ancestor)
OdTfCommitAnnotation(const OdString &author=OdString::kEmpty, const OdString &message=OdString::kEmpty, const OdTimeStamp &date=OdTimeStamp(OdTimeStamp::kInitUniversalTime), OdStreamBuf *arbitraryUserData=0)
OdTfCommitInfo(const OdString &author=OdString::kEmpty, const OdString &message=OdString::kEmpty, const OdTimeStamp &date=OdTimeStamp(OdTimeStamp::kInitUniversalTime), OdStreamBuf *arbitraryUserData=0)
OdTfCommitAnnotation annotation
static OdTfDigest kNull()
void read(OdStreamBuf *pBuf)
void write(OdStreamBuf *pBuf) const
OdTfRevisionControl::MergeResolution operator()(const OdDbHandle &h, OdTfRevisionControl::ChangeType myChange, OdTfRevisionControl::ChangeType theirChange, OdTfRevisionControl::MergeResolution autoResolution) override
virtual OdTfRevisionControl::MergeResolution operator()(const OdDbHandle &h, OdTfRevisionControl::ChangeType myChange, OdTfRevisionControl::ChangeType theirChange, OdTfRevisionControl::MergeResolution autoResolution)=0
OdTfRevisionControl::ChangeType myChange
OdTfRevisionControl::ChangeType theirChange
Conflict(const OdDbHandle &handle, OdTfRevisionControl::ChangeType myChange, OdTfRevisionControl::ChangeType theirChange)
OdTfRevisionControl::MergeResolution operator()(const OdDbHandle &h, OdTfRevisionControl::ChangeType myChange, OdTfRevisionControl::ChangeType theirChange, OdTfRevisionControl::MergeResolution autoResolution) override
Conflicts const & conflicts() const
OdArray< Conflict > Conflicts
void getRevisionDifference(OdDbDatabase *pDb, const OdTfDigest &revision, OdTfRevisionControl::ChangeList &result) const
OdStreamBufPtr makePatch(const OdTfDigestArray &from, const OdTfDigestArray &to, const OdTfRevisionControl::ReferenceList &refs=OdTfRevisionControl::ReferenceList()) const
void setReference(const OdString &refName, const OdTfDigest &sha)
void makePatch(OdStreamBuf *s, const OdTfDigestArray &from, const OdTfDigestArray &to, const OdTfRevisionControl::ReferenceList &refs) const
bool getReference(const OdString &refName, OdTfDigest &sha) const
OdDbDatabasePtr merge(const OdTfDigest &mine, const OdTfDigest &theirs, const OdTfDigest &base, OdTfMergeHandler &mergeHandler) const
void getRevisionDifference(const OdTfDigest &newRevision, const OdTfDigest &oldRevision, OdTfRevisionControl::ChangeList &result) const
OdTfDigest store(OdDbDatabase *pDb, const OdDbObjectIdArray *objectsToSave=0)
OdStreamBufPtr getStorageStream() const
void dryMerge(const OdDbDatabase *pDb, const OdTfDigest &theirs, const OdTfDigest &base, OdTfMergeHandler &mergeHandler) const
OdTfDigest applySchemePatch(OdStreamBufPtr &schemePatch) const
void getReferences(OdTfRevisionControl::ReferenceList &refs) const
bool isSchemePresent(const OdTfDigest &sha) const
void setReference(const OdTfRevisionControl::ReferenceList &branches)
OdStreamBufPtr makeSchemePatch(const OdTfDigest &sha) const
void dryMerge(const OdTfDigest &mine, const OdTfDigest &theirs, const OdTfDigest &base, OdTfMergeHandler &mergeHandler) const
OdTfStorageImpl * m_pImpl
void merge(OdDbDatabase *pDb, const OdTfDigest &theirs, const OdTfDigest &base, OdTfMergeHandler &mergeHandler) const
OdDbDatabasePtr retrieve(const OdTfDigest &sha, bool partial=false) const
void applyPatch(OdStreamBuf *s, OdTfDigestArray &roots, OdTfRevisionControl::ReferenceList &refs)