This is a partial rewrite of the Diff module.

Changes:

  • updated the PEAR Text_Diff package to version 0.2.1 (beta) from 2006-02-06
  • fixed display of diff menu tab when there is only one revision (or revisioning disabled at all)
  • added access permission check
  • added a custom "HTML" diff renderer to Text_Diff that is trying to preserve HTML output
  • reworked the diffing mechanism accordingly to split on HTML tags rather than newlines (which makes more sense in this context)
  • reworked and bugfixed the diff actions (current, previous, first)

TODO:

  • real world testing of HTML diffing
  • use the Forms API to modify the core Revisions tab instead of adding another tab

Based on (cvs 08/04/2006 - 00:15). No diff because too much changed. Includes/fixes issues #54895, #47469.

Comments

moshe weitzman’s picture

sounds great ... i'd appreciate help reviewing this patch

smk-ka’s picture

StatusFileSize
new2.14 KB

Thanks, but concerning the "HTML" renderer you shouldn't probably expect too much of it, I simply playing a bit with the way Text_Diff parses/handles its input...

First patch for the package:

  • removed whitespace inserted into output around HTML tags
smk-ka’s picture

StatusFileSize
new4 KB

...and the next one, replacing the first one.

  • reworked the menu tab creation (again)
  • trashed the "access diff" permission and switched to using "view revisions" permission from node.module
  • fixed module description not translatable
dww’s picture

i don't have time to review this right now, but i'll hopefully be able to take a look in the very near future. i had started working on a fairly major patch myself for http://drupal.org/node/40414 (updating to 4.7). unfortunately, i didn't get a chance to finish it (once i started trying to untangle the mess from the introduction of the {node_revisions} table on this module's code, i kept running into new problems that needed to be solved). so, instead of putting any more work into that effort, i'll start from what you've got here, see if it solves all the problems i was going to solve, and attempt to incorporate any of the goodness i was going to do in #40414 that isn't already addressed here. ;)

thanks,
-derek

dww’s picture

StatusFileSize
new247.7 KB

woah, i'm confused. i just noticed the dates for this issue. this previous discussion was all from may. however, before i replied, the issue queue showed this as "last updated 17 hours ago", at the top of the queue (see attached screenshot). so, i thought this was all a new effort. but, it seems it's in fact totally old news. how did this get updated? anyone know what happened?

now i'm unsure if i should start from what's here, or just continue with the version of diff i've been working on in a workspace...

moshe, any suggestions/guidance?

thanks,
-derek

smk-ka’s picture

Don't know what caused the bump, but this *is* definitely old stuff. There haven't been any changes to this issue since may.

--
Stefan Kudwien
http://www.unleashedmind.com

dww’s picture

i'm not sure there have been any changes to diff.module since may, either. ;) do you know if any of this work is still valid? should i use it as a basis for my porting to 4.7 efforts?

thanks,
-derek

moshe weitzman’s picture

Status: Needs review » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)