[viewvc-dev] Issue with annotation

Emmanuel Stapf <[email protected]> Thu, 1 May 2014 13:06:04 -0700
Newsgroups gmane.comp.version-control.cvs.viewcvs.devel
Organization Eiffel Software
Message-ID <001f01cf6578$c87363c0$595a2b40$__20890.6704363928$1398976607$gmane$org@eiffel.com>
Hi,

I had an issue with annotation which would not show up because of the following
error:

Error occurred while calculating annotation data.

I pinpointed the problem to the following line #1819 in lib/viewvc.py:

  if blame_data and (len(file_lines) != len(blame_data)):

It turns out that in my repository `len(file_lines)' returns a number smaller than
`len(blame_data)' on quite a few files. In previous version (I must say a very old
version of viewvc I was using so far) it was not a problem.

I've changed the code to read instead

  if blame_data and (len(file_lines) > len(blame_data)):

and now it works fine since we only iterate up to `len(file_lines)'.

You can see an example of this behavior at:

https://svn.eiffel.com/viewvc/eiffelstudio/trunk/Src/library/vision2/implementatio
n/implementation_interface/widgets/dialogs/ev_dialog_i.e?annotate=88926

where `len(file_names)' returned 334 and `len(blame_data)' is 345.

It seems to happen on files where the number of lines has reduced over time.

Regards,
Manu

------------------------------------------------------------------------   
Eiffel Software	
805-685-1006	
http://www.eiffel.com        
Customer support: http://support.eiffel.com        
User group: http://groups.eiffel.com/join        
------------------------------------------------------------------------

------------------------------------------------------
http://viewvc.tigris.org/ds/viewMessage.do?dsForumId=4251&dsMessageId=3077379

To unsubscribe from this discussion, e-mail: [[email protected]].