Adding objects to source control

You add an object to your source control project by selecting the Add To Source Control menu item from the object’s pop-up menu in the System Tree or in the Library painter. You can also select an object in a Library painter view and then select Entry>Source Control>Add To Source Control from the Library painter menu bar.

What happens when you add objects to source control

When you add an object to source control, the icon in front of the object changes from a plus sign to a green dot, indicating that the object on the local machine is in sync with the object on the server.

PocketBuilder creates read-only object files in the local root directory for each PocketBuilder object that you add to source control. These files can be automatically deleted if you selected the Delete PocketBuilder Generated Object Files option as a source control connection property (although you cannot do this for certain SCC systems such as Perforce or ClearCase). Read-only attributes are not changed by PocketBuilder if you later remove a workspace containing these files from source control.

Adding multiple objects to source control

If the object you select is a PocketBuilder workspace, a dialog box displays listing all the objects for that workspace that are not currently under source control (although the workspace PKW and target PKLs are not included in the list). If the object you select is a PocketBuilder target, and at least one of the objects in that target has not been registered with the current source control project, PocketBuilder displays a dialog box that prompts you to:

If you select the multiple files radio button, another dialog box displays with a list of objects to add to source control. A check box next to each object lets you select which objects you want to add to source control. By default, check boxes are selected for all objects that are not in your source control project. They are not selected for any object already under source control.

For all source control dialog boxes listing multiple files, you can resize the list by placing a cursor over the edge of the dialog box until a two-headed arrow displays, then dragging the edge in the direction of one of the arrow heads.

NoteSelecting multiple files from a PKL If you select Add To Source Control for a target PKL, you immediately see the list of multiple files from that PKL in the Add To Source Control dialog box. There is no need for an intervening dialog box as there is for a target or workspace, since you cannot register a PKL file to source control from the PocketBuilder UI. You can register only the objects contained in that PKL.

You can also select multiple objects to add to source control from the List view of the Library painter without selecting a workspace, target, or PKL.

You cannot add objects to your source control project that are already registered with that project. The Add To Source Control menu item is disabled for all objects that are registered in source control except workspaces and targets. If you select the Add To Source Control menu item for a workspace or target in which all the objects are already registered to source control, PocketBuilder displays the Add To Source Control dialog box with an empty list of files.

Creating a mapping file for target PKLs

When you add a target, or an object in a target that is not under source control, to source control, PocketBuilder creates a PKG file. The PKG files are used by PocketBuilder to make sure that objects are distributed to the correct PKLs and targets when you check the objects out (or get the latest versions of the objects) from source control.

A PKG file maps objects in a target to a particular PKL in a PowerScript target. One PKG file is created per PKL, so there can be multiple PKG files per PowerScript target. If a PKG file already exists for a target PKL containing the object you are adding to source control, PocketBuilder checks the PKG file out of source control and adds the name of the object to the names of objects already listed in the PKG file. It then checks the PKG file back in to source control.

If your source control system requires comments on registration and check-in, you get separate message boxes for the PKG file and the objects that you are adding to source control. If your source control system gives you the option of adding the same comments to all the objects you are registering, you might still see additional message boxes for PKG files, since PKG files are checked in separately.

Because it is possible for PKG files to get out of sync, it is important that the project manager monitor these files to make sure they map all objects to the correct PKLs and contain references to all objects in the source control project. However, you cannot explicitly check in or check out PKG files through the PocketBuilder SCC API.

For more information on modifying PKG files, see “Editing the PKG file for a source-controlled target”.