Hi Robert,

Sorry I didn't get to this sooner, but you're correct. It's a virtual line
number that is based on the generated diff using our specific algorithm. We
use virtual line numbers rather than real numbers because real numbers
wouldn't necessarily make sense depending on how you generate the diff
(different algorithms may decide to insert lines differently, or fall back
on replaces more, or whatever).

This was all done pre-API, and it might make sense to bundle in the real
line numbers for informational purposes going forward, but it's unlikely to
be high on the TODO list for me.

What you can do is take our generated diff from the API and use that to
reverse-map the virtual line numbers back to the real ones.

(I'm assuming the last line number in your example below should be 5 and not
4).

Out of curiosity, what are you working on where you're needing this info?

Christian

-- 
Christian Hammond - chip...@chipx86.com
Review Board - http://www.reviewboard.org
VMware, Inc. - http://www.vmware.com


On Fri, Oct 14, 2011 at 2:59 AM, Robert Munteanu
<robert.munte...@gmail.com>wrote:

>  I've tried to understand how this mapping is perfomed and came up with the
> following description/example. Can anyone confirm that I got it right?
>
> Thanks.
>
> ReviewBoard diff comments are mapped to the virtual diff table which is
> shown in the web interface, not to a location in the old or new file.
>
> Take for instance the following side-by-side comparison:
>
>
>  1: This is the first line     This is the first line
>  2: This is the second line
>  3:                            This is the third line
>  4: This is the fourth line
>  4: This is the fifth line     This is the fifth line ( adjusted )
>
>
> The line mappings are the following:
> Unified diff Old fileNew file1112 2N/A3N/A243 N/A543
>
> --
> Want to help the Review Board project? Donate today at
> http://www.reviewboard.org/donate/
> Happy user? Let us know at http://www.reviewboard.org/users/
> -~----------~----~----~----~------~----~------~--~---
> To unsubscribe from this group, send email to
> reviewboard+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/reviewboard?hl=en
>

-- 
Want to help the Review Board project? Donate today at 
http://www.reviewboard.org/donate/
Happy user? Let us know at http://www.reviewboard.org/users/
-~----------~----~----~----~------~----~------~--~---
To unsubscribe from this group, send email to 
reviewboard+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/reviewboard?hl=en

Reply via email to