VSS - Visual Source Safe Class
use VSS; my $vss = VSS->new(db_path => 'L:/', username => 'foo', password => 'bar', vss_base => '$/Development/'); my $item = $vss->checkout('src/main.c'); $item = $vss->checkin($item); $vss->share_and_branch('cmvdbc.htm.xml', '$/Production/cmvdbc.htm.xml');
PLEASE DO NOT USE MICROSOFT VISUAL SOURCE SAFE UNLESS YOU HAVE TO!! It is horrible software and pcvs or cvs or anything else is recommended. If you are so unlucky as to have to use this all you need to know is what's outlined below. You might also want to check out http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnvss/html/msdn_vssole.asp
The following arguments can be passed to this module:
The path to your srcsafe.ini file. In some versions of VSS you may need to pass the name of the directory that contains the srcsafe.ini file.
The username you use to log into VSS.
The password you use to log into VSS.
This is an optional, but recommended parameter. The function of such is for the _itemize and _itemize_name functions allowing you to say things like 'project/file.c' instead of '$/Development/project/file.c'. In that case you would set vss_base to '$Development/'. Simple, huh? ;)
Set to 1 to debug.
Before we begin I should tell you that all parameters that are supposed to be a VSS item will do its best to become a VSS item. What I mean is that every time you pass an argument that requires an item or item name, it will be run through one of the functions _itemize or _itemize_name. These are meant to be called only from the module, but I feel free to use them in your scripts (though I won't document it here, for simplicity's sake). The functions do thier best to turn a [full|partial] textual description into a VSS item or VSS item name.
Pretty self-explanatory. If the function can obtain an item from the item name passed, it returns 1 otherwise 0.
Arguments:
VSS item or [full|partial] item name [required]
Comment [optional]
Returns: VSS Item
Returns: VSS Item or undef if checked out
Returns: Local file name
I'm not sure this function works X(.
VSS item or [full|partial] item name representing the FROM item [required]
VSS item or [full|partial] item name representing the TO item [required]
AutoCheckIn 1 or 0. Determines if the function should checkin checked-out files. [optional] [default:0]
Returns: 0 upon success; error string upon failure.
VSS item or [full|partial] item name representing the file or project that was shared into. [required]
Returns: nothing
DeleteIfExists 1 or 0. Determines if the function should delete existing TO items. [optional] [default:0]
VSS item or [full|partial] item name representing the item to be destroyed [required]
VSS item or [full|partial] item name representing the directory to add into. [required]
Local file (full path, windows convention - use backslashes) to add. [required]
If the director(y|ies) you're adding to don't exists, don't worry. This will call add_directories to add them into VSS.
VSS item or [full|partial] item name representing the director(y|ies) to create. [required]
This function will create all the directories named, or none if they already exist.
Local file name only (not the path name). Must match the end of the next parameter. [required]
Local file (full path/file name, windows convention - use backslashes) to add. [required]
This function will check out the file if it exists and copy the specified local file to in before checking it back in, thus updating it. If the item does not exist, it simply calls the add method.
Plenty, but they're all within MS VSS itself so they'll never get resolved :). If you do find a bug, let me know.
WIN32::OLE http://msdn.microsoft.com/library/en-us/dnvss/html/vssauto.asp http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnvss/html/msdn_vssole.asp
Thanks to Shaun-lost-his-full-name-and-email-address for the update from Version 1.0.2 to Version 1.0.3. He removed the hardcoded defaults and instead searched the registry for the values that the shell uses via Win32::TieRegistry. Very cool!
BPrudent (Brandon Prudent)
email: xlacklusterx@hotmail.com
To install VSS, copy and paste the appropriate command in to your terminal.
cpanm
cpanm VSS
CPAN shell
perl -MCPAN -e shell install VSS
For more information on module installation, please visit the detailed CPAN module installation guide.