Seapine Labs
Personal tools

PowerBuilder Integration

From Seapine Labs

Jump to: navigation, search

PowerBuilder supports the Microsoft SCC Interface, which is also supported by Surround SCM. This allows the PowerBuilder user to access Surround SCM commands.

Note: You must have the PowerBuilder SCC Interface component installed. Please refer to the PowerBuilder documentation on how to do this.

The following article illustrates how to integrate a PowerBuilder workspace with Surround SCM.

The following versions were used in the writing of this article:

  • Surround SCM 2008.0.1
  • PowerBuilder version 11.0 Build 6525


Contents

[edit] About the PowerBuilder workspace

The workspace used in this article resides on a workstation and it is called "Integration Example". The workspace's local root directory is D:\pb Workspaces\Integration Example. The workspace itself contains one target, which is an application created using the application template. The application's name is intapp. Figure 1 below shows the workspace explorer.

Figure 1: Worspace Explorer
Figure 1: Worspace Explorer

[edit] Setting up the integration

The integration with Surround SCM is set up at the workspace level. Perform the following steps to set up the integration with Surround SCM:

  1. Right-click on the workspace you wish to integrate with Surround SCM.

  2. Select Properties.
    The Properties of Workspace window appears.

  3. Select the Source Control tab. This is where the integration with Surround SCM is set up.

  4. Click the Source Control System dropdown menu and select Surround SCM SCCI from the list.

  5. Enter the username to connect to Surround SCM in the User ID text box.

  6. Click on the browse button next to the Project text box.

    You will get a prompt stating Surround SCM was unable to establish any repository association for the local path. The local path being the local root directory of the workspace. Figure 2 below illustrates the prompt.

    Figure 2: Surround SCM prompt
    Figure 2: Surround SCM prompt


  7. Click on the Fix button.
    Note: The prompt may not appear if the workspace local root folder is already associated with a repository in Surround SCM as a working directory. Surround SCM will then associate the workspace with that repository.

  8. The Repository Browser window appears. Here is where you select the branch and repository to associate the workspace with. You can associate the workspace with a new repository or an existing repository. Figure 3 below shows the Surround SCM Repository Browser window.
    Figure 3: Surround SCM Repository Browser
    Figure 3: Surround SCM Repository Browser

    Note: If you wish to use an existing repository, you have to make sure that the repository's working directory is the workspace's local root folder. You can right click on the repository and select Properties to check the working directory and you can also select Set Working Directory to set the working directory. For this article we will create a new repository.

  9. Click on the Create Repository button. The Create Repository window opens. Enter the name for the repository. The working directory should be set by default to the workspace local root folder. Figure 4 below illustrates the Create Repository window.
    Figure 4: Create Repository Window
    Figure 4: Create Repository Window

    Note: If you enter a string in the Project textbox on the Source Control tab for the Workspace properties, the string will be used as the new repository name.

  10. Click on the OK button to create the repository. The repository is created and selected in the Repository Browser Window.

  11. Click on the OK button to close the repository browser.
    Note: The project name used in the Source Control tab for the workspace properties will be set to "SurroundSCMScci".

  12. The Local Root Directory text box should already have a value.

  13. Optionally you can set the following options:
  • Require comments on check-In.
  • This project requires that I sometimes work offline.
  • Delete PowerBuilder-generated object files.
  • Perform diff on status update.
  • Suppress prompts to overwrite read-only files.
  • Show warning when opening objects not checked out.
  • Status Refresh Rate.

Please refer to the PowerBuilder documentation for more information about these options.

[edit] Performing File Actions

Once the integration is set up, you can access most Surround SCM file actions from within PowerBuilder. The following will show how to access these actions from PowerBuilder, but will not go into detail on the Surround SCM options for each file action. Please refer to the Surround SCM User Guide for details on all of the options given for all of the Surround SCM tasks.


[edit] Adding files to source control

In the example above, the workspace files are not automatically added to Surround SCM. As figure 5 below illustrates, all the files in the workspace explorer have plus signs next to each one. This indicates that the files are not under source control and can be added.

Figure 5: Workspace Explorer
Figure 5: Workspace Explorer

You can add files individually or add all of them at the same time. To add files individually, right click on the file you wish to add, to add all of the files in the workspace, right click on the workspace. The following are instructions on how to add the entire workspace to Surround SCM.

  1. Right click on the workspace.
  2. Select Add to Source Control....
    The Add to Source Control window appears.
    Figure 6: Add Files to Source Control dialog
    Figure 6: Add Files to Source Control dialog
  3. Click on the Advanced button to access Surround SCM options.
  4. Click on the OK button to add the files.
    The files are added to Surround SCM.

[edit] Getting files

Get files when you want to view a file but do not need to make any changes. You can get do this at the target level or at the file level.

  1. Select the file or target you want to get.
  2. Right click on the item and choose Get Latest Version... from the context menu.

    The Get Latest Version dialog box opens. Click on Advanced to access Surround SCM options.

  3. Click OK to get the files.


Note: If you wish to get multiple files but not all files, instead of getting files individually, select the target. In the Get Latest Version dialog window, you can multi-select only those files you wish to get. Figure 7 below illustrates this.

Figure 7: Get Latest Version dialog box
Figure 7: Get Latest Version dialog box

[edit] Checking out files

Check out files when you need to modify the files.

  1. Select the file/target you want to check out.
  2. Right click on the item and Select Check Out... from the context menu.

    The Check Out dialog box opens. Click on Advanced to access Surround SCM options.

  3. Click OK to check out the files.


The file is checked out.

[edit] Checking in files

Check in updates files with changes, removes the lock on the files, makes changes available to other users, and increments the version number by one.

  1. Select the file/target you want to check in.
  2. Right click on the item and select Check In... from the context menu.

    The Check in File(s) dialog box opens. Click on Advanced to access Surround SCM options.

  3. Click OK to check in the files.
The files are checked in.

[edit] Undoing check out

If you check out and modify a file then decide you do not want to save the changes, you can undo the check out. This discards any changes made to the file and checks it back into the server.

  1. Select the file/target.
  2. Right click on the item and select Undo Check Out... from the context menu.

    The Undo Check Out File dialog box opens. Click on Advanced to access Surround SCM options.

  3. Click OK.


The file is no longer checked out.

[edit] Removing files

You can remove files from Surround SCM control.

  1. Select the file/target you want to remove.
  2. Right click on the item and select Remove from Source Control... from the context menu.

    The Remove Files and Repositories dialog box opens. Click on Advanced to access Surround SCM options.

  3. Click OK to remove the files.


The file is removed.

[edit] Viewing file differences

You can diff files to compare, accept, or reject differences between two files.

  1. Select the file/target you want to diff.
  2. Right-click on the item and select Show Differences... from the context menu.

    The Surround SCM Differences dialog opens.

  3. Click on Differences to launch the diff utility to view the differences.


Note: The diff utility will be the one specified in the Surround SCM client.

[edit] Viewing file history

File history provides a way to view a source file’s history and work with a historical file version.

  1. Select the file/target you wish to view its history.
  2. Right-click the item and select Show History... from the context menu.

    The History dialog box opens. This dialog box includes a summary of historic version information.

  3. Click Close to close the history.

[edit] Viewing file properties

File properties include general source control and check out information about the selected file.

  1. Select the file/target you wish to view its properties.
  1. Right-click on the item and select SCC Properties.....

    The Properties dialog box opens. The General tab includes read-only information about the file. Depending on your security permissions you may also be able to Expand keywords or select a File type. If the file is checked out you can click the Check Out tab to view check out information. This tab includes read-only check out information about the file.

  2. Click OK to close the Properties dialog box.


Use the information in this dialog to see which branch and repository the file/target is associated with.

Note: A Shared tab is also available if the file is shared in Surround SCM.


[edit] Refreshing file status

If you make changes to a file outside of PowerBuilder you can refresh the file to update its status. For example, if you check out a file from the Surround SCM client it will not be displayed as checked out in PowerBuilder unless you refresh the file status or until the automatic refresh takes place.

  1. Choose the file/target you wish to refresh its status.
  2. Right-click on the item and select Refresh Status.


The file status is refreshed.

[edit] About License Usage

Any time that PowerBuilder requests an action from Surround SCM, it requires a license. It will use the license associated with the userID set up in the workspace source control properties.

Keep in mind that even refreshing a file status requires a license. This is important to keep in mind when setting up the status refresh rate in the source control properties of the workspace. If you have PowerBuilder open but are not performing any source control options, a license may still be locked because of the status refresh operation.

[edit] Troubleshooting PowerBuilder and Surround SCM integration

The following information is provided to help you troubleshoot common issues.

[edit] Surround SCM is not displayed as an active SCM provider

If Surround SCM is not available from the Source Control System dropdown menu it is not configured as the active SCM provider. Check the following for possible causes and resolutions.

  • The Surround SCM plug-in is not installed.
Run the Surround SCM client installation.
  • Surround SCM is not configured as the active SCM provider.
Open a registry editor utility such as regedit. Go to HKEY_LOCAL_MACHINE/SOFTWARE/SourceCodeControlProvider key. Note the value of the ProviderRegKey string. For example, Software\Seapine Software\Surround SCM\Scci.
Go to HKEY_LOCAL_MACHINE/<value of ProviderRegKey string>.
  • Verify the value of the SCCServerName is Surround SCM.
  • Verify the value of the SCCServerPath is C:\Program Files\Seapine\Surround SCM\Surround SCM SCCI.dll for default installation. If you installed Surround SCM in another directory, make sure the correct path is entered.

[edit] Surround SCM files are not displayed correctly in PowerBuilder

You added files to Surround SCM but the Surround SCM menu items are not enabled when the files are viewed from PowerBuilder. Check the following for possible causes and resolutions.

  • The PowerBuilder workspace is configured incorrectly.
Make sure the workspace points to a Surround SCM branch/repository that exists on the Surround SCM server you are connecting to. To check this information, select a file, right click, and select SCC Properties... from the context menu.
  • The branch/repository points to an invalid working directory.
Make sure the working directory for the repository associated with the workspace points to the same local root folder as the workspace. You may experience integration problems if you set up the working directory to point to a different location.
  • The local .MySCMServerInfo file is out of sync.
PowerBuilder cannot determine where Surround SCM files are located if the .MySCMServerInfo file is out of sync. Go to the directory where the Surround SCM files are located and open the .MySCMServerInfo file with Notepad. Make sure it points to the correct branch/repository. If it does not, delete the file and refresh it from Visual Studio to regenerate it with the proper data.













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