[Contents] [Prev. Chapter] [Next Section] [Next Chapter] [Index] [Help]

7    Code Manager

This chapter provides an overview of the Code Manager's features and capabilities. For more detailed information on how to use this tool, choose Help: On Code Manager. You can print Help topics using the HyperHelp Viewer.

The FUSE Code Manager provides a graphical user interface for managing a source code library. The Code Manager supports SCCS (Source Code Control System) and RCS (Revision Control System) libraries.

Figure 7-1:  Code Manager Main Window

Key elements are the major window panes running from the top to the bottom of the window:

Configuration area

Displays the current project, library type (RCS or SCCS), and number of revisions to display by default.

Library graph display area

Presents a graphical view of the libraries you have configured to be open and information corresponding to the revision information button settings (directly below the graph) for expanded entries. Double click on an entry or use the Graph menu to expand entries. Red file icons indicate a locked file.

Revision information buttons

Let you display the log message (comments), date and time, user, symbol, and state for expanded entries.

Transcript area

Logs transactions and status of Code Manager operations.

Information area

Displays information messages and Quick Help on menu items when you press and hold MB1 on the item.


[Contents] [Prev. Chapter] [Next Section] [Next Chapter] [Index] [Help]

7.1    Summary of Features

Use the Code Manager to do the following:


[Contents] [Prev. Chapter] [Prev. Section] [Next Section] [Next Chapter] [Index] [Help]

7.2    Requirements for Using the Code Manager

To use the Code Manager to create and maintain source code libraries, make sure of the following:


[Contents] [Prev. Chapter] [Prev. Section] [Next Section] [Next Chapter] [Index] [Help]

7.3    Starting the Code Manager

You can start the Code Manager in several ways:


[Contents] [Prev. Chapter] [Prev. Section] [Next Section] [Next Chapter] [Index] [Help]

7.3.1    Use the Command Line

You can start the Code Manager from the command line using the following command:

% fusecm [Xt-Options] [-cwd]

See Appendix Appendix D and the specific reference pages for the command syntax and options.

If the Control Panel is not running, it starts automatically as a minimized icon. If FUSE is already running, the Code Manager is placed in the current project.


[Contents] [Prev. Chapter] [Prev. Section] [Next Section] [Next Chapter] [Index] [Help]

7.3.2    Use the Code Manager Icon from CDE

When you have CDE installed, FUSE provides a FUSE application group icon and icons for the individual tools that make up the FUSE environment.

To invoke the Code Manager:

  1. Double click on the Application Manager icon in the CDE Front Panel to display the application group icons.

  2. Double click on the FUSE application group icon to display the icons in the FUSE application group.

  3. Double click on the Code Manager icon to start the tool.


[Contents] [Prev. Chapter] [Prev. Section] [Next Section] [Next Chapter] [Index] [Help]

7.3.3    Use the FUSE Control Panel

To start the Code Manager from the Control Panel:

  1. Select Code Manager from the Tools menu in the Control Panel. If libraries are not specified as project data, the Code Manager looks for a library in the project working directory. If it fails to find one, an informational box appears with the following choices:

    • Open Libraries: Use to add a library to the list of libraries to be opened automatically when the Code Manager is invoked in the current saved project. Then open the specified library.

    • Create Library: Use to create a new RCS or SCCS library.

    • Cancel: Use to cancel this invocation of the Code Manager. You must create or open a library to use the Code Manager.

  2. Click on one of the buttons depending on whether you want to open an existing library or create a new one.


[Contents] [Prev. Chapter] [Prev. Section] [Next Section] [Next Chapter] [Index] [Help]

7.3.4    Use the Tools Menu from Most Tools

Most FUSE tools have a Tools menu. To start a tool, select the tool from the Tools menu.


[Contents] [Prev. Chapter] [Prev. Section] [Next Section] [Next Chapter] [Index] [Help]

7.4    Opening Libraries

The Code Manager lets you open and work with one or more source libraries. To open libraries, you must specify the paths and associated working directories for the libraries in the Project Manager dialog box. If you save the current project, these Code Manager settings are retained from session to session. Whenever you start the Code Manager in this project, these libraries are opened automatically.To invoke the Project Manager, choose Library: Open Library. (You can also access this dialog box by choosing Projects: Show/Modify in the Control Panel and then clicking on the Code Manager Settings Category.) Enter a library pathname and an associated working directory in the Library and Working Directory fields and then click on the Add button. Repeat this for each library you want to open. You also need to choose one library type (RCS or SCCS) for the project. Click on OK.Each time you click on OK to open an additional library, the library graph is updated, listing all the source libraries that you have open.

To save these settings as part of the project configuration data, choose Projects: Save in the Control Panel. Once you save the project, the next time you start the Code Manager in the project, it automatically opens those libraries you specified in the Project Manager dialog box.


[Contents] [Prev. Chapter] [Prev. Section] [Next Section] [Next Chapter] [Index] [Help]

7.5    Using the Library Graph

When you open a library, the Code Manager displays the code management library in an outline format with the library path and the working directory associated with the libary as the first line of the outline. When you double click on the library path, the library expands and shows all the files stored in the library. When you double click on a file name, the graph expands an additional level to show the revisions for that file.

Use the library graph to view files and revisions in the library and to select files and revisions for a code management action, such as checkin or checkout, as follows:

To perform this operation... Use this action...
Display revisions for a file Double click on the file name.
Collapse the revision list and show only the file name Double click on the file name (when revisions are displayed).
Select a file or revision Click on it.
Select more than one file or revision Press Ctrl+MB1 on each one.
Select a group of files or revisions that are listed together Move the pointer to the first file or revision, and click on it. Then, move the pointer to the last file or revision and press Shift+MB1 on it. You can also move to the first file or revision, press and hold MB1, and drag the pointer to the last file or revision.
Select all the most recent revisions of the files in the graph Choose Select All from the Graph menu.
Deselect a file or files Click on the selected file.
Deselect all the currently selected files Choose Clear Selections from the Graph menu.

You can also click on one of the revision information buttons below the library graph to display information in the graph about each file. For example, to display the date of each revision in the library graph, click on the clock button (second from left). To clear information from the library graph, click on the button again. Note that unless you double click on a file name to expand its revision display, the information is not visible.

Figure Figure 7-2 shows an RCS library containing the source files for the count program.

Figure 7-2:  Code Manager Library Graph

While the pointer is in the library graph, press MB3 to display the pop-up menu. The pop-up menu contains a subset of the most frequently used menu options from the main menus. Click on the option you want.

The Edit File... item is available only from the pop-up menu.

The Code Manager library graph reflects the state of the library at the time you open it. Other users may be making changes to the library, for example, adding new files, while you are working. You can choose Reload Database from the Library menu to generate a new graph that includes up-to-date library information for each library you have open.


[Contents] [Prev. Chapter] [Prev. Section] [Next Section] [Next Chapter] [Index] [Help]

7.6    Using the Code Manager Transcript Area

The Code Manager maintains a transcript of all output from Code Manager actions. The transcript includes success and error information and output from file and library management actions. Check the transcript after you execute a Code Manager operation to determine if the operation was successful.


[Contents] [Prev. Chapter] [Prev. Section] [Next Section] [Next Chapter] [Index] [Help]

7.7    Merging Files Using the Code Manager

The Code Manager allows you to merge the differences of two files or versions based on a common parent file.

To start a merge operation:

Step Action
1 Select the two revisions of the same file.
2 Choose Merge/Checkout from the Commands menu. The Merge and Check Out File dialog box is displayed, listing the two files you selected and their common parent file.
3 Optionally lock either the Revision 1 file or the Revision 2 file by clicking on the Lock toggle button
4 Click on OK to dismiss the Merge and Check Out File dialog box. The Compare tool is then automatically started and the two revisions are loaded into the display area.
5 Use the Pick Both, Pick Left, Pick Right, Pick None, Next Diff, Prev Diff, Next Conf, and Prev Conf buttons to view the differences and conflicts found between the two files and then choose the ones you want to incorporate into the merged version of the files.
6 When you have resolved the differences and conflicts, choose Save from the File menu to save the changes.

Refer to the online Help for additional information.


[Contents] [Prev. Chapter] [Prev. Section] [Next Section] [Next Chapter] [Index] [Help]

7.8    Running a Process Before or After a Code Manager Function

FUSE lets you specify a sequence of commands to be executed before or after a Code Manager function. If the commands are to be executed before the function, it is called preprocessing; if after the function, it is called postprocessing.

You can use the flexibility of pre- and postprocessing to automate a variety of actions that you might want to associate with a Code Manager function, for example, locking a database before checking out a file, then unlocking the database when the checkout is completed. Pre- and postprocessing can be specified for:

Process execution occurs in the following order:

  1. For each file selected in the library graph, an individual call to the user-defined preprocessing command is made.

  2. After all preprocessing calls are complete, the specified Code Manager function executes on each selected file (based on the return status of the corresponding preprocessing operation).

  3. After all Code Manager functions are complete, the user-defined postprocessing command is called for each selected file (barring a failure during preprocessing that would stop postprocessing; see Section Section 7.8.4).


[Contents] [Prev. Chapter] [Prev. Section] [Next Section] [Next Chapter] [Index] [Help]

7.8.1    Specifying Processing Commands

A process command can be a built-in shell command, a UNIX utility, a script, or an executable file. The Code Manager executes commands and scripts using sh.

A process cannot receive user input from stdin. Anything sent to stdout by a process appears in the Code Manager transcript area. The exception is output from a pre- or post-processing operation associated with the Create Library operation. This output appears in a dialog box in the Project Manager.

To specify a pre- or postprocessing command:

Step Action
1 Choose Library: Set Pre/Post Processing Strings.
2 In the Project Manager (Code Manager Settings Category), click on the Pre-process or Post-process Command fields, depending on when the processing is intended to occur relative to the Code Manager function.
3 Enter in the two fields the call to the processing command or script you want to run.
4 Click on OK in the dialog box.
5 Choose Projects: Save in the Control Panel to save the new properties as part of the project configuration settings for use in subsequent sessions.

A pre- or postprocessing script or command can contain embedded arguments; argument substitution occurs as described in Section Section 7.8.2. You can use variable syntax in your script of the form ${VAR}. If environment variables are in a script line, the Code Manager does not do any substitution before executing the line.

The new pre- or postprocessing commands take effect immediately.

You can also specify pre- and postprocessing commands as the environment variables FUSE_CM_PRE_PROCESS and FUSE_CM_POST_PROCESS. See Appendix Appendix C.


[Contents] [Prev. Chapter] [Prev. Section] [Next Section] [Next Chapter] [Index] [Help]

7.8.2    Command Parameters

Parameters always take the form of the % character followed by an uppercase string, as described in Table Table 7-1. FUSE substitutes the appropriate string or value for the parameter in the process command. A string that starts with a % character but is not a valid parameter as described in Table Table 7-1 is passed unaltered as part of the script line and no error message is issued.

Table 7-1:  Parameters for Code Manager Processing Commands

Parameter Description

%STATUS

Modifies the postprocess action based on the outcome of the Code Manager function. Marks a substitution point in the postprocess script line for the status result of the corresponding Code Manager function, 0 for success, 1 for failure. The return status is that of the requested Code Manager function, not of the preprocessing; for example, Check Out: 0-success, 1-failure.

%FN

Marks a substitution point in the script line for the file name. The generated file name is enclosed in single quotation marks.

%FNV

Marks a substitution point in the script line for the file name and revision number. The generated pair of values is surrounded by single quotation marks. The file name is separated from the revision number by a blank. The revision number is that of the library element being operated on.

For the Commands: Check In... function, the revision number receives special handling; in preprocessing, the revision number is that of the file prior to checkin. In postprocessing, the revision number is the new revision of the file following checkin.

%OP

Marks a substitution point in the script line for the name of the Code Manager function. The following list provides the function followed by the substitution string:

  • Commands: Insert New -- insertnew

  • Commands: Check Out: without lock -- checkout

  • Commands: Check Out: with lock -- checkoutlock

  • Commands: Check In -- checkin

  • Commands: Cancel Lock --unlock

  • Commands: Lock -- lock

  • Commands: Set Symbol -- setsym

  • Commands: Remove Symbol -- remsym

  • Commands: Assign New Release -- newrel

  • View: Locked Revisions -- viewlockrev

  • View: Locked Releases -- viewlockrel

  • View: File Contents -- viewfilecont

  • View: File History -- viewfilehist

  • View: File Description -- viewfiledesc

  • View: File Revisions -- viewfilerev

  • Library: Create -- libcreate

  • Library: Close -- libclose

  • Tools: Configure Tool -- libopen

%WD

Marks a substitution point in the script line for the name of the Code Manager's current working directory.

%LIB

Marks a substitution point in the script line for the Code Manager's current library path. (%LIB does not act as a modifier to individual file names.)

%PH

Marks a substitution point in the script line for the string PRE for preprocessing or POST for postprocessing. Makes it possible to use the same script file for both types of processing if you have the script parse the process command line.

%SEQ

For any given set of pre- or postprocessing calls, marks a substitution point for a pair of numeric values, the first indicating the ordinal in the processing sequence and the second indicating the total number of entries in the sequence. The generated pair of values is enclosed in single quotation marks. For example, the pair '3 20' indicates the third call out of 20 calls to be processed.

Note that a return status of 2 indicates the end of preprocessing (without regard to the total number of entries supplied by %SEQ) and that there will be no postprocessing calls. Further, it is not necessary that the total number of preprocessing calls match the number of postprocessing calls. (For example, if a preprocessing call returns a status of 1, no corresponding postprocessing call will be made. See Section Section 7.8.4 for more information on error processing.)

%RC

Marks a substitution point for the name of the source code tool you are using; valid values are, SCCS or RCS. You could use this to vary the effect of a process based on the type of source code tool in use. The generated value is enclosed in single quotation marks. The field value is empty on a preprocessing libopen call since it is not yet possible to determine the library type at this stage.

%%

Causes the second % character to be passed literally, allowing you to pass a string that would otherwise be interpreted as a script parameter. For example, if you want the string %FN to be part of a processing command, not a substitution point for a file name, use %%FN in the script line.


[Contents] [Prev. Chapter] [Prev. Section] [Next Section] [Next Chapter] [Index] [Help]

7.8.3    Examples of Parameter Substitution

Suppose you selected files named foo and bar in the Code Manager. Consider the following script line:

ls -la %FN

This generates the following processing commands:

        ls -la 'foo'
        ls -la 'bar'

Suppose that foo and bar are files selected in the Code Manager, the current operation is checkin, the current working directory is /mydir/local/, and the current library is /mydir/local/RCS/. Consider the following script line:

foo -fx %OP %WD %LIB %FNV abc

This generates the following processing commands:

        foo -fx checkin /mydir/local/ /mydir/local/RCS/ 'foo 1.1' abc
        foo -fx checkin /mydir/local/ /mydir/local/RCS/ 'bar 1.1' abc


[Contents] [Prev. Chapter] [Prev. Section] [Next Chapter] [Index] [Help]

7.8.4    Error Handling

FUSE supports either of the following options for handling preprocessing errors:

To support these options, calls to preprocessing commands are performed one file at a time rather than making one preprocess call for the entire list of selected files. This lets the Code Manager collect the status returns for each of the individual operations and manage them individually.

The execution of Code Manager functions depends on the status code reported by the preprocess for each file (see Table Table 7-2). The Code Manager also reports the number of successful and failed file operations in the transcript area.

Table 7-2:  Status Codes for Code Manager Preprocessing

Status Code Meaning Example

0

Preprocessing succeeded; perform all postprocessing on the file.

A preprocessing operation checks that a file is unlocked before proceeding to check out the file. If the file is unlocked, the operation returns a status code of 0. The file will be checked out when preprocessing completes (as long as no status code of greater than 1 is returned during further preprocessing).

1

Preprocessing failed; do not perform postprocessing on the file.

A preprocessing operation checks that a file is unlocked before the checkout proceeds. If the file is locked, the operation returns a status code of 1. The file will not be checked out and preprocessing continues (as long as no status code of greater than 1 is returned during preprocessing).

2

Preprocessing failed; stop all further processing, including postprocessing, for all files.

A preprocessing operation checks that the makefile is unlocked before any other files are checked out. A locked makefile returns a status code of 2. All preprocessing stops and no Code Manager functions or postprocessing takes place.

n

Any other status value acts as if a value of 2 (abort) were returned.

See example for status code 2.

To be consistent with preprocessing, postprocessing operates as follows:

The %STATUS parameter marks a substitution point in a postprocessing script line for the status result of the corresponding Code Manager function: 0-success, 1-failure. Do not confuse this with the status code of preprocessing results. See Table Table 7-1 for a description of Code Manager processing parameters.


[Contents] [Prev. Chapter] [Prev. Section] [Next Chapter] [Index] [Help]