Exercise 2: Branching and Merging Visualization

In this exercise, you will learn how to visualize and track changesets while merging the changes that you made in the previous exercise.

  1. In Source Control Explorer, right-click on the Production 1.0 branch and select View History from the context menu that appears.

    Figure 6

    Changeset history for Production 1.0 branch [your changeset number may be different]

  2. Right-click on the changeset that you just checked in and select Track Changeset from the context menu that appears.
  3. In the Select Branches window, Production 1.0 will already be checked. Check just the checkbox for Iteration 2 and then select the Visualize button to see the current state of the changeset as it relates to the other branches.

    Figure 7

    Selecting branches to visualize

  4. This visualization shows us that the changeset has been applied to Production 1.0 but not to Iteration 2. It also makes it clear that in order to merge our changes into Iteration 2 we will need to merge with the Main branch first.

    Figure 8

    Tracking Changeset visualization in Hierarchy Tracking mode

    Note:
    Your changeset numbers will differ from those shown in the lab screenshots.
  5. To perform the merge of this changeset and the Main branch, drag and drop the green Production 1.0 node onto the Main node. This will load the Source Control Merge Wizard.

    Figure 9

    First screen of the Source Control Merge Wizard

  6. Ensure that the source branch to merge ends with “Production 1.0” and the target branch ends with “Main”. Select the Next button to continue.
  7. The next screen of the merge wizard specifies the version to merge. By default, you should see the changeset that you checked in already. Select the Finish button to perform the merge.
  8. After the merge is complete, open the Pending Changes window and note that Template.Master change status for the Main code branch is now “merge, edit”. The merge process is complete, but we still need to check in the changes.
  9. Add a Comment of “Merging fast-tracked changes from Production to Main”.

    Figure 10

    Insert Caption

  10. Click the Check In button to finalize the merge with the Main branch. When prompted to confirm check-in, select the Yes button.
  11. In the Tracking Changeset window, click on the Rerun button to generate an updated view. You will need to click the Visualize button again when the Select Branches window appears.

    Figure 11

    Changeset tracking view showing that merge with Main is complete

  12. Next, merge the changeset from the Main branch with the Iteration 2 branch in the same manner as before by dragging and dropping to load the Source Control Merge Wizard.
  13. Select Next followed by Finish to perform the merge process.
  14. In the Pending Changes window, enter a Comment of “Merged fast-tracked changes from Main to Iteration 2”.
  15. Select the Check In button to finalize the merge with the Iteration 2 branch.
  16. In the Tracking Changeset window, click on the Rerun button to see the updated view.

    Figure 12

    Tracking original changeset in Hierarchy Tracking mode

  17. Another useful view is the Timeline Tracking view. Select the Timeline Tracking button to the left of the Hierarchy Tracking button to switch to this view. This shows the order in which the original changeset was merged with the other branches.

    Figure 13

    Tracking original changeset in Timeline Tracking mode

  18. In the Source Control Explorer, navigate to and right-click on the Template.Master file from the Iteration 2 branch, selecting Annotate from the context menu that appears.

    Figure 14

    Location of Annotate option

  19. Scroll to the bottom of the annotated Template.Master file and locate the HTML that you previously commented out.
  20. In the annotation column on the left-hand side, mouse over the recent changeset (it should have today’s date on it). Note that the changeset path and comment refer to the Production branch where the change was originally made even though we annotated a file from the Iteration 2 branch.

    Figure 15

    Changeset information for Template.Master file

To give feedback please write to VSKitFdbk@Microsoft.com

Copyright © 2010 by Microsoft Corporation. All rights reserved.