SourceSafe History Redux: using VFP to generate VSS History Files

In the original post, I showed a simple Visual FoxPro program to generate a week’s worth of activity history from Visual SourceSafe. Andrew MacNeill observed that it would not work for him, as he was supporting more than one database. Here’s one solution: change the original program from shelling out with a single command. Instead, generate a batch file, and then execute it. Here’s a sample:


SET TEXTMERGE TO VSSHIST.BAT
SET TEXTMERGE ON NOSHOW
\ SET SSDIR=C:\MY DOCUMENTS\SOURCESAFE
\ SET VSSEXEDIR=C:\PROGRAM FILES\VSS\WIN32
\ %VSSEXEDIR%\ss history $/ -R -vd <<DTOC(DATE())>>~<<DTOC(DATE()-7)>>  -B -O@History.txt
SET TEXTMERGE OFF
SET TEXTMERGE TO
!VSSHIST.BAT
SET SSDIR=
SET VSSExeDir=

[UPDATED]: My blogging software made mincemeat out of the slashes, greater-than and less-than signs. Copy with care, and proof your result.

The SSDIR environment variable is recognized the the SS.EXE SourceSafe command-line executable: if set, it points to the SRCSAFE.INI file and the location of the data files SourceSafe is to operate on. The second environment variable, VSSExeDir is one I use to simplify the batch file, but putting the absolute path to the SourceSafe executables in one place, you can refer to it within the file, and only need to change it in one place should you change paths. Think #DEFINE in other languages.

No comments yet.

Leave a Reply

Powered by WordPress. Designed by Woo Themes

This work by Ted Roche is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 United States.