This macro is based on the Auto Backup Macro by Rob Sigrest and the modifications by pepebe.
I am going to convert this into an actual extension but for now this will serve as a nice prototype.
Basically this does the same thing; it creates a backup in a folder you specify, what it does differently is that it saves the folder structure of the file as well.
The main feature I added is a second macro which will launch the diff utility (thanks Todd! :)) and generate the diff between the current version of the file you have open and a past version which you can specify by entering a "revision number".
What works different with these revision numbers is that the lower the number the more recent revision you will get, so for example revision 1 will be the most recent version. In the extension I will create an interface for this instead.
Once imported, you will want to edit both macro's and change the revision path, which is where the file backups will be placed. You can launch the diff utility by double clicking the "Show Diff" macro or by adding the macro to your toolbar.
Note that I have not had a chance yet to test it on any other OS'es but Windows XP, but theoretically it should work on any OS.
| Attachment | Size |
|---|---|
| File Revisions v1.0.kpz | 3.57 KB |
Works Great on Linux (Ubuntu 9.04)
Only issue is that when you press cancel for Show Revisions is throws a error, but great work this is quite possiably the most useful tool I have seen for komodo
Great addition, far better than the original approach!
Thanks for your work.
pepebe
P.S. Today I was thinking about a way to set the backup path automatically to the root directory of the currently active project path.
Example:
- NewProject
-- MyProject.kpf
-- document_root
--- index.html
-- backup
--- index.html.2009-07-22_18-21-00.bak
This would make it possible to use the project directory tree to browse revisions and would also get rid from individually setting up the revPath variable.
Any idea how I can get the necessary information from komodo?