Comparing local objects with source control versions

The PocketBuilder SCC API lets you compare an object in your local directory with a version of the object in the source control archive (or project). By default, the comparison is made with the latest version in the archive, although most source control systems let you compare your local object to any version in the archive. Using this feature, you can determine what changes have been made to an object since it was last checked in to source control.

Setting up PBNative for object comparisons

PBNative does not have its own visual difference utility, but it does allow you to select one that you have already installed. You must use only a 32-bit visual difference utility for the object comparisons. You can select any or all of the following options when you set up the utility to work with a PBNative repository:

Table 5-5: Object comparison options for use with PBNative

Option

Select this if

Enclose file names in double quotes

Your visual difference utility does not handle spaces in file names

Refer to local PKL entry as argument #1

You do not want the visual difference utility to use the repository object as the first file in a file comparison

Generate short (8.3) file names

Your visual difference utility does not handle long file names

Generate an extra space prior to file arguments

Your visual difference utility requires an extra space between files that are listed as arguments when you open the utility from a command line

StepsTo set up PBNative for object comparisons

  1. Right-click the Workspace object in the System Tree and click the Source Control tab in the Workspace Properties dialog box.

    PBNative should be your selection for the source control system, and you must have a project and local root directory configured. If you are connected already to source control, you can skip the next step.

  2. Click Connect.

    The Connect button is disabled if you are already connected to source control.

  3. Click Advanced.

    The PBNative Options dialog box displays.

  4. Type the path to a visual difference utility followed by the argument string required by your utility to perform a diff (comparison) on two objects.

    Typically, you would add two %s parameter markers to indicate where PocketBuilder should perform automatic file name substitution. The following figure shows a setting used to call the Microsoft WinDiff utility:

    The sample shows a P B Native Command Options dialog box. The command string to invoke the visual diff utility is shown as d : backslash win diff backslash win diff 32 dot e x e % s % s.
  5. (Optional) Select any or all of the check box options in the PBNative Command Options dialog box for your object comparisons.

  6. Click OK twice.

    You are now set to use your visual difference utility to compare objects on the local machine and the server.

Using Show Differences to compare objects

You can select Show Differences from a pop-up menu or from the Library painter menu bar. If the object you want to compare has not been added to the source control project defined for your workspace, the Show Differences menu item is not available.

StepsTo compare a local object with the latest source control version:

  1. Right-click the object in the System Tree or in a Library painter view and

    select Show Differences from the pop-up menu

    or

    Select the object in a Library painter view and select Entry>Source Control>Show Differences from the Library painter menu bar.

    A dialog box from your source control system displays.

    NotePBNative connections Skip the next step if you are using a visual difference utility with PBNative. The difference utility displays the files directly or indicates that there are no differences between the files.

  2. Select the source control comparison options you want and click OK.

    Some source control systems support additional comparison functions. You may need to run the source control manager for these functions. See your source control system documentation for more information.