DeepAnnotate

As of the 2010.2 release, you can use p4 annotate -I to do a "deep annotate" right in the server! Read all about it here.

About this project
DeepAnnotate is a first attempt at combining p4 annotate output with integration history to produce a record of when each edit was originally introduced and in what codeline.

Like Rollback, it is designed to easily hook into applications that use the Perforce C++ API.

Command line usage
deepannotate [-aq] file

The output produced is identical to that of p4 annotate, except that revisions are always reported as changelists, and may not pertain directly to the starting file. The -a and -q options work exactly like the ones passed to p4 annotate.

API usage
The "deepannotate" command can be executed in a P4API application almost exactly as if it were a normal server-side command by instantiating a DeepAnnotate object (declared in ) and calling the following function:

void DeepAnnotate::Run( ClientApi* c, ClientUser* ui, int argc, char** argv );

This function call behaves very much like a call to. It requires that the supplied  object have an initialized connection (as before a normal  ), and all of the output from the command will be passed back through the supplied. If the "tag" protocol is enabled on the, output will be passed back in tagged form via OutputStat as with most server commands.

Work in progress
The logic used to connect lines to one another is a bit convoluted and still a work in progress. Feel free to email me or leave a note on the talk page if you have questions or ideas for improvement.

To do

 * Add support for -d whitespace flags.
 * Add file paths to tagged output.
 * Try to simplify the more tangled bits of code.