Using Labels to Selectively Promote Files
From Seapine Labs
Changes rarely consist of a single file. In most cases a change due to a defect fix, change request, or new feature implementation consists of changes to several files.
Depending on the branch strategy being used, once the changes have been made, they need to be promoted to a parent branch. Sometimes, it can be challenging to identify the files related to this specific change in order to promote them. This is especially true if the user promoting the files is not the same user who made the changes.
One way to solve this issue is to use labels to logically group the files. Surround SCM provides filters and an advanced find feature that allow you to get a list of files that match a specific label. You can browse the list of labels, so you don't have to remember the exact label.
Once you have your list of files, you can select them and promote them to the parent branch.
 Use Case
The following illustrates an example of this.
Several files are modified in a baseline branch to implement a new feature. Figure 1 below illustrates the files selected and the Check In Files dialog.
Note that the Label check box is selected. When the OK button is clicked, the user is prompted for the new label to create, as illustrated below in Figure 2.
Once the label is created the check in proceeds. Looking at the created label under Tools > Labels shows that all modified files have been associated with the label.
Now all files are grouped logically by the label. When it comes time to promote the files, the user opens the Advanced Find dialog (Edit > Advanced Find Files), selects Label as the restriction, and browses for the specific label, as illustrated in Figure 4.
The advanced file results in only the files associated with the label. The user selects all of the files (Edit > Select All) and selects Branch > Promote File. Only the selected files are promoted.
Note that in Figure 2, the label was scoped only to the baseline branch. If the branch is scoped for the entire mainline, then the user can optionally add the promoted files in the parent branch to the same label.
 What if I don't want to use labels?
Surround SCM's filters and advance find allow you to filter the file list by other criteria, so labels are not the only option.
 Use the TestTrack defect number
Attach the files related to this change to a defect in TestTrack Pro. The defect number is a searchable field in Surround SCM. Enter a number, and Surround SCM will return all files that have been attached to that defect number.
 Use the Check in event and comments
Query the comments of the check in event to identify the files needed to promote. This would require users to enter comments on check ins and follow some guideline of how the comments should be entered. Triggers could be used to enforce this.
 Use custom fields and workflow
Query the Assigned custom field and the workflow state. If the file is assigned to the specific user and the workflow state indicates that the changes are ready to be promoted, you can use Advanced Find to get theses files.
 A word of caution
Regardless of the criteria used to retrieve the list of files the promote action will promote the latest version of the file.
For example, if the list of files matches a specified label, the latest version of each file is promoted, not the versions associated with the label.
Finding a group of files for promotion is easy once you understand the available features. It is just a matter of understanding and using these features to get the most out of Surround SCM.