Visual Sourcesafe

Visual Sourcesafe

1. Where can I find a list of known bugs in VSS?

  • Go to MS support online (http://support.microsoft.com/) and
    1. Set the product to VisualSourceSafe

    2. Set the search option to keywords
    3. Enter kbbug for the question

2. What was fixed by Service Pack 3 for Visual Studio?

  • Search MS online support, Visual SourceSafe, for any of the following keywords, depending on the version of Visual Studio you are using and the Service Pack in which you want to research: kbVS97sp1, kbVS97sp2, kbVS97sp3, kbVS600sp1, kbVS600sp2, kbVS600sp3, kbVS600sp4, kbVS600sp5

3. Is VSS Y2K compliant?

4. VSS System Capacities -- database/file sizes, number of users?

5. VSS performance is extremely slow.

  • This could be caused by having too many "Dir=" or "Shadow=" entries in one of the ini files. Try to create a directory structure on disk which matches the VSS project tree. Then clean up the extra Dir= and Shadow= entries in the .ini files. That way you only need an entry in your ini file for each "tip" project.
  • If you find that VC++ is very slow now that you're using the VSS integration, deleting the .NCB file before opening the workspace might help. VC++ 6.0 doesn't have this problem.
  • Some user have reported the use of Norton Anti Virus 2001 on Win2K significantly slows VSS down.

6. How can I put revision history information in the source files each time I check in a file?

  • You need to use SourceSafe's keyword expansion. The keyword for getting history information is $History:$. What follows is a general discussion of getting keyword expansion working. See the following FAQ for tips on how to get keyword expansion working.

7. What are the tips for getting keyword expansion working?

  • Make sure that the srcsafe.ini variable Keyword_Masks is set to the appropriate file types you want to expand keywords in. (e.g. Keyword_Masks=*.cpp,*.h,*.idl)
  • Remember that the keywords are case sensitive and include a colon at the end: $History:$
  • If you're using something that generates multiple lines, like $History:$, you need to have the section [Keyword Comments] set up to proper values for commenting out each line:

[Keyword Comments]
*.cpp="// "
*.frm="'"

  • See 'keyword expansion' in the VSS online help for further info

8. Are there any third party articles which compare VSS with other source code control products?

9. Microsoft VSS Best Practices

Administration:

10. How can I access VSS from a remote site over the Internet directly of via a web portal?

11. How do I convert my PVCS archive to VSS?

  • Use the supplied conversion utility pvcs_ss.exe. Note that this will not work with long file names, and it does not work with logfiles created by the NT version of PVCS. See KBA Q140362

12. How do I get all users out of VSS in order to perform a backup?

  • The easy way is to have everyone access SS via a share. Then you can pause the share, eliminating any new access, send out a message that users are about to be dropped, then delete the share, dropping all users. Once you're done, you can re-establish the share.
  • Check out Paul D'Anna batch file at http://www.michaelis.net/SourceSafe/vsshealth.bat.txt

13. How can I lock and unlock the VSS database prior to running Analyze or backing up the database.

  • Create a zero-byte file called admin.lck in the [share]\data\loggedin folder and the database is locked. Delete it when Analyze is done to unlock. Note that this will not kick out currently logged in users.

14. How can I tell which files in the database correspond to files in my project?

  • You really shouldn't need to do this. SourceSafe's database should be considered a closed database. The fact that you can view files which correspond to your source files is sometimes a convenience, though. If you've run the analyze.exe program and want to know which file in which project is causing the problem, there is a command that will tell you which file(s) to look at. From the WIN32 subdirectory, use the ss.exe command line program and the "PHYSICAL" option. Here is an example:

SS PHYSICAL $/Project/file.cpp

  • The project/file specification can be a single file or a project (or even the root project -- $/ -- if you want a listing of the whole database). You can also use the -r switch to make the command recurse through the project tree.

15. What's Analyze?

  • Analyze.exe is Visual SourceSafe's database maintenance program. This should be run regularly (suggestions range from nightly to monthly). It can repair damaged databases as long as no users are logged on (use the -f command line option). It also has an option for deleting unused files, which will recover space taken up in the database by files and projects that have been purged (-d option). A compress option, -c, will perform some compression on the database where possible. Four levels of verbosity (-v1, -v2, -v3 and –v4) give plenty of usually cryptic information (see KBA Q152807 for explanations of many of these messages). Other options can be seen by typing 'analyze -?'. Each time analyze is run, it requires a clean directory to store backup files. The default is the folder under the data directory called 'backup'. If this directory isn't empty, analyze won't run.

16. Is there some way to get a list of errors from Analyze?

17. How can I move a database or create a new one?

  • To move a database, refer to the KBA Q176909 HOWTO: Move a VSS Database or Project to New Location.
  • To create a new database, refer to KBA Q123467 How to Create a New Database in SourceSafe.
  • Note that in addition to the instructions in Q123467, you also need to create a new srcsafe.ini file, users.txt file and temp and users directories. The srcsafe.ini file and the users.txt file can be copied from an existing installation and then edited: Remove everything from the srcsafe.ini file except Data_Path, Temp_Path, Users_Path, Users_Txt, and File_Types in the new version. Remove all users from users.txt except Admin and Guest. Also, create a guest and admin directory in the users directory. Copy the template.ini file from the users directory of your existing installation to the users directory. Place a copy of the template.ini file in both the admin and guest directory. Rename both of these copies to ss.ini. Copy ssadmin.ini from your current database to the users\admin directory.
  • To change the name of a database, refer to KBA Q175950

18. How can I backup a database?

  • Make sure that no one is using the database and that Analyze will not begin to run while you are backing up the database. Use any backup utility to copy the \DATA, \LABELS, and \USERS directories.
  • See Chuck Kollars web site for further suggestions and a sample .bat file to secure and backup the database.
  • Some VSS administrators have suggested using SSARC as a way to backup the database. Use SSARC -d- <archive file> $/ to archive without deleting any files. You would then use SSRESTOR to restore the corrupted database.
  • To backup the database to a CD, you must have all the non-data folders on the hard drive and modify the srcsafe.ini to point the data path to the CD.
  • For an automated backup batch file checkout http://www.codeproject.com/tips/autovssbackup.asp.

19. How can I archive old projects or old versions of current projects?

20. Is VSS 5.0 compatible with a 4.0 database? Do I have to upgrade all users to the new version? What about 6.0?

  • For 5.0 vs. 4.0 compatibility, read KBA Q176553
  • Version 6.0 can read and write 5.0 databases, and has an option to upgrade or use a new database format. Using this new format gives you the new label promotion feature, but cannot be read by anything earlier than 6.0 (You'll have to upgrade everyone if you want to use the 6.0 database format). There are also some performance enhancements with the new 6.0 version of the database.

21. Does VSS 6.0 support NT's built-in security?

22. How do I get deleted files (not permanently deleted)?

  • From SS Explorer select the project folder which contained the deleted file.

When on a project folder, click on Show Properties, then select the Deleted Items Tab.

Find the deleted file and click on Recover.

  • From the command line use the SS GET command on the parent project. Do not list the files or use *.* in the get.
    For example, the following command will get files including deleted files.

SS GET $\MASTER\PROJ1 -VLOldLabel

However, the following command will not get the deleted files:

SS GET $\MASTER\PROJ1\* -VLOldLabel

23. How do I rename a label?

  • This one is not intuitive. From within the VSS Explorer, perform the following steps (Steps are for VSS 6.0. Steps are similar for 4.0 and 5.0):

1. Select the project that has the label that you want to rename.

2. Click on the Show History button.

3. Check Include Labels and Show Labels

4. Uncheck Include File Histories and optionally select a date to search back to. Click OK.

5. In the History dialog box, find and select the label to be renamed and click Details.

6. In the History Details dialog box, select the label and change it to the new name. Click Close on all dialog boxes.

24. How do I recover from a lost administration password?

25. How to require check-in comments?

26. How can I automate database maintenance routines?

Integration with other products:

27. The integration isn't working between VSS and VB/VC. What can I do?

  • Make sure you're using the latest version of VSS with the latest Service Pack or at least the most recent older version (with the latest Service Pack). You'll need this much before Product Support can help you (if you still can't get it working). Reinstalling is one option.
  • To search for articles relating to Visual C++ integration, search for the keyword: SSVC
  • To search for articles relating to Visual Basic integration, search for the keyword: SSVB

28. How do I reconnect a project after the shared workspace file loses the project location?

29. How do I disconnect VSS from a particular VC project?

30. The integration isn't working between VSS and FrontPage/Visual InterDev. What can I do?

31. How does one implement SourceSafe integration with FrontPage 2000/

  • It would appear that the information provided in the FP2K user guide with respect to integrating FP2K and Visual SourceSafe inadvertently applies to the previous version (FrontPage 98) and not FP2K.
  • The following instructions should help in setting up FrontPage 2000

1. Use FrontPage 2000 to create your web

2. Add the web folder to VSS as a new VSS Project

3. Set the VSS Project as a Web Project in VSS Administrator

4. Open the Server Extensions Administrator [Start-Programs-Microsoft Office Tools]

5. Expand folders to reveal the web site folder that was added as a VSS Web Project

6. Right Click this web site's folder and choose Properties

7. Set Version Control to External

(Thanks to Tom Christian of Microsoft VSS Support for this solution)

32. What about other product integrations?

33. How can I disable the integration between VSS and Visual Studio?

  • Under the registry key: HKEY_CURRENT_USER\Software\Microsoft\DevStudio\6.0\Source Control (for Visual Studio 6.0) or HKEY_CURRENT_USER\Software\Microsoft\DevStudio\5.0\Source Control (for Visual Studio 5.0) , change or created the entry:
    Name: Disabled
    Type:
    REG
    _DWORD
    Data: 0x1
    (All the warnings about working in the registry apply.)

34. How can I use SourceSafe to version stored procedures with Visual Studio 6.0 and SQL Server 7.0.

35. Can I use VSS on Unix or Mac systems?

36. Are there any patches available for problems that occur when using VSS on a Novell share?

37. Is there any information on Web Projects and Source Control Integration in Visual Studio .NET?

38. How can I get around the synchronization issue such that deletes and renames from VS.NET do not get synchronize with VSS as described in Q305516.

Source Safe Utilities

39. Is there some way to automate email notification when of VSS changes?

40. What reporting packages are available for SoucreSafe?

41. Is there an issue/bug tracking tool that integrates with SourceSafe?

42. Are the any windows shell extensions for SourceSafe?

43. How do I display a custom message box during Add Item, Check In, Ckeck Out, Undo Checkout, Branch, and Rename?

44. Is there a way to enable easily switching between multiple source code providers?

Build/Configuration Management Strategies

45. How do I 'get' with respect to a label?

  • Need to use the '-v' switch with an 'L' after it to indicate a label (-R is for recursive):

SS GET $\project -VLmylabel -R

46. How do I apply a label to an older version of a file?

  • You must first pin the file at the older version (Show History, select the version of interest and click "Pin".) Then apply the label to the parent project. The label will be applied to the "tip" revision of the unpinned files, but to the older version of pinned files. Then Unpin the file. The label 'sticks' even after the pin is removed.

47. How do I remove a label?

  • This one is not intuitive. From within VSS Explorer, select the project, show history, check Labels Only, find the label of interest, click on Details, select the label text and delete it. Click Close, which will ask if you are sure you want to change the label. Click Yes and you're done.

48. How do I find all changes between two dates?

  • Here's how to get a list of everything that has changed since a particular date and time from the command line. In the command 'a' or 'p', refers to a.m. or p.m. respectively. And the ~ is used to indicate you want the history between the dates and times specified. Note that the later date and time must be specified first. -R makes it recursive.

SS HISTORY $/mybranch -R -VD3/03/95;3:00p~3/03/95;9:00a

49. How do I pin all the files within a project?

  • You can do this using the command-line pin parameter and the wildcard character for the file name. For example:

SS PIN $/MyProject/*.* -VLver1

Build Automation

50. Automating builds using VSS

51. How do I select a database from the command line?

  • You can set the SSDIR environment variable to point to the location of the database's SRCSAFE.INI file.
  • Chuck Kollars discusses the tradeoffs of a single vs multiple databases at his website.

52. Is there a way to automatically increment/synchronize my project build number and my VSS label/version?

Branching/Sharing

53. Where can I find some information on Branching/Sharing:

54. How do I reconnect a Visual C++ project after I have branched or shared it to a new location?

SourceSafe API

55. Is there an API for VSS? Where can I get it?

56. What platforms can I automate VSS using OLE?

57. Where can I find the SSSCC API?

  • Microsoft discourages the use of the SSSCC API. Instead they propose you use the OLE Automation interface.
  • However, if you still wish to use the API you can request the MSSCCI spec by writing to msscci@microsoft.com. They will send you the NDA you need to sign to get the spec, and then send you the spec.

58. Does VSS OLE Automation support label comments?

59. Does VSS OLE Automation support pinning?

60. Does VSS OLE Automation support administrative functions?

  • VSS 6.0 supports some administrative functions. Read the specification and look at the samples.

61. Using the VSS OLE Automation support in ASP pages

62. Is there a SourceSafe developers guide?

63. Is it possible to trap file deletions and rollbacks using an add-in/VSS Ole Automation?

64. How do I retrieve the comment from a specific version of a file?

  • This requires that you iterate through each version of the file looking for the label you want. Once the correct version of the file is identified you can retrieve the comment for that version. Below is some sample VB code demonstrating this:

For Each objVSSVersion In objVSSObject.Versions

If objVSSVersion.Action = 'Beta 1' Then

MsgBox(objVSSVersion.LabelComment)

End If

Next

No comments: