The Merge Branches command allows you to merge changes from any folder in Vault to any another folder within the same repository. Usually, these are folders that have been branched from each other and modifications have been continuing in one or both of them. At some point, you may want to resolve all differences between the branches, or move all the changes from one folder to another. Note that although the common case is to merge together branches that have a common ancestor, there is no requirement that they be related – any two folders can be merged.
The folder from which changes are to be migrated is called the origin folder, and the folder which changes are to be applied to is called the target folder.
To do this, go to the Tools menu and click Merge Branches. A wizard will come up to lead you through the steps.
The first page of the wizard will explain the steps in this operation. The merge has three phases:
• Moves ands Shares
• Renames
• Everything else
The Move and Rename operations are actually committed to the repository as the wizard progresses. The other changes are not committed but are put in the Pending Change Set for your review.
Merge supports the following operations:
• File modifications
• File and folder Renames, Moves, Adds and Deletions
• File
and folder Shares. Shares created within the origin are created in the target
folder, but are not shared between the origin and the target.
Shares going into or out of the
origin are not shared in the target. Files and folders in the origin that are
shared outside the origin will be ignored in the target, but a warning message
will be put in the summary page indicating this. Files and folders shared into
the origin will be treated as adds, with a warning message saying they are
shares, and those items will be yellow in the list.
• File and folder Share Branch
• File and folder Copy Branch and Folder Snapshot. These are treated as adds in the target, and not as branches or Snapshots.
The following operations are completely ignored when merging a folder. The changes in the origin will not be applied in the target, and they will not show up in the wizard list:
• Cloak
• File Property Change
• Pin Status
• File and Folder Label
• Folder security changes
• File/folder undelete. Since branches don’t create deleted items in the branch, you can’t undelete a file or folder in the branch that existed in the trunk. You can delete and then undelete a file in the branch, but this won’t have any effect in the trunk unless the file was modified in some other way.
The screens in the Merge Branches are:
Welcome Screen
This screen describes the process the Merge Branches operation will have, and the items the user will need to specify to use the command.
Specify Origin Folder
This screen allows you to select the “origin” folder from which changes are to be migrated into a target folder
Specify Target Folder
This screen allows you to select the “target” folder, which will be modified to contain the changes that have been applied to the origin folder.
Select Changes To Be Merged
This screen allows you to select which changes in the origin folder to apply to the target folder. Select two versions of the folder, and differences between those versions in the origin folder will be applied to the target folder.
The earliest version you choose essentially becomes the baseline version between the origin and target folders. If the target file is different from the baseline version you’ve chosen, then a file merge takes place between the source and target files to resolve the differences, so that both sets of differences will be reflected in the merged target version.
Select the versions by using CTRL and the left mouse button to select exactly two versions.
Settings
This screen allows you to enter the following settings:
• Attempt Automatic Merge on Individual Files. If checked, Merge Branches will attempt to automatically resolve conflicts in files that have been changed in both the origin and the target folders. If unchecked, any file that needs merged will be added to the pending change set with “Needs Merge” status, and you will need to manually resolve each merge.
• Comment box (optional). Enter the comment that will be used by default as the change set comment for the changes that result from the Merge Branch operation.
Moves And Shares
The Move/Share page lists all the move and share operations to be performed as part of the merge.
• Items which cannot proceed are shown with a red background. For example, if a file was modified in the branch but has been deleted in the trunk.
• Items which appear to be harmless are shown with a white background and they are check by default. For example, renaming a file in the branch which has been unchanged in the trunk is an operation which will proceed by default.
• Items which can proceed but may be undesirable are shown with a yellow background. For example, if a file was renamed in the branch but has also been renamed in the trunk (to something else), then this operation will not be checked and will be shown in yellow.
• Items which do not need to proceed are shown in blue. These are cases where the trunk is in exactly the state it would be in if the merge were to occur anyway. For example, if a file has been renamed in the branch and has been renamed the same way in the trunk, then nothing needs to be done.
Choose the items that are to be included in the merge by selecting the checkbox next to each item. The move operations will be performed and committed to the repository as the wizard proceeds.
Renames
The Rename page lists all the rename operations in the same manner as the Move/Share list. Choose the items that are to be included in the merge by selecting the checkbox next to each item. The rename operations will be performed and committed to the repository as the wizard proceeds.
Retrieve Files from Server
In order to do the merge branch operation, files are retrieved from the server, so Vault can compute the differences between the version. The Retrieve Files from Server page shows you the status of the file downloads as they are being downloaded from the server.
Adds, Deletes, Edits
The Adds, Deletes, Edits page lists all adds, deletes and edits in the same manner as the Move list. Choose the items that are to be included in the merge by selecting the checkbox next to each item. These operations will be performed, but will not be immediately committed to the repository. Instead, they will be placed in the Pending Change Set for your review and can be committed once you’ve reviewed the changes. Any files in a Needs Merge status after the Merge Branches will need to have their conflicts resolved before the changes can be committed.
Modify Files
The Modify Files page simply shows you the progress of the merge and when it is completed.
Summary
The Summary page will show you all the operations that were performed and the ones which remain pending.