A merge rule is used to merge changes from a source stream to a destination stream and keep track of which changes have been merged. Merge rules are automatically created when you create versions and features, but you can create a merge rule for any 2 streams to provide complete flexibility.
If you want to do a one off merge then it is easier to do a direct merge as described in the section called “Merging Changesets”. If you often merge from one stream to another and want to keep track of which changes have been merged then you should create a merge rule.
Creating a Merge Rule
To create a merge rule go to the Merging view, right-click the 'Merge Rules' tree item and select 'New'.
Press the browse '...' button in the top-right to select the source stream. Press the browse button below to select the destination stream.
You can enter an include filter or exclude filter. If only an include filter is specified then only files matching this filter will be included. If only an exclude filter is specified then all files except those matching the exclude filter will be included. If both include and exclude filters are specified then only the files which match the include filters and do not match the exclude filters will be specified. The filter should contain a forward slash for directories - so '*/src/*.c' will match all C files in a directory called 'src'.
Check the 'Automatically merge submitted changesets' checkbox if you want changes submitted in the source stream to be automatically merged into the destination stream.
Check the 'Make submitted changesets pending' checkbox if you want to be notified when a changeset has been submitted in the source stream. If a merge rule has pending changesets then it will appear in bold with a count of the number of pending changes. Pending merges also appear when viewing the stream in the Administration or Repository view.
Press 'OK' to create the merge rule. After the merge rule is created you can change the details with the 'Properties' menu.
Expand the merge rule to show the 'Merged Changesets', 'Pending Changesets', 'Unmerged Changesets' and 'Excluded Changesets'.
'Merged Changesets' lists all the changesets which have been submitted in the source stream and merged into the destination stream. Double-click a merged changeset to open the changeset dialog showing the changeset details.
In Progress Changesets
'In Progress Changesets' are changesets which have been submitted in the source stream and will be automatically merged into the destination stream. If the auto-merge fails then they will be moved into 'Pending Changesets'. The PureCM server will automatically merge one 'In Progress' changeset every minute when it is not busy.
'Pending Changesets' lists all the changesets which have been submitted in the source stream but have not been merged into the destination stream. The changesets have been flagged as pending because the merge rule defined that they should be pending or because the merge rule tried to automatically merge the changeset but the auto-merge failed.
A list of all pending changesets for all merge rules is shown in the 'All Pending Merges' tree item in the Merging view.
If you navigate to the destination stream in the Administration or Repository view then the list of pending merges is also displayed in the tree.
Right-click a pending merge and select 'Merge Change' to merge the change to the destination stream. This will ask if you want PureCM to automatically merge the changeset. PureCM will only automatically merge the changeset if the files have not been changed in the destination stream. Otherwise the Resolve Tool will be launched the same as if you selected 'No'. The Resolve Tool is described in the User Guide 'File Conflicts' section. When you have resolved all conflicts press the 'Submit' button to merge the change into the destination stream.
You can merge multiple pending changes by selecting them all and using the 'Merge' menu. If you choose to automatically merge the changes then they will be merged as separate changesets. If you choose to manually merge the changes they will be combined into a single changeset which will appear in the Resolve Tool. It is generally recommended not to combine multiple changes in this way as it makes the merge more complex and more difficult to track.
The 'Move to Unmerged' menu will move the pending changeset to the 'Unmerged Changesets' list. This is useful if you do not want to merge the changeset now but might want to merge it in the future.
The 'Exclude Change' menu will move the pending changeset to the 'Excluded Changesets' list. This is useful if you will never want to merge this changeset into the destination stream.
'Unmerged Changesets' are changesets which have been submitted in the source stream but have not been merged into the destination stream. You can merge the changeset by right-clicking and selecting 'Merge Change' the same as with a pending changeset.
'Partial Changesets' are changesets where some of the change items have been merged into the destination stream but other change items have not. This is very common where the include and exclude filters have been specified on the merge rule. It can also happen if a user unchecks some of the change items when making the merge.
'Excluded Changesets' are changesets which have been submitted in the source stream but have not been merged into the destination stream. These changesets have been marked as excluded, so they will not appear in the list of changesets when doing a one off merge.