Professional Documents
Culture Documents
Creating Reports: Topics
Creating Reports: Topics
Creating Reports: Topics
Creating Reports
Topics
Objectives............................................................................................................ 9-2
Reporting with cleartool Subcommands................................................................ 9-3
annotate: Reporting on File Changes.................................................................... 9-4
describe: Reporting on VOB Objects ................................................................... 9-6
lshistory: Reporting on Events.............................................................................. 9-9
-fmt option: Formatting Reports ......................................................................... 9-12
find: Searching for VOB Objects ........................................................................ 9-14
Running Reports from the File Browser ............................................................... 9-18
Objectives
Objectives
Upon completing this module, you should be able to:
Report on ClearCase objects and events using
cleartool subcommands
Report on ClearCase objects and events using the
File Browser
You can use the annotate command when you want to examine, line-by-line, changes
made to a text file. For example, imagine you are inspecting a C++ file and notice
some indecipherable code that is uncommented. You want to determine the code’s
author and its reason for its existence.
The annotate command lists the contents of a version, annotating each line to indicate
when, and in which version, the line was added.
By default, annotate writes its output to a file with a .ann extension. By default,
ClearCase puts the .ann file in the same location as the original file.
Element path
Text line
annotations
The .ann file contains the output of the cleartool annotate command.
The standard report output includes the following sections:
• Element pathname — shows path of element being annotated.
• Heading section — lists the event record for each version.
• Text line annotations — includes a bar graph indicating how long ago the line first
appeared in an ancestor version, along with that version’s time stamp, creator, and
version-ID.
• Elision strings — replaces text line annotations that would duplicate the annotation
on the preceding line. Includes a bar graph and single dot (.) character.
The describe command lists information about VOBs and the objects they contain.
The cleartool describe command produces several kinds of listings, including:
• File-system data — Provides information on elements, versions, derived objects,
and VOB symbolic links.
• Type object — Provides information on VOB type objects, for example label,
hyperlink, and branch types.
• VOB object — Provides information on a VOB, including storage area, creation
date, owner, and related views.
• VOB replica — For MultiSite installations, provides information on the object that
represents a VOB replica.
In this example, the describe command reports on the version of an element selected
in the current view.
Review the example to see the types of information describe provides about the
element and this particular version.
The lshistory command lists event records. It describes operations that affect VOB data.
There are several kinds of listings, including:
• File-system data history — Lists events concerning elements, branches, versions,
and VOB links. This includes records for creation and deletion of objects, and
records for attaching and removal of annotations: version labels, attributes, and
hyperlinks.
• Hyperlink history — Lists events concerning hyperlink objects: creation, deletion,
and attaching and removal of attributes.
• Type history — Lists events concerning type objects that have been defined in the
VOB.
• VOB history — Lists events concerning the VOB, including the deletion of type
objects and elements from the VOB.
• VOB replica history — For MultiSite installations, lists events concerning a VOB
replica, including synchronization updates.
10
In this example, the lshistory command reports on the event history of an element,
hello.c.
Review the example to see the types of information lshistory provides about events.
The report lists events in reverse chronological order.
Notice the bottom (earliest) three history lines. These events are generated by a single
ClearCase operation — Add to Source Control (from the GUI) or cleartool mkelem
(from the CLI). For more information on the mapping of operations to events, please
see the online Help topic events_ccase.
11
In this example, the lshistory command reports on events for the current directory
involving the r2_bugfix branch.
Review the example to see the types of information lshistory provides about events.
The report lists events in reverse chronological order.
12
The –fmt option allows you to customize the format of reports generated by cleartool
subcommands.
-fmt has a large set of capabilities. For complete details on using
–fmt, see online Help topic fmt_ccase or the ClearCase Reference manual.
In this example, using the –fmt option with the cleartool lshistory command allows
you to alter the default formatting of the report output.
The formatting parameters of the –fmt option are similar to those of the printf
command in C and C++.
In the example on the slide, the format string "\tElement:
%-13.13En Version: %Vn\n" means the following:
•"\t"
Print a TAB character.
•"Element: "
Characters are printed unmodified in output.
•"%-13.13En"
Print the element name ("%En"), but the field width is specified explicitly with the "-
13.13" modifier, which means minimum width 13 characters and maximum width 13
characters, resulting in an exact width of 13 characters. The "-" says to left-justify the
element name within the specified output field, which means blanks will be added to
the end of the element name if it is shorter than 13 characters. Element names longer
than 13 characters are truncated.
•" Version: "
Characters are printed unmodified in output.
•"%Vn"
Print the Version ID.
"\n"
Print a new-line character.
14
The cleartool find command uses a pattern, query, or expression to search for
ClearCase objects.
cleartool find selects a set of objects, selects a subset, and then performs an action on
the subset. The action can be to list the objects
(–print) or execute a command on each object (-exec).
You can search for objects in the directory structure of the current view, throughout the
VOB, or across all mounted VOBs.
To find objects visible in the directory structure seen in the current view:
find pname ... selection-options action-options
To find all objects in the VOB:
find [ pname... ] -all [ -visible | -nvisible ] selection-options action-options
To find objects throughout all mounted VOBs:
find -avobs [ -visible | -nvisible ] selection-options action-options
15
In this example, you can see how to use cleartool find to find and list all elements in
and below the current working directory.
The semantic of the ClearCase find command is analogous to a UNIX find command.
16
In example 2, you can see how to use cleartool find to find and list all elements owned
by a particular user (pat) on the current directory and subdirectories, and then apply a
label.
For more information, refer to online Help topic query_language.
17
In example 3, you can see how to use cleartool find to find and list all elements that
have a BugNum attribute with a value 189 attached to it. The attribute could be
attached to the element or to a branch or version of the element. Using find in this way
allows you to get a change set, a list of elements associated with particular bug fix.
18
Module Review
Module Review
When might you use cleartool annotate?
When might you use cleartool describe?
When might you use cleartool lshistory?
What is the –fmt option?
When might you use cleartool find?
19
Module Lab
Module Lab
In this lab, you will:
Report on ClearCase objects and events using
cleartool subcommands
20