MATLAB Function Reference    
verctrl

Version control operations on PC platforms

Graphical Interface

As an alternative to the verctrl function, use Source Control in the Editor, Simulink, or Stateflow File menu.

Syntax

Description

fileChange=verctrl('command',{'filename1','filename2',....},winhandle) performs the version control specified by 'command' on a single file or multiple files. Specify files with a cell array using the full pathnames for 'filename'. These commands return a logical 1 to the workspace if the file has changed on disk or a logical 0 to the workspace if the file has not changed on disk. Available values for 'command' with this syntax are as follows:

command Argument
Purpose
'get'
Retrieves file(s) for viewing and compiling, but not editing. The file(s) will be tagged read-only. The list of files should contain either files or directories but not both.
'checkout'
Retrieves file(s) for editing.
'checkin'
Checks file(s) into the version control system, storing the changes and creating a new version.
'uncheckout'
Cancels a previous check-out operation and restores the contents of the selected file(s) to the precheckout version. All changes made to the file since the check-out are lost.
'add'
Adds file(s) into the version control system.
'history'
Displays the history of file(s).

verctrl('command',{'filename1','filename2',....},winhandle) performs the version control specified by 'command' on a single file or multiple files. Specify the files with a cell array using the full pathnames for 'filename'. Available values for 'command' with this syntax are as follows:



command argument
Purpose
'remove'
Removes file(s) from the version control system. It does not delete the file(s) from the local hard drive, only from the version control system.

fileChange = verctrl('command','file',winhandle) performs the version control specified by 'command' on a single file. Use the full pathname for 'file'. These commands return a logical 1 to the workspace if the file has changed on disk or a logical 0 to the workspace if the file has not changed on disk. Available values for 'command' with this syntax are as follows:



command argument
Purpose
'properties'
Displays the properties of a file.
'isdiff'
Compares a file with the latest checked in version of the file in the version control system. Returns logical 1 to the workspace if the files are different and it returns logical 0 to the workspace if the files are identical.

verctrl('command','file',winhandle) performs the version control specified by 'command' on a single file. Use the full pathname for 'file'. Available values for 'command' with this syntax are as follows:

command argument
Purpose
'showdiff'
Displays the differences between a file and the latest checked in version of the file in the version control system.

Examples

This function supports different version control commands on PC platforms. You must make a window and get its handle prior to calling version control commands that use the winhandle argument. A basic example for making a window and getting its handle is shown below.

Make a Java Window and Get Its Handle

Return a List in the Command Window of All Version Control Systems Installed in the Machine

Check Out a File

Check out D:\file1.ext from the version control system. This command opens 'checkout' window and returns a logical 1 to the workspace if the file has changed on disk or a logical 0 to the workspace if the file has not changed on disk.

Add Files

Add D:\file1.ext and D:\file2.ext to the version control system. This command opens 'add' window and returns a logical 1 to the workspace if the file has changed on disk or a logical 0 to the workspace if the file has not changed on disk.

Display the Properties of a File

Display the properties of D:\file1.ext. This command opens 'properties' window and returns a logical 1 to the workspace if the file has changed on disk or a logical 0 to the workspace if the file has not changed on disk.

See Also

checkin, checkout, undocheckout, cmopts

Also, type help verctrl.m at the command window prompt.


  ver version