Merging a patch/diff generated by difflib?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • erikcw

    Merging a patch/diff generated by difflib?

    Hi,

    I'm trying to create an undo/redo feature for a webapp I'm working on
    (django based). I'd like to have an undo/redo function.

    My first thought was to use the difflib to generate a diff to serve as
    the "backup", and then if someone wants to undo their operation, the
    diff could just be merged/patched with the current text.

    However, I've not be able to find a patch library. Are there any
    libraries that will handle merging the diff back into the text?

    Thanks!
  • Raymond Hettinger

    #2
    Re: Merging a patch/diff generated by difflib?

    On Mar 18, 6:08 am, erikcw <erikwickst...@ gmail.comwrote:
    Hi,
    >
    I'm trying to create an undo/redo feature for a webapp I'm working on
    (django based). I'd like to have an undo/redo function.
    >
    My first thought was to use the difflib to generate a diff to serve as
    the "backup", and then if someone wants to undo their operation, the
    diff could just be merged/patched with the current text.
    >
    However, I've not be able to find a patch library. Are there any
    libraries that will handle merging the diff back into the text?
    The difflib module has a restore() function.


    Raymond

    Comment

    Working...