Seapine Labs
Personal tools

Visual C++ 6 Integration

From Seapine Labs

Jump to: navigation, search

Contents

[edit] Background

This 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/workspace explorer in File View mode.

Figure 1: Project Explorer
Figure 1: Project Explorer

As shown in the Figure 2, the project is saved in the \WorkDir\CPAPP\ folder.

Figure 2: Project Location
Figure 2: Project Location

The D:\WorkDir\ directory 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.

Figure 3: Working Directories
Figure 3: Working Directories

[edit] Adding an Existing Project to Surround SCM

To add the project to Surround SCM, choose Project > Source Control > Add to Source Control.

Figure 4: Add Files to Surround SCM
Figure 4: Add Files 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 C++ (D:\WorkDir\CPAPP) is not set as a working directory in Surround SCM. You are prompted to establish this association, as shown in Figure 5.

Figure 5: Fix Association Prompt
Figure 5: Fix Association Prompt

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.

Figure 6: Repository Browser
Figure 6: Repository Browser

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.

Figure 7: Repository Browser
Figure 7: Repository Browser

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.

Figure 8: Create Repository
Figure 8: Create Repository

Next, Visual C++ 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.

Figure 9: Add Files Dialog Box
Figure 9: Add Files Dialog Box

At this point, the integration set up is pretty much finished. Surround SCM actions are available from the Project > Source Control menu and from the shortcut menu for each file.

Figure 10 shows the Surround SCM actions available from both menus.

Figure 10: Surround SCM Actions
Figure 10: Surround SCM Actions

Figure 10 also shows the status icons added to the files to reflect the status of the file in Surround SCM. The files now have a check mark next to them to reflect their checked out status.

[edit] Accessing Surround SCM Actions from Visual C++ 6.0

Most Surround SCM commands are available from the Project > Source Control 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 Project > Source Control menu performs the command on multiple files.

The following instructions use commands selected from the Project > Source Control menu. If you use the shortcut menu, the dialog boxes may differ slightly.

[edit] Adding files to Surround SCM

When a new file is added to the project, it can also be added to the Surround SCM repository from the Visual C++ 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 C++ 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 C++, select the file. Choose Project > Source Control > Add to Source Control. The Add Files to Surround SCM dialog box opens.

Figure 11: Add Files to Surround SCM Dialog Box
Figure 11: Add Files to Surround SCM Dialog Box

Click the Advanced button to access additional add options.


[edit] Getting the latest file version

(Note: The recursive check box is unavailable because it does not apply to check outs from the Visual C++ IDE.)

To get the latest version of files, choose Project > Source Control > Get Latest Version. The Get Files from Surround SCM dialog box opens.

Figure 12: Get Files Dialog Window
Figure 12: Get Files Dialog Window

Click the Advanced button to access the following options:

  • Force file retrieval from the server: Forces a get of the server copy of the files regardless of the file in the working directory.
  • Make files writable: Retrieves a writable copy of the file.
  • Merge should first attempt auto-merge: If a merge is needed, and this option is selected, Surround SCM will first try to auto-merge the files. If this option is not selected, you may be prompted to manually merge the files. This situation usually only occurs with non-exclusive check outs when another user checks in changes at the same time.
  • Overwrite option: Specifies what happens if a modified file is found.
  • File timestamp: Specifies the timestamp to be placed on the file retrieved.
  • Get Based on Options: These options are used to specify which version of the file is retrieved. You can get a file based on the version, timestamp, label, or workflow state.
Figure 13: Advanced Get Dialog Box
Figure 13: Advanced Get Dialog Box

[edit] Checking out files

Check files out from Visual C++ when they need to be modified. To check out files, select one or more files then choose Project > Source Control > Check Out.

Figure 14: Check Out Dialog Box
Figure 14: Check Out Dialog Box

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 C++ IDE.)

  • Exclusive check out: Prevents other users from checking out the files.
  • Force file retrieval from the server: Forces a get of the server copy of the files regardless of the file in the working directory.
  • Check in as part of the following changelists: Attaches the files to a changelist when they are checked in.
  • View pending changelist after check out: Displays the pending changelists after the check out.
  • Overwrite option: Specifies what happens if a modified file is found.
  • File timestamp: Specifies the timestamp to be used when the files are checked out from the server.
Figure 15: Check Out Dialog Box
Figure 15: Check Out Dialog Box

[edit] Undoing check out

If 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 Project > Source Control > Undo Check Out.

Figure 16: Undo Check Out Dialog Box
Figure 16: Undo Check Out Dialog Box

Like the other dialog boxes discussed in this article, the undo checkout dialog box includes advanced options.

Figure 17: Advanced Undo Checkout Options
Figure 17: Advanced Undo Checkout Options
  • Get original version: Retrieves a read-only copy of the version of the file when it was checked out.
  • Get latest version: Retrieves a read-only copy of the latest version of the file. This will be different from the original version if the file was modified by another user while it was checked out (i.e., was not an exclusive check out).
  • Leave local file: Leaves the local file as is.

[edit] Checking in files

Changes 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 C++ IDE, select the files then choose Project > Source Control > Check In.

Figure 18: Check In Files Dialog Box
Figure 18: Check In Files Dialog Box

Click the Advanced button to access the following options:

  • Prompt for Seapine Suite Integration: Displays a list of defects based on the TestTrack integration set up for the repository where the project resides in Surround SCM. This allows you to link the file with a TestTrack Pro defect.
  • Check in as part of a changelist: Attaches the file to a new or existing changelist.
  • View pending changelists after check in: Displays the pending changelists after the check in. The changelist can be reviewed, edited, and committed.
  • Apply comments to all: Applies the same comment to all files being checked in. Only applies when checking in more than one file at a time.
  • Change state when version updated: Changes the state of the file in Surround SCM if the workflow is enabled for the repository where this file resides.
  • Get file after check in: Retrieves a read-only copy of the file after it is checked in.
  • Keep checked out: Checks in the changes but leaves the file checked out and writable. This option is best used when applying periodic check ins as long series of changes are made. This can help avoid a catastrophic loss of work if the hard drive of the local computer crashes and the local file cannot be retrieved.
  • Leave local copy as is: Leaves a writable copy of the file in the working directory.
  • Remove local copy: Removes the file from the local directory.
  • Label: Labels provide a way to mark a specific version of a file or repository.
  • Skip server auto-merge: Checks in the file without merging it. The file becomes the new version even if another user made changes and checked in the file after the file was checked out.
  • Update version even if no change is made: Allows files that were not modified to be checked in. The version number increments by one.
  • Make files writable: Leaves the copy of the file in the working directory writable.
Figure 19: Advanced Check In Options
Figure 19: Advanced Check In Options

[edit] Refreshing file status

A 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 C ++ until you refresh the status.

To refresh the file status select the file, and choose Project > Source Control > Refresh Status.

[edit] Viewing file differences

Differences 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 Project > Source Control > Show Differences.

The differences utility starts if differences are found between the two file versions. For information about the utility refer to the application’s documentation.

[edit] Viewing file history

File 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 Project > Source Control > 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 Issues

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

[edit] Surround SCM in not available from the Source Control menu

There are several reasons why Surround SCM is not available from the Visual C++ Source Control menu.

  • Surround SCM is not the Default SCCI Provider
The first possible cause is that Surround SCM is not set as the default source code provider. To check this, log into the Surround SCM client. Choose Tools > User Options then select the Integration category. Make sure the Make Surround SCM my default SCCI provider option is selected.
Figure 20: User Options
Figure 20: User Options
  • Version of Visual C++ does not support Source Code Control integration
Certain versions of Visual C++ 6.0 (like the academic edition) may not support source code control integration.

[edit] Visual C++ is unable to establish an association with an unrelated branch

When 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 C++ 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 Differences

When you view file differences from the Visual C++ IDE, an error message similar to the one in Figure 22 may open.

Figure 22: Guiffy Error Message
Figure 22: Guiffy Error Message

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.

Figure 23: Registry Editor
Figure 23: Registry Editor
[edit] Surround SCM files are not displayed correctly in Visual C++

Files have been added to Surround SCM but the Surround SCM menu items are not enabled when the files are viewed from Visual C++. Check the following for possible causes and resolutions.

  • The branch/repository points to an invalid working directory
Make sure the working directory for the repository associated with the project points to the same local directory as the project. You may experience integration issues if the working directory points to a different location.
  • The local .MySCMServerInfo file is out of sync
Visual C++ 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 C++ to regenerate it with the proper data.

[edit] Files cannot be added to Surround SCM from Visual C++

If files cannot be added to Surround SCM from Visual C++, check the following for possible causes and resolutions.

  • Check the SCM output to view error messages
The Output window displays messages as Surround SCM actions are performed. Check this window for error messages that occur when trying to add files.
  • The Visual C++ project is configured incorrectly
Make sure the project points to a Surround SCM branch/repository that exists on the Surround SCM Server you are connecting to.













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