Re: [viewvc-dev] Question regarding DiffSource()

"C. Michael Pilato" <[email protected]> Mon, 17 Oct 2011 11:39:41 -0400
Newsgroups gmane.comp.version-control.cvs.viewcvs.devel
Organization CollabNet, Inc.
Message-ID <[email protected]>
On 10/10/2011 01:05 PM, Alexey Neyman wrote:
> Hi,
> 
> I have a question regarding the DiffSource() behavior with inputs which don't 
> end with a new line. The following code in DiffSource._get_row() treats the 
> input from diff command noting the condition:
> 
>     if line[0] == '\\':
>       # \ No newline at end of file
> 
>       # move into the flushing state. note: it doesn't matter if we really
>       # have data to flush or not; that will be figured out later
>       self.state = 'flush-' + self.state
>       return None
> 
> It does not explain, though, why the state change is necessary. The result of 
> the state change is that a change in the last line in such input is displayed 
> as removed and added lines, not as a changed line.
> 
> Why?
> 
> Removing state change (just returning None) for these lines properly displays 
> such lines as changed. This also affects property diff display (as many, if 
> not most, properties are a single newline without \n at the end).

The DiffSource code predates me, so I can't offer much help here.  If you've
spotted a bug therein and found a solution for it, awesome!

-- 
C. Michael Pilato <[email protected]>
CollabNet   <>   www.collab.net   <>   Distributed Development On Demand

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

To unsubscribe from this discussion, e-mail: [[email protected]].
signature.asc (application/pgp-signature, 198 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEARECAAYFAk6cTD0ACgkQokEGqRcG/W4HAQCgvTLOkatqO8k71Hwfi0tUSY37
BIEAnRl8rujx4/0iqf4YIWRWsuanxsVw
=cObv
-----END PGP SIGNATURE-----