Toolboxcategory cloud |
ViewsPersonal toolsVisual Basic 6 IntegrationFrom Seapine Labs[edit] BackgroundThis example starts with a project that is not associated with a source code control application and has not been added to Surround SCM yet. Figure 1 shows the sample project in the project explorer. As shown in Figure 2, the project is saved in the D:\WorkDir\Integration Example\ folder. The D:\WorkDir\ directory is a folder that is the root for all the working directories for this computer. It is not a working directory for a repository, as shown in Figure 3. [edit] Adding an Existing Project to Surround SCMTo add the project to Surround SCM, choose Tools > Surround SCM > Add Project to Surround SCM. Surround SCM cannot establish an association because the project files have not been added to Surround SCM and the directory where the project is running from in Visual Basic (D:\WorkDir\Integration Example) is not set as a working directory in Surround SCM. You are prompted to establish this association, as shown in Figure 5. To establish an association between the project and Surround SCM, click the Fix button to create a repository for the project. The Repository Browser dialog box opens after you click the Fix button. Select the branch and repository you want to create the new repository in. In this example, shown in Figure 7, the repository for the project will be created on the mainline branch under the top-level repository. Click the Create Repository button after the branch and repository are selected. The Create Repository dialog box opens. By default, Surround SCM uses the project name for the repository and the directory that the project is running from as the working directory. Because this directory is not a child directory of the working directory for the parent repository (i.e., D:\WorkDir is not the working directory for the CremerSoft repository), the Inherit working directory from parent option is not selected. Next, Visual Basic prompts you to add files to Surround SCM. You should add all files to Surround SCM, unless there are specific files that should not be controlled via Surround SCM. At this point, the integration set up is pretty much finished. Surround SCM actions are available from the Tools > Surround SCM menu and from the shortcut menu for each file. Figure 10 shows the Surround SCM actions available from both menus. Figure 10 also shows the status icons added to the files to reflect the status of the file in Surround SCM. The project file has a lock icon, which indicates that the file is currently checked in. The form file has a red check mark icon, which indicates that the file is checked out. [edit] Accessing Surround SCM Commands in Visual Basic 6.0Most Surround SCM commands are available from the Tools > Surround SCM menu and from each file’s shortcut menu. The main difference is that a command selected from a file’s shortcut menu performs the command on that file only. Selecting a command from the Tools > Surround SCM menu performs the command on multiple files. The following instructions use commands selected from the Tools > Surround SCM menu. If you use the shortcut menu, the dialog boxes may differ slightly. [edit] Adding files to Surround SCMWhen a new file is added to the project, it can also be added to the Surround SCM repository from the Visual Basic interface. Save the file in the working directory that corresponds to the repository where the file is to be added. The following instructions show how to set Visual Basic to automatically prompt the user to add a file to source control every time a file is added. To add files to Surround SCM through Visual Basic, select the file. Choose Tools > Surround SCM > Add Files to Surround SCM. The Add Files to Surround SCM dialog box opens. Click the Advanced button to access additional add options.
[edit] Getting the latest file versionTo get the latest version of files, choose Tools > Surround SCM > Get Latest Version. The Get Files from Surround SCM dialog box opens. Click the Advanced button to access the following options:
[edit] Checking out filesCheck files out from Visual Basic when they need to be modified. To check out files, select one or more files then choose Tools > Surround SCM > Check Out. Click the Advanced button to access the following options: (Note: The recursive check box is unavailable because it does not apply to check outs from the Visual Basic IDE.)
[edit] Undoing check outIf a file is checked out and modified, but then a decision is made to not save the changes, the check out can be undone. To undo a check out, select the file then choose Tools > Surround SCM > Undo Check Out. Like the other dialog boxes discussed in this article, the undo checkout dialog box includes advanced options.
[edit] Checking in filesChanges that are made to files need to be checked in to the Surround SCM Server periodically. Simply saving the files does not automatically check in the files. Checking in the files creates a new version of the files and gives other users access to the changes. To check in files from the Visual Basic IDE, select the files then choose Tools > Surround SCM > Check In. Click the Advanced button to access the following options:
[edit] Refreshing file statusA query to the server to get the latest status of each file can be requested. For example, a file that is checked out from Surround SCM will not be marked as checked out in Visual Basic until you refresh the status. To refresh the file status select the file and choose Tools > Surround SCM > Refresh.
[edit] Viewing file differencesDifferences between the server copy and the working directory copy of a file can be viewed with the integrated diff/merge utility. To view the differences, select the file then choose Tools > Surround SCM > Differences. The differences utility starts if differences are found between the two file versions. For additional
information about the utility refer to the application’s documentation.
[edit] Viewing file historyFile history provides a way to view a source file’s history and work with a historical file version. To view the history, select the file then choose Tools > Surround SCM > Show History. The History dialog box includes a summary of historic version information. Please refer to the Surround SCM User Guide for more information.
[edit] Possible IssuesThe following information is provided to help you troubleshoot common issues. [edit] Surround SCM in not available from the Tools menuThere are several reasons why Surround SCM is not available from the Visual Basic Tools menu.
[edit] Visual Basic is unable to establish an association with an unrelated branchWhen trying to add the project to source control, instead of getting the prompt to associate with a repository (Figure 5 above), you get a status message from Visual Basic that it was unable to establish an association between the directory where the project is running from and some other branch/repository. This can be confusing, especially if this branch or repository has no association with this project. This can occur if a .MySCMServerInfo file exists in the directory tree and it references this unrelated branch or repository. For example, in the project above, a .MySCMServerInfo file existed in the D:\WorkDir folder and referenced a different Surround SCM Server. After the .MySCMServerInfo file was deleted, the integration worked as expected. [edit] Guiffy Cannot be Loaded when Trying to View DifferencesWhen you view file differences from the Visual Basic IDE, an error message similar to the one in Figure 22 may open. To fix this, you need to edit the registry to allow for Guiffy to run as a separate process. The following key needs to be modified: HKEY_CURRENT_USER\Software\Seapine Software\Surround SCM\SCM Client The RunGuiffyAsSeparateProcess value must be set to true as shown in the Figure 23. [edit] Surround SCM files are not displayed correctly in Visual BasicFiles have been added to Surround SCM but the Surround SCM menu items are not enabled when the files are viewed from Visual Basic. Check the following for possible causes and resolutions.
[edit] Files cannot be added to Surround SCM from Visual BasicIf files cannot be added to Surround SCM from Visual Basic, check the following for possible causes and resolutions.
[edit] An error message is returned when you perform a Surround SCM actionWhen Surround SCM actions, such as checking out files, are performed, an error message opens that states the file is not valid for the operation. Check the following for possible causes and resolutions:
|


