View that uses attributes to select versions

Suppose that the QA team also works on the major branch. Individual developers are responsible for making sure that their modules pass a QA check. The QA team builds and tests the application, using the most recent versions that have passed the check.

The QA team can work in a view that uses this config spec:
(1)
element –file src/* /main/major/{QAOK=="Yes"}
(2)
element * /main/LATEST

To make this scheme work, you must create an attribute type, QAOK. Whenever a new version that passes the QA check is checked in on the major branch, an instance of QAOK with the value Yes is attached to that version. (This can be done manually or with an HCL VersionVault trigger.)

If an element in the /src directory has been edited on the major branch, this view selects the branch’s most recent version that has been marked as passing the QA check (Rule 1). If no version has been so marked or if no major branch has been created, the most recent version on the main branch is used (Rule 2).

Tip: Rule 1 on this config spec does not provide a match if an element has a major branch, but no version on the branch has a QAOK attribute. This command can locate the branches that do not have this attribute.

On Linux and the UNIX system

cleartool find . –branch '{brtype(major) && \! attype_sub(QAOK)}' –print 

The backslash ( \ ) is required in the C shell only, to keep the exclamation point ( ! ) from indicating a history substitution.

On the Windows® system

cleartool find . –branch "{brtype(major) && ! attype_sub(QAOK)}" –print

The attype_sub primitive searches for attributes on versions and branches of an element and on the element itself.

This scheme allows the QA team to monitor the progress of the rest of the group (see the following figure).

Figure 1. Development config spec versus QA config spec

A version tree has the main branch that has versions 0 through 4 and, off version 1, the major branch with versions 0 through 3. On the major branch verstions 1 and 2 are marked Version that the QA config spec selects; and version 3 is marked Version that the development config spec selects.

The development config spec always selects the most recent version on the major branch, but the QA config spec may select an intermediate version.