This method changes the current object version by combining its property values and origin collections with the property values and origin collections of another version of the same object.
HRESULT MergeVersion(
IRepositoryObjectVersion *pOtherVersion
long fFlags
);
*pOtherVersion
[in]
The IRepositoryObjectVersion interface pointer for the predecessor of the merge. That is, the object version whose property values and collections should be merged into the current version.
fFlags
[in]
Long integer specifying which object version is the primary and which is secondary in the merge.
Constant | Value | Description |
---|---|---|
PRIMARY | 1 | The predecessor object is primary and the current object is secondary. |
SECONDARY | 2 | The predecessor object is secondary and the current object is primary. |
S_OK
The method completed successfully.
This method failed to complete successfully.
Relationships are inserted at the end of the sequenced collection.
The two object versions must be versions of the same object.
The current object version must be unfrozen. The other object version must be frozen.
MergeVersion compares the property values and collections of each object version to a third version, called the Basis Version.
The repository engine considers one of the two to-be-merged object versions as the primary version, and the other to be the secondary version, according to the value of fFlags you supply. During the merge, the repository engine considers each property and origin collection type in turn. For each property, MergeVersion uses this rule:
For each origin collection type whose COLLECTION_MERGEWHOLE flag is set, MergeVersion uses this rule:
For each origin collection type whose COLLECTION_MERGEWHOLE flag is not set, MergeVersion combines the items in the two collections as follows:
The resulting collection can exclude some items found in the basis object version's collection. For example, if the primary version's collection excludes the item, the resulting collection excludes the item. Similarly, if the primary version's collection includes an item that is identical to an item in the Basis Version's collection, but the secondary object version excludes the item, the resulting collection excludes the item.