Menu

#3 A part of the code allowing to count properly the LOC count

open
nobody
None
5
2009-08-20
2009-08-20
Michal Zyla
No

This diff includes a change allowing to count properly lines of code in a file. It forces to run the diff after the creation of the file thus giving the first lines of code after the file has been added to the repository, and after the delete it sets the current LOC to 0 and the flines delta show much lines of code had the file prior to removal. This change has been tested and seems to work just fine.

Discussion

  • Michal Zyla

    Michal Zyla - 2009-08-20

    the diff with the changes allowing to properly count no of lines

     
  • Jason Kealey

    Jason Kealey - 2009-08-20

    Can you submit a simple script that does a few operations on a newly created repository and your code versus the original one?

    approximateFinalLOC is supposed to indicate the LOC before the deletion (hence non-zero) but your other changes might circumvent that but I`d like to see a clear example.

    Also, note that we could do this properly using svn cat at deletion or creation.

     
  • Michal Zyla

    Michal Zyla - 2009-08-21

    As for the approxinateFinalLOC i figured 0 is fine beacuse the file doesn't exist anymore and so the lines delta between deletition revision and previous revision shows how many lines the file had when it was deleted. If You wish You can assign abs(linesDelta) to the approximateFinalLOC return.

    Yes we can do this by using cat but on the other the solution is already built in just making two diffs more I figured this change a simple one.

    Could You please clarify what scripts and what part of code should I send You?

    Regards

     
  • Jason Kealey

    Jason Kealey - 2009-08-21

    Simply put, this relies on the fact that you can do an svn diff and use the deletion revision as one of the revisions? (and it shows all deleted lines as the diff?)

     

Log in to post a comment.