Using mergetype to manage merge behavior

You can use element types for some classes of files for which you want to define a merge behavior that differs from the behavior for predefined element types. For some types of files, you may want to merge versions manually rather than let them be merged automatically. One example is a Visual Basic form file, which is a generated text file. Visual Basic generates the form file based on the form that a developer creates in the Visual Basic GUI. Rather than let the form file be changed during a merge operation, you want to regenerate the form file from the Visual Basic GUI. For this type of file, the developer controls the contents of the file in the target view. The developer might want to copy the version in the development stream or generate a new version.

Some types of files never need to be merged. For these types of files, you may want to ensure that no one attempts to merge them accidentally. For example, the deployment, or staging, component contains the executable files that you ship to customers or install in-house. These files are not under development; they are the product of the development phase of the project cycle. During a deliver operation (or a rebase operation), an attempt is made to merge these executable files to the target versions unless the files are of an element type for which different merge behavior is specified.

To define different merge behavior for special types of files in your environment, you can create an element type and specify one of the following mergetypes:

  • copy

    During a merge or findmerge operation within a delivery or a rebase, a version whose element type has the mergetype copy is not merged. The source version is copied to the target version without user intervention.

  • never

    A merge or findmerge operation ignores versions whose element type has never as a mergetype.

  • user

    A merge or a findmerge operation performs trivial merges only. Nontrivial merges must be made manually. The graphic user interface (GUI) tools provide extra options for user mergetype to keep the target version, copy the source version (from the source stream), or back out of the deliver operation.

Note: If you fail to specify a mergetype of copy, never, or user for these element types, developers may encounter problems when they attempt to deliver work or rebase their streams. For example, default merge managers cannot handle data in these files. Developers create executable files when they build and test their work prior to delivering it. If these files are under version control as derived objects, they are included in the change set of the current activity.

For information about creating element types, see the mkeltype reference page in the VersionVault Command Reference.