MATLAB Function Reference | ![]() ![]() |
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
fileChange = verctrl('command',{'filename1','filename2',....},winhandle) verctrl('command',{'filename1','filename2',....},winhandle) fileChange = verctrl('command','file',winhandle) verctrl('command','file',winhandle) list = verctrl('all_systems')
Description
Note
To use the verctrl function with the winhandle argument, you must first create a window and get its handle. See Examples for instructions on how to do this.
|
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:
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:
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
import java.awt.*;
frame = Frame('Test frame');
frame.setVisible(1);
winhandle = com.mathworks.util.NativeJava.hWndFromComponent(frame)
Return a List in the Command Window of All Version Control Systems Installed in the Machine
list = verctrl('all_systems') list = 'Microsoft Visual SourceSafe' 'Jalindi Igloo' 'PVCS Source Control' 'ComponentSoftware RCS'
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 | ![]() |