Desktop Tools and Development Environment Previous page   Next Page

Additional Source Control Actions

Getting the Latest Version of Files for Viewing or Compiling

You can get the latest version of a file from the source control system for viewing or running. Getting a file differs from checking it out. When you get a file, it is write protected so you cannot edit it, but when you check out a file, you can edit it.

To get the latest version, follow these steps:

  1. In the MATLAB Current Directory browser, select the directories or files that you want to get. If you select files, you cannot also select directories.
  2. Right-click, and from the context menu, select Source Control -> Get Latest Version.
  1. The MATLAB Get latest version dialog box opens, listing the files or directories you selected.

    Image of Get latest version dialog box containing multiple filenames, specifically, those filenames selected in the Current Directory browser.

  1. Click OK.
  1. You can now open the file to view it, run the file, or check out the file for editing.

Function Alternative.   The function alternative is verctrl with the get argument.

Removing Files from the Source Control System

To remove files from the source control system, follow these steps:

  1. In the MATLAB Current Directory browser, select the files you want to remove.
  2. Right-click, and from the context menu, select Source Control -> Remove from Source Control.
  1. The MATLAB Remove from source control dialog box opens, listing the files you selected.

    Image of Remove from source control dialog box containing a sample filename.

  1. Click OK.

Function Alternative.   The function alternative is verctrl with the remove argument.

Showing File History

To show the history of a file in the source control system, follow these steps:

  1. In the MATLAB Current Directory browser, select the file for which you want to view the history.
  2. Right-click, and from the context menu, select Source Control -> History.
  1. A dialog box, which is specific to your source control system, opens. For Microsoft Visual SourceSafe, the History Options dialog box opens, as shown in the following example illustration.

    Image of History Options dialog box.

  1. Complete the dialog box to specify the range of history you want for the selected file and click OK. For example, enter my_name for User.
  1. The history presented depends on your source control system. For Microsoft Visual SourceSafe, the History dialog box opens for that file, showing the file's history in the source control system.

    Image of Microsoft Visual Source Safe History dialog box containing a sample filename.

Function Alternative.   The function alternative is verctrl with the history argument.

Comparing the Working Copy of a File to the Latest Version in Source Control

You can compare the current working copy of a file with the latest checked-in version of the file in the source control system. This highlights the differences between the two files, showing the changes you made since you checked out the file.

To view the differences, follow these steps:

  1. In the MATLAB Current Directory browser, select the file for which you want to view differences. This is a file that has been checked out and edited.
  2. Right-click, and from the context menu, select Source Control -> Differences.
  1. A dialog box, which is specific to your source control system, opens. For Microsoft Visual SourceSafe, the Difference Options dialog box opens.

  1. Review the default entries in the dialog box, make any needed changes, and click OK. The following example is for Microsoft Visual Source Safe.

    Image of Difference Options dialog box containing sample filenames.

  1. The method of presenting differences depends on your source control system. For Microsoft Visual SourceSafe, the Differences for dialog box opens. This highlights the differences between the working copy of the file and the latest checked-in version of the file.

    Image of Differences dialog box showing differences between two sample files.

Function Alternative.   The function alternative is verctrl with the showdiff or isdiff argument.

Viewing Source Control Properties of a File

To view the source control properties of a file, follow these steps:

  1. In the MATLAB Current Directory browser, select the file for which you want to view properties.
  2. Right-click, and from the context menu, select Source Control -> Properties.

A dialog box, which is specific to your source control system, opens. The following example shows the Microsoft Visual SourceSafe properties dialog box.

Image of Microsoft Visual Source Safe Properties dialog box for a sample file.

Function Alternative.   The function alternative is verctrl with the properties argument.

Starting the Source Control System

All the MATLAB source control actions automatically start the source control system to perform the action, if the source control system is not already open. If you want to start the source control system from MATLAB without performing a specific action source control action,

  1. Right-click any directory or file in the MATLAB Current Directory browser
  2. From the context menu, select Source Control -> Start Source Control System.

The interface to your source control system opens, showing the source control project associated with the current directory in MATLAB. The following example shows the Microsoft Visual SourceSafe Explorer interface.

Image of Visual Source Safe Explorer dialog box.

Function Alternative.   The function alternative is verctrl with the runscc argument.


Previous page  Checking Files Into and Out of Source Control from MATLAB Performing Source Control Actions from the Editor, Simulink, or Stateflow Next page

© 1994-2005 The MathWorks, Inc.