AccuRev® Command-Line Reference : annotate

annotate
indicate the origin of each line of a text file
Usage
accurev annotate [ -v <ver-spec> ] [ -f<format(s)> ] <element>
Description
The annotate command lists the entire contents of a particular version of a text file. It prefixes each line with one or more of the following: the user who created the line, the transaction in which the line was added or most-recently modified, the timestamp of that transaction, the version-ID of the version created in that transaction.
By default, annotate lists the current version of the file in your workspace. Use the –v option to specify any other version. The –f option specifies which annotations to include, and in which order.
Options
–v <ver-spec>
Display a particular version of the element, instead of the version in your workspace stream. See Using a Specific Version of an Element on page 18 for a description of the forms that <ver-spec> can take.
–f <format(s)>
Use one or more of the following format letters:
t: (“transaction”) The transaction in which this line was added to the file, or was most recently modified.
u: (“user”) The user who performed that transaction.
d: (“date”) The timestamp of that transaction.
v: (“version”) The version-ID of the file version that was created in that transaction.
x: (“XML”) Display the output in XML format.
You can specify multiple format options. For example, –fut annotates the text lines with the user and transaction number, in that order. By default, the command is executed as if you had specified –ftud.
Examples
For each line in file factors.py, display the originating transaction and the user:
> accurev annotate -ftu factors.py
1 john def gcf(big, small):
1 john """
1 john find the greatest common factor of two numbers
1 john """
1 john
1 john # special cases
1 john if big == small: return big
21 mary # oops, wrong order
1 john if big < small:
1 john big, small = small, big
1 john
13 mary # reduce, using the classic algorithm
1 john while big % small > 0:
1 john big, small = small, big % small
1 john
13 mary # return greatest common factor
1 john return small
1 john
1 john def lcm(big, small):
1 john """
1 john find the least common multiple of two numbers
1 john """
13 mary return big * small / gcf(big,small)
1 john
1 john def prime_factors(n):
1 john """
1 john return a list of the prime factors of a number
1 john """
21 mary factors = []
See Also
cat

AccuRev, Inc.
Phone: 781-861-8700
Fax: 781-861-8704
support@accurev.com