perforce / sonar-scm-perforce

SonarQube Perforce plugin
6 stars 23 forks source link

Retrieve date and username per changelist number. #8

Closed mjdetullio closed 8 years ago

mjdetullio commented 8 years ago

See https://github.com/SonarSource/sonar-scm-perforce/pull/7

Turns out p4 filelog is garbage, so instead iterate each CL from the p4 annotate result and use p4 change -o. Results from p4 change -o are stored in a map for retrieval on later lines. The map defined as a field for the instance in order to speed up analysis on subsequent files in case a CL spanned multiple files.

In order to get p4 filelog -i to list all possible changelists, it has to be run twice, once with -h and once without. Analysis for 300 files took ~7min using that method, vs ~3.5min when using p4 change -o for each CL. For 600 files, ~15.5min vs ~7.5min. I haven't done any other performance comparisons.

mjdetullio commented 8 years ago

tagging @henryju