Seapine Labs
Personal tools

SSCM Auto Share

From Seapine Labs

Jump to: navigation, search

It is easy in Surround SCM to share a file from one branch to another, this can be done in one line command inside a trigger. It is much more difficult to create a share from one repository to another repository in the same branch.

The difficulty comes in determining the share to repository location. While the repository paths are identical when sharing between two branches, they are different when sharing between two repositories in the same branch.

This script auto shares files based on input that determines the ShareFrom location and the ShareTo location starting at the repository root (project root) that you want to share.

Contents

[edit] Installation

Unzip SSCMAutoShare to a directory on the Surround SCM Server side where you want to run the application.

[edit] Running

It is much easier to run SSCMAutoShare using a batch file. An example .bat is included in the binary download link. I recommend using this .bat for the trigger.

In the batch file specify the location of the SSCMAutoShare.exe (full path), your Surround SCM username and password, and the Surround SCM Server address and port. The %1 and %2 input values represent the Original repository location and the Share To repository locations, which will be specified in the Surround SCM trigger description.

In Surround SCM, create a trigger with the desired settings such as Branch to monitor, and actions to look for (e.g., 'when File is Created').

On the Actions tab, add a new execute action. Enter the path to the batch file, the original repository location, and the share to repository location. The path will be similar to the following example:

C:\SSCMAutoShare.bat Mainline/Project1/Common /Mainline/Project2/Common

This script works recursively. In the previous example, any file added to Common or any sub-directory of Common will be shared from Project1 to Project2. New repositories are automatically created.

You may want to modify Logger.cs to specify an alternate location for the SCMLog.txt log file. The default log file location is in the Surround SCM installation directory.

The script works well for even large number of files, including a large number of new sub-directories. You can specify any two repository locations with no restrictions on how deep of a repository you select for either the original or share to repository.

[edit] Downloads

Binary download

Source download

[edit] Known Issues

  • The program requires seven input arguments: server, port, username, password, filename, and sharefrom and shareto repository names. This is why the batch file is recommended to simplify trigger creation. A batch file is not required and you can pass all seven input arguments from the trigger execution field.
  • During testing I noticed that adding a large number of files goes much slower than normal.
  • After you add a file, press the F5 key to refresh the Share status. There may be lag time between when the file is added and the share operation is completed.



Note: Seapine does not provide support for sample triggers and scripts.














Issue Management Software | Source Code Control Software | Test Case Management