FILE: Errors with Large Recursive Branch and Share Operations

ID: Q165883

The information in this article applies to:

SUMMARY

While executing a recursive Share and Branch operation on a SourceSafe project that contains a large number of files and 4 or more nested subprojects, the operation fails with a General Protection Fault, Out of Memory message or other memory related problems.

MORE INFORMATION

Sharing and Branching is an expensive operation in SourceSafe. Because the operation itself involves intensive memory usage and file I/O, any problems at the operating system or network level could cause it to fail. Once completed, the Branch causes the SourceSafe database to grow in size as a second copy of each branched file is created. For these reasons, large Sharing and Branching should be used sparingly.

The dobranch.exe utility provides an alternative method of Sharing and Branching that avoids the potential memory problems mentioned in the SUMMARY section.

The following file is available for download from the Microsoft Software Library:

 ~ Dbrnch.exe (size: 46995 bytes) 

For more information about downloading files from the Microsoft Software Library, please see the following article in the Microsoft Knowledge Base:

   ARTICLE-ID: Q119591
   TITLE     : How to Obtain Microsoft Support Files from Online Services

Below is the content of the readme.txt files that are included with the utility.

| INFORMATION PROVIDED IN THIS DOCUMENT AND ANY SOFTWARE THAT MAY    |
| ACCOMPANY THIS DOCUMENT (collectively referred to as a Microsoft   |
| Software Library [MSL] file) IS PROVIDED "AS IS" WITHOUT WARRANTY  |
| OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT        |
| LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR        |
| FITNESS FOR A PARTICULAR PURPOSE. The user assumes the entire risk |
| as to the accuracy and the use of this MSL file. This MSL file     |
| may be copied and distributed subject to the following conditions: |
| 1) All text must be copied without modification and all pages must |
| be included; 2) If software is included, all files must be copied  |
| without modification; 3) All components of this MSL file must be   |
| distributed together; and 4) This MSL file may not be distributed  |
| for profit.                                                        |
|                                                                    |
| Copyright 1997 Microsoft Corporation. All Rights Reserved.         |
| Microsoft is a registered trademark of Microsoft Corporation.      |
 --------------------------------------------------------------------

This download consists of the following three files:

1. This file (readme.txt) 2. dobranch.exe 3. dobranch.cpp

This utility can be used as an alternative method of performing a recursive share and branch of a SourceSafe project.

Dobranch.exe

The file dobranch.exe is the utility itself, and should be saved in the WIN32 directory under the SourceSafe installation.

Its usage is:

   dobranch  <target project> <source project> [new project name]

The operation is analogous to a right mouse drag and drop in the SourceSafe explorer. If your project tree looks like this:

   $/ 
      Applications
              Develop
                      source
                      include
                      lib
      Bugfix
      Other Stuff

and you right-click the $/Applications/Develop project, drag it over the $/Bugfix project, choose Share and branch from the popup menu, then check the "Recursive" checkbox, the equivalent command for this utility would be:

   dobranch  $/Bugfix   $Applications/Develop

Note that you should provide the full path to the target and source projects.

Just like the drag and drop operation, this would create a new subproject:

   $/Bugfix/Develop

that would have the three nested subprojects.

To share and branch to a sibling subproject of Develop, use the following command:

   dobranch  $/Applications   $/Applications/Develop    NewDev.

The project tree would then be:

   $/ 
      Applications
              Develop
                      source
                      include
                      lib
              NewDev
                      source
                      include
                      lib
      Bugfix
      Other Stuff

If your project names contain spaces, wrap the project name in quotes. For example:

   dobranch  "$/Other Stuff" $/Applications/Develop "More Stuff"

to create the following project tree:

   $/ 
      Applications
              Develop
                      source
                      include
                      lib
      Bugfix
      Other Stuff
              More Stuff
                      source
                      include
                      lib

The utility creates two text files in the Win32 subdirectory, dirfile.out and errfile.log. The first is the output from a recursive ss dir command of the source project, the second is a log file of errors encountered by the various Visual SourceSafe operations.

If the program is executed successfully, these files are deleted (you'll never know they were there).

If the utility fails, you can check errfile.log for clues about what caused the failure, and dirfile.out can be deleted manually (however, this is not necessary).

Dobranch.cpp

The file dobranch.cpp is the source code for dobranch.exe and can be examined to understand how the program works, and for those interested, can be modified to provide more functionality (for example, providing an extra parameter to specify a project version, or specifying the path to any SourceSafe database). It was compiled with Microsoft Visual C++ version 4.0 Most users, however, will not need to look at this file.

Additional Notes

1. Branching a specific version.

   There is no switch for this in dobranch.exe, but it can easily be
   accomplished by PINning the project before executing dobranch.exe. For
   example, if the $/Applications/Develop project has a label 'beta1',
   type the following command-line command before executing dobranch.exe

      SS Pin $/Applications/Develop/*.* -Vbeta1

2. Limitations of the utility.

   Internal links within the source project are not be retained in the
   target project. For example, if a file in $/Apllications/Develop/lib is
   shared or branched to a file in $/Apllications/Develop/include, and you
   execute:

      dobranch $/Applications $/Applications/Develop NewDev

   the file in $/Applications/NewDev/lib will not have links to the file in
   $/Applications/NewDev/include.

Additional query words: Keywords : kbfile kbSSafe400 kbSSafe500 kbSSafe600

Last Reviewed: October 7, 1998