Consider Using the Candidate or Preview Switch to Double-Check Before Merging

- J.D. Meier, Jason Taylor, Alex Mackman, Prashant Bansode

Prior to performing a merge, use the candidate or preview switch to double-check your merge results. Although this option is only available from the command line, it is extremely beneficial to know which files and which versions will be merged when you perform the merge command. For example, this can help to ensure that the scope of your merge is not significantly greater than you were expecting and to make sure that you understand the impact of your merge command. For large merges, the merge report also helps you to divide the work between individuals or teams.

To preview the results of a merge, use the Tf.exe command-line tool with the merge command, together with the preview or candidate switches. For example:

Tf merge main/source development/feature/source /preview

The preview switch shows a preview of the merge, while the candidate switch prints a list of all changesets in the source that have not yet been merged into the destination. The list includes the changeset ID that has not been merged and other basic information about that changeset.

Additional Resources

Last edited Jul 26, 2007 at 9:23 AM by prashantbansode, version 3

Comments

RichardBerg Apr 11, 2007 at 11:46 AM 
Note: even when you perform the merge "for real," it's still a pending change. Nothing gets committed to the server until you checkin. Like all changes, you should build & test them between pending and committing.

Doublechecking before you pend the merge is mostly about saving time. Merge can take a long time, especially in v1. Then again, so does calling candidate/preview... I suppose it also preserves your workspace state, though you should really be doing merges in a separate clean workspace anyway.