Annotates lines of text file / time stamps, user names, and so on
ClearCase (cleartool subcommand), Attache (command)
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. You can send output to standard output, or to an arbitrary file, with the -out option.
RESTRICTIONS: See the Type Manager Interface section.
Each version has a line of descent (Figure 1), a sequence of ancestor versions going all the way back to \main\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.
Figure 1 Line of Descent of a 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, as shown in Figure 2.
.) character.
Figure 2 Default annotate Report Format
.
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. For example:
# 20-May-98 rick /main/1 | | | | |
Permissions Checking: No special permissions required. Locks: No locks apply.
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.
.Use a hyphen (-) to designate a default format string. For example, to supply a hdr-format, but not a primary annotation format, use the construction -fmt -, hdr-format. It is usually desirable to terminate the hdr-format with a <NL> character, by using \n.
If you omit the elide-format, it is computed based on the primary line-by-line annotation: all characters except <TAB> and the vertical bar (|) in the primary annotation are replaced by <SPACE>, and the middle character, if it is a <SPACE>, is replaced by a period (.).
In general, it is simpler to use fixed-width fields, not <TAB>-character specifiers (\t), to create aligned columns of annotations. See the fmt_ccase reference page for more details on composing format strings.
PARTIAL REPORTS. Default: The report includes both a header section and the annotated text lines.
Examples including 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 command interpreter prompt. In cleartool interactive mode, cmd-context represents the interactive cleartool prompt. In Attache, cmd-context represents the workspace prompt.
cmd-context annotate -short msg.c
Annotated result written to "msg.c.ann".
type msg.c.ann
--------------- |
20-May-98 | #include "hello.h" |
cmd-context annotate -long msg.c
Annotated result written to "msg.c.ann".
type msg.c.ann
02-Apr-99.10:51:54 ##### Steve (scd.user@reach)\main\rel2_bugfix\1 . |
|
##### 01-Apr-99.16:19:25 scd \main\1 | #include "hello.h" |
cmd-context annotate -out - -fmt "%Sd %-8.8u | " -rm -nheader util.c
20-May-98 anne | | #include "hello.h" |
cmd-context annotate -out - -fmt "-,Version %Vn created by %u.\n" util.c
version \main\3 created by anne. |
# 20-May-98 rick \main\1 | #include "hello.h" |
|
Feedback on the documentation in this site? We welcome any comments!
Copyright © 1999 by Rational Software Corporation. All rights reserved. |