[Tutor] difflib - restoring from a unified diff?

Liam Clarke ml.cyresse at gmail.com
Sun Oct 1 13:53:49 CEST 2006


Hi all,

I'm writing a wiki at the moment, and I want to store unified diffs to 
allow easy reverting between versions of a document. It appears that 
difflib.restore() can only generate original text from diffs returned 
from ndiff() or compare() which store the full text of both versions.

As this offers no efficiency in storage space over storing the actual 
text, it doesn't much serve my purpose - does anyone know of a 3rd party 
module that, given a text and a unified diff, can return the altered 
text? I can probably write one myself if I sweat a bit, but I'd much 
rather use any pre-existing modules.

Regards,

Liam Clarke


More information about the Tutor mailing list