By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,100 Members | 2,979 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,100 IT Pros & Developers. It's quick & easy.

Merging a patch/diff generated by difflib?

P: n/a
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!
Mar 18 '08 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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

Mar 18 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.