[OSM-dev] Implementing 'undo' in Potlatch

Tom Hughes tom at compton.nu
Tue Jul 17 10:07:44 BST 2007


In message <20070717094240.9si7oj7tww0cg40w at webmail.systemed.net>
        Richard Fairhurst <richard at systemed.net> wrote:

> So there are two ways to do it:
>
> a) Destructive rollback - Delete the most recent version from the  
> database, and set the previous version (and any associated  
> segments/nodes) as current/visible.
>
> b) Non-destructive rollback - Set the current version as invisible,  
> then insert the previous version as a new version, thereby maintaining  
> the "undone" version in the history.
>
> Given that you'll only be able to undo your own edits, I'm tempted to  
> go for (a). But I would appreciate views from all and sundry,  
> particularly keepers of the flame of database purity such as SteveC  
> and TomH.

I'm very much inclined to say (b) and I suspect Steve will as well.

The general rule is that we don't delete things at all...

Basically what I believe you should do is exactly what would happen if
the user manually changed the way back to the previous configuration, so
you just put the old version back in the current tables (with a new
timestamp of course) and insert a copy into the history tables as normal.

If you revert something in CVS or subversion you don't lose the history
of it, you just get a new revision that happens to be the reverse of the
one you were undoing.

Tom

-- 
Tom Hughes (tom at compton.nu)
http://www.compton.nu/




More information about the dev mailing list