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.
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 = []