Resolving Merge Conflicts for Collections

Meta Data Services Programming

Meta Data Services Programming

Resolving Merge Conflicts for Collections

For each collection, MergeVersion uses flags and rules to resolve merge conflicts. CollectionDefFlags that you set for a collection can determine how that collection is merged.

Setting the COLLECTION_MERGEWHOLE Flag

For each origin collection type whose COLLECTION_MERGEWHOLE flag is set, MergeVersion uses this rule:

  • If the primary version's collection differs from the basis version's collection, the repository engine uses the collection from the primary version. For more information, see the Comparing Collections section of Merge Overview.

  • If only the secondary version's collection differs from the basis version's collection, the repository engine uses the collection from the secondary version.

  • If neither version differs from the basis version, the repository engine leaves the collection in the current version unchanged.
Not Setting the COLLECTION_MERGEWHOLE Flag

For each origin collection type whose COLLECTION_MERGEWHOLE flag is not set, MergeVersion combines the items in the two collections as follows:

  • MergeVersion includes in the resulting collection each item in the basis version not changed in or deleted from either the primary version or secondary version. For more information, see the Comparing Versioned Relationships section of Merge Overview.

  • MergeVersion includes in the resulting collection each item in the primary version's collection that differs from the basis version.

  • MergeVersion includes in the resulting collection each item in the secondary version's collection that differs from the basis version, provided the corresponding items in the primary version and basis version do not differ from each other.

Note  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 will exclude 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 will exclude the item.

For more information about merge behavior, see Examples of Merging Versions.

See Also

CollectionDefFlags Enumeration

IRepositoryObjectVersion::MergeVersion

Merge Overview

Merging Object Versions

Resolving Merge Conflicts for Properties

Versioning Objects