Documentation

Contents

verctrl

Source control actions (Windows platforms)

Syntax

verctrl('action',{'filename1','filename2',....},0)
result=verctrl('action',{'filename1','filename2',....},0)
verctrl('action','filename',0)
result=verctrl('isdiff','filename',0)
list = verctrl('all_systems')

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 file name and include the extensions. Specify 0 as the last argument. Complete the resulting dialog box to execute the operation. 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 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 file name 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 absolute path 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:

result = verctrl('checkin','D:\file1.ext', 0)

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.

verctrl('add',{'D:\file1.ext','D:\file2.ext'}, 0)

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.

verctrl('properties','D:\file1.ext', 0)

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

verctrl('showdiff','D:\file1.ext',0)

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

??? The file is identical to latest version under source control.

List All Installed Source Control Systems

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

list = verctrl ('all_systems')

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

list = 
'Microsoft Visual SourceSafe'
'ComponentSoftware RCS'
Was this topic helpful?