Annotates lines of text file / time stamps, user names, and so on
Product | Command Type |
---|---|
ClearCase | cleartool subcommand |
ClearCase LT | cleartool subcommand |
Attache | command |
Platform |
---|
UNIX |
Windows |
The annotate command lists the contents of a version, annotating each line to indicate when, and in which version, the line was added. You can customize the annotations using the -fmt option, which is described in the fmt_ccase reference page. By default, annotate writes its output to a file with the .ann extension.
Each version has a line of descent, a sequence of ancestor versions going all the way back to the mainline's version 0. The default listing has a header section that includes the event records of all the versions in the line of descent of the annotated version.
The annotate command extracts information from the element's versions. To do so, it invokes the annotate method of the element's type manager. Only the text_file_delta and z_text_file_delta type managers (which correspond to the predefined element types text_file and compressed_text_file) include an annotate method. You must use the -ndata option when annotating versions of other element types.
The default report format includes the following components:
Element pathname - Shows the path of the element being annotated.
Heading section - Lists the event record for each version along the line of descent, in standard cleartool lshistory format.
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 - Replace text line annotations that would duplicate the annotation on the preceding line. An elision string includes the bar graph and a single dot (.
) character.
Source lines from the specified version - Any TAB characters in source lines are expanded according to the value of environment variable CLEARCASE_TAB_SIZE (default: 8).
If you use the -rm or -all option, the report also includes deletion annotations. These appear on text lines that are not in the annotated version, but do exist in some other version of the element.
See the Type Manager Interface section.
INCLUDING OTHER TEXT LINES. Default: The listing includes only text lines that are present in the specified version.
UNRELATED
; this annotation appears in the same column used to annotate deletion lines.)HANDLING OF CHECKED-OUT VERSIONS. Default: An error occurs if you specify a checked-out version. (The type manager can annotate checked-in versions only.)
DESTINATION OF LISTING. Default: Command output is sent to the file input-file.ann.
REPORT FORMAT. Default: The source file is listed as described in REPORT FORMAT.
.|
) in the primary annotation are replaced by <SPACE>, and the middle character, if it is a <SPACE>, is replaced by a period (.).PARTIAL REPORTS. Default: The report includes both a header section and the annotated text lines.
The UNIX examples in this section are written for use in csh. If you use another shell, you may need to use different quoting and escaping conventions.
The Windows examples that include wildcards or quoting are written for use in cleartool interactive mode. If you use cleartool single-command mode, you may need to change the wildcards and quoting to make your command interpreter process the command appropriately.
In cleartool single-command mode, cmd-context represents the UNIX shell or Windows command interpreter prompt, followed by the cleartool command. In cleartool interactive mode, cmd-context represents the interactive cleartool prompt. In Attache, cmd-context represents the workspace prompt.
NOTE: In the UNIX examples that follow, arguments and output that show multicomponent VOB tags are not applicable to ClearCase LT, which recognizes only single-component VOB tags. In this manual, a multicomponent VOB tag is by convention a two-component VOB tag of the form /vobs/vob-tag-leaf-for example, /vobs/src. A single-component VOB tag consists of a leaf only-for example, /src. In all other respects, the examples are valid for ClearCase LT.
Annotate a source file, using the short format.
cmd-context annotate -short msg.c
Annotated result written to "msg.c.ann".
% cat msg.c.ann
Annotate a source file, using the long format.
cmd-context annotate -long msg.c
Annotated result written to "msg.c.ann".
type msg.c.ann
Annotate a source file and write the output to standard output. Display deletion lines, customize the annotation format, and suppress the header output.
cmd-context annotate -out - -fmt "%Sd %-8.8u | " -rm -nheader util.c
Customize the header format, but use the default format for text line annotations.
cmd-context annotate -out - -fmt "-,Version %Vn created by %u.\n" util.c
Feedback on the documentation in this site? We welcome any comments!
Copyright © 2001 by Rational Software Corporation. All rights reserved. |