Visual SourceSafe Explorer


The full power of Visual SourceSafe can only be realized through one special tool—Visual SourceSafe Explorer. Take a look at this tool by following these steps:

  1. Open Visual SourceSafe Explorer from the Windows Start menu (depending on the version that you have: Start | Programs | Microsoft Visual Studio .NET | Microsoft Visual SourceSafe | Visual SourceSafe) or from Visual Studio .NET (File | Source Control | Launch Microsoft Visual SourceSafe).

  2. Expand the project and drill down until you reach stored procedures (see Figure 17-1).

image from book
Figure 17-1: Visual SourceSafe Explorer

The following sections examine some of the most interesting features of Visual SourceSafe Explorer, particularly history, labels, and versions.

History

Visual SourceSafe keeps an audit trail of changes made to a file. To view this history of changes:

  1. Right-click the stored procedure that you edited earlier in this chapter and select Show History from the pop-up menu.

  2. Visual SourceSafe prompts you to define the history details you would like to display:

    image from book

  3. In this case, accept the defaults and click OK.

Visual SourceSafe Explorer displays a list of the different versions of the stored procedure, along with the name of the user responsible for each action:

image from book

Now you have several options. If you select one version, you can view (click View) the code in an ASCII viewer. You can also see details, such as comments and timestamp, (click Details) of the selected version. The Get button lets you obtain a version of the stored procedure in a text file.

You can also temporarily or permanently set one of the previous versions to be a current one. The Pin option is usually applied as a temporary measure to test the behavior of an older version of a procedure. If you find that changes you made in your code are introducing more problems than they are solving, you can use the Rollback function to return to an earlier version of the code. Note that all newer versions will be deleted.

My favorite option is Diff; it compares two versions of a file. To use it,

  1. Select two versions of a stored procedure (for example, version 2 and version 3) in the History window. You can select multiple versions by pressing the CTRL key and then clicking them.

  2. Click the Diff button. The Difference Options dialog box appears:

    image from book

  3. This dialog box lets you specify parameters for comparing files. If you wish to ignore case and white space, click OK to accept the defaults; Visual SourceSafe Explorer displays a window in which the differences between the two versions are highlighted (see Figure 17-2).

image from book
Figure 17-2: File differences in Visual SourceSafe Explorer

Labels and Versions

You have probably realized by now that the term "version" in Visual SourceSafe does not actually correspond to the concept of version (or release) that we generally think of when we consider software. A Visual SourceSafe "version" actually corresponds to a change in the source code. You should use labels in Visual SourceSafe to implement the equivalent of a release.

You can apply the Label option from the main window of Visual SourceSafe Explorer. You can select one or more files and/or one or more projects (folders). When you apply the Label option (File | Label), the Label dialog box appears and prompts you to specify the text of the label (your official release number, for example).

image from book

The current versions of all selected files will be labeled. Later, you can use these

labels to collect the code that belongs to a particular version. This feature can be very important for supporting or testing the product.

Even more exciting is the opportunity to view the complete history of a project (right-click the project folder and select Show History from the pop-up menu) and determine many historical facts about the project, such as which changes were performed on it after a particular release.

image from book




Microsoft SQL Server 2005 Stored Procedure Programming in T-SQL &  .NET
Microsoft SQL Server 2005 Stored Procedure Programming in T-SQL & .NET
ISBN: 0072262281
EAN: 2147483647
Year: 2006
Pages: 165

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net