March 5, 2007

SSCM Bug Merge

Surround SCM
SSCMBugMerge is a C# utility that allows users to perform specific delta merge operations from one Surround SCM branch to another using a TestTrack defect number. This program is intended to serve as an example of how similar applications can be written and is not intended for use in a production environment as-is. The SSCMBugMerge.zip file contains all the source code for the SSCMBugMerge project in addition to this document and a default settings.xml file. Applications used to develop this program:
  • MS Visual Studio .NET 2005
  • Surround SCM 5.0.2
  • TestTrack Pro 7.6.2
  • patch-2.5.9-6
The script functions by generating a history report on a target branch and repository. The history report contains check in and 'attach to TestTrack' information. Regex statements are used to locate the filename and defect number for each file listed in the history report. For each filename that has a matching TestTrack event and bug number a series of additional operations are performed. An sscm differences report command is executed to output a patch.txt file. The contents of this file only contain the code changes from the check in associated with the bug fix, which is done by diffing the bug fix version and one version prior. After a patch.txt file is created, a check out is performed on the file in the target (BranchTo) location and the patch command executed to merge the patch.txt file into the check out file. After the patch is applied, a check in is performed to complete the operation and the next file is processed. Input values include Defect Numbers in comma separated format, Branch From location which is the branch containing the bug fix, the Branch To location which is the branch to merge the bug fix to, the Repository From location which is the Repository in the Branch From. A username, password, server address and port are used to log into Surround SCM. To make the program more user-friendly, default values can be stored in a settings.xml so users will not need to fill out branch, server, port, and username info each time they run the program.

Installation

Unzip SSCMBugFix.zip into a directory on your local drive. Do not try to run the executable off a network drive, .NET will not allow it. Make sure you have the MS .NET framework installed, if not go to www.microsoft.com to download and install it. The SSCMBugFix directory requires the settings.xml file to be located in the same directory as the SSCMBugFix.exe. The open source patch program can be installed into any of your Windows PATH locations (e.g.,your Surround SCM install folder). The patch utility is available for download on several open source Web sites. The copy used for this program was downloaded from: http://gnuwin32.sourceforge.net/packages/patch.htm The patch home page is: http://www.gnu.org/software/patch/patch.htm

Running

To launch SSCMBugMerge double-click on the program icon.

  • Enter Defect #’s – You can enter one or more defect numbers. Separate multiple defect numbers with a comma.
  • Merge From Branch – Enter the name of the branch that contains the bug fixes.
  • Merge To Branch – Enter the name of the branch you want to merge the bug fixes into.
  • Merge From Repository – Enter the repository path to the project root where the bug fixes are located. This program will search the repository path recursively for all files associated with the bug fix.
  • Perform Repo Get – When checked, the program will perform a Get on the entire repository the file is located in. This was added after it was discovered the check in would sometimes fail if the file was not current before running the patch command. It is recommended you perform a Get in the Branch To location first if you are not using this option.
  • Username – Your Surround SCM username.
  • Password – Your Surround SCM password.
  • Server – Your Surround SCM IP address or server name.
  • Port – Your Surround SCM server port.
  • Patch Location – Location of patch.exe.
  • sscm Location – Location of sscm.exe.
The output window to the right of the text fields will display the results of the merge operations. You can select any two branches when doing the merge, there are no restrictions on parent or child locations. The only restriction is that the branches must have a common ancestor. You can tell if the branch selections are valid by looking at the repository paths in the two branches, which will be the same if the branches share a common ancestor.

Downloads

Binary downloadSource download

Known Issues

  • There is no support for binary file merging.
  • If the file being merged doesn't have a current status it may not be checked in. This problem was reproduced on one system but not another, which is why the Get check box was added.
Note: Seapine does not provide support for sample triggers and scripts.