MATLAB Function Reference Previous page   Next Page
verctrl

Source control actions (Windows only)

Graphical Interface

As an alternative to the verctrl function, use Source Control in the File menu for the Editor/Debugger, Simulink, or Stateflow, or in the context menu of the Current Directory browser.

Syntax

Description

verctrl('action',{'filename1','filename2',....},0) performs the source control operation specified by 'action' for a single file or multiple files. Enter one file as a string; specify multiple files using a cell array of strings. Use the full paths for each filename and include the extensions. Specify 0 as the last argument. Complete the resulting dialog box to execute the operation; for details about the dialog boxes, see the topic Source Control Interface on Windows Platforms in the MATLAB Desktop Tools and Development Environment documentation. Available values for 'action' are as follows:

action Argument
Purpose
'add'
Adds files to the source control system. Files can be open in the Editor/Debugger or closed when added.
'checkin'
Checks files into the source control system, storing the changes and creating a new version.
'checkout'
Retrieves files for editing.
'get'
Retrieves files for viewing and compiling, but not editing. When you open the files, they are labeled as read-only.
'history'
Displays the history of files.
'remove'
Removes files from the source control system. It does not delete the files from disk, but only from the source control system.
'runscc'
Starts the source control system. The filename can be an empty string.
'uncheckout'
Cancels a previous checkout operation and restores the contents of the selected files to the precheckout version. All changes made to the files since the checkout are lost.

result=verctrl('action',{'filename1','filename2',....},0) performs the source control operation specified by 'action' on a single file or multiple files. The action can be any one of: 'add', 'checkin', 'checkout', 'get', 'history', or 'undocheckout'. result is a logical 1 (true) when you complete the operation by clicking OK in the resulting dialog box, and is a logical 0 (false) when you abort the operation by clicking Cancel in the resulting dialog box.

verctrl('action','filename',0) performs the source control operation specified by 'action' for a single file. Use the full pathname for 'filename'. Specify 0 as the last argument. Complete any resulting dialog boxes to execute the operation. Available values for 'action' are as follows:

action Argument
Purpose
'showdiff'
Displays the differences between a file and the latest checked in version of the file in the source control system.
'properties'
Displays the properties of a file.

result=verctrl('isdiff','filename',0) compares filename with the latest checked in version of the file in the source control system. result is a logical 1 (true) when the files are different, and is a logical 0 (false) when the files are identical. Use the full path for 'filename'. Specify 0 as the last argument.

list = verctrl('all_systems') displays in the Command Window a list of all source control systems installed on your computer.

Examples

Check In a File

Check in D:\file1.ext to the source control system.

This opens the Check in file(s) dialog box. Click OK to complete the check in. MATLAB displays result = 1, indicating the checkin was successful.

Add Files to the Source Control System

Add D:\file1.ext and D:\file2.ext to the source control system.

This opens the Add to source control dialog box. Click OK to complete the operation.

Display the Properties of a File

Display the properties of D:\file1.ext.

This opens the source control properties dialog box for your source control system. The function is complete when you close the properties dialog box.

Show Differences for a File

To show the differences between the version of file1.ext that you just edited and saved, with the last version in source control, run

MATLAB displays differences dialog boxes and results specific to your source control system. After checking in the file, if you run this statement again, MATLAB displays

List All Installed Source Control Systems

To view all of the source control systems installed on your computer, type

MATLAB displays all the source control systems currently installed on your computer. For example:

See Also

checkin, checkout, undocheckout, cmopts

Source Control Interface on Windows Platforms topic in MATLAB Desktop Tools and Development Environment documentation


Previous page  ver version Next page

© 1994-2005 The MathWorks, Inc.