[Idle-dev] using idle to log changes in modules

Kurt B. Kaiser kbk at shore.net
Sun Jan 23 19:35:49 CET 2005


Scott Rifkin <scott.rifkin at yale.edu> writes:

> I'd like to tweak idle to so that each time I save a module that I'm 
> working on, idle saves and dates the changes that I've made since the last 
> save.  It probably would make sense to save them in an adjunct file 
> separated by the time.

You are (re)inventing a revision control system.  There are several good
ones readily available: CVS, Subversion, Arch, to name the most popular
of the Free ones.  

> It seems to me this information is stored in an idle session because 
> after I've made changes, I can Edit-Undo back to the previously saved 
> version.  Alternatively, there could be another save option Save-and-log 
> which calls a function to compare the two files and logs the changes.  
>
> The eventual goal would be to take a current file and reconstruct how it 
> was at a specific time in the past presumably by iterating backwards 
> through the changes since that time.

This is exactly what e.g. CVS does.

http://cvsbook.red-bean.com/

Generally, you don't want to be able to roll back every little edit
over many days.  It gets messy very quickly, and you lose track of
what you're doing.  You find you want to checkpoint when you reach
certain stages in development, and that's what you check into CVS,
with a note indicating what the change was about.  You might do that
several times a day.

Often, when I'm working alone and don't want to bother setting up a
repository for a project, I'll "Save Copy As.." with an appropriate
name: e.g.  foo.py.1 foo.py.2 etc., with the highest number the most
recent.  I keep editing foo.py itself, though.  Then I can use diff if
I want to find what changed, and roll back to a previous version if I
want.  Poor man's CVS.  Note that if you are working with others on
a project you need a 'real' RCS.

Two of the original requests on Idle-dev and in the TODO were for auto
backups and/or a "pluggable" interface to a revision control system.
These might be appropriate additions to IDLE.

http://mail.python.org/pipermail/idle-dev/2000-March/thread.html

I doubt I would use a backup feature because then I'd have to deal
with cleaning up all the ~ files.  Autosave might be useful if it
was unobtrusive and erased its backup file when the working file
was finally saved.

I /might/ use a CVS interface, but I really like using the command
line to deal with CVS.  I don't like the emacs/cvs interface, for
example.

Although a Revision Control System is a great tool to have,
implementing one in IDLE is outside of its design goals, IMO,
especially since there are so many good ones out there already.

We're trying to avoid 'kitchen sink' syndrome.  Even if it was done as
an extension, it might be so tightly coupled that we'd have to worry
about breaking the extension when modifying IDLE.

-- 
KBK


More information about the IDLE-dev mailing list