Re: [viewvc-dev] Is this property-diff branch ready for reintegration?
Alexey Neyman <[email protected]> Wed, 26 Oct 2011 16:09:51 -0700
| Newsgroups | gmane.comp.version-control.cvs.viewcvs.devel |
|---|---|
| Message-ID | <201110261609.52363.stilor__3940.48596867851$1319670603$gmane$org@att.net> |
On Wednesday, October 26, 2011 12:20:59 pm C. Michael Pilato wrote:
> On 10/25/2011 08:31 PM, Alexey Neyman wrote:
> > I updated the template guide, so the branch is ready for the merge back
> > to trunk.
>
> I made a small tweak, renaming the 'diff' template data dictionary item to
> 'diffs' (for consistency with other list-y items).
>
> But in reviewing my changes, I came across the "display_as" thing, and
> wondered about its full purpose. At first blush, it seems to run counter
> to the idea of "here's the data, now template, go do what you want with
> it". And that's of particular interest to me because I maintain some
> template sets where the so-called "human-readable" diff isn't side-by-side
> at all, but looks more like Trac's colored unified single-column layout.
The primary purpose of the 'display_as' field is to allow a single selector
for the format of the changes provided to the template. Before, there were
four variables provided to the template - with each of them either set to None
or holding the list/stream of changes:
- raw_fp (now selected when display_as == 'raw')
- changes (display_as == 'sidebyside-1')
- sidebyside (display_as == 'sidebyside-2')
- unified (displauy_as == 'unified')
The problem with different variables was that I wanted to isolate the
"diffing" engine into a single entity to use it in both content and property
diff. Returning a tuple of 4 items from that new class, DiffDescription,
seemed excessive. So, instead I decided to return a single list/stream
('changes') along with a marker indicating the format of that list/stream
('display_as').
Then, that marker was also used to insert anchors into the stream (display_as
== 'anchor').
Hope that clarifies the changes,
Alexey.
------------------------------------------------------
http://viewvc.tigris.org/ds/viewMessage.do?dsForumId=4251&dsMessageId=2864437
To unsubscribe from this discussion, e-mail: [[email protected]].