Saturday, February 19, 2011

Finding out which methods were changed by a checkin?

Here's the deal - I want a way to figure out specifically which methods were touched or changed within the last milestone/iteration so that the methods' Javadoc is checked for correct content, especially for the public API methods.

Any ideas on how to do this, perhaps with an SVN hook?

From stackoverflow
  • An idea, at least: svn diff has the ability to pass arguments to the diff command. One such option is -p, also known as --show-c-function. This would probably figure in a solution of this problem for C code. So, the question becomes: is there a diff implementation that knows enough of the Java syntax to support a similar option? I've Googled, but not found anything yet.

  • there is no single command to achieve this, but you can combine some svn commands to achive something similar:

    1. svn diff last tag with your trunk:HEAD revision with --summarize option
    2. svn annotate each file you revceived by step 1 and parse the output to find the changed codelines (their rev is greater than tag-rev.)
    3. mark associated functions or output them into a report file(just remember the last function signature if you parse the file line by line)

    the class/methodname is trivial to get for usual java classes, however, if you use innerclasses, it will be more difficult, but then : do they have or need javadoc comments?

0 comments:

Post a Comment