[Potlatch-dev] Undo/create branch

Steve Bennett stevagewp at gmail.com
Wed Mar 7 02:17:24 GMT 2012


On Tue, Mar 6, 2012 at 10:38 PM, Richard Fairhurst <richard at systemed.net> wrote:
> I've taken Steve's pull request for the "undo creating a way" issue and
> created a branch from it:
> https://github.com/systemed/potlatch2/tree/undo_create
>
> Steve's fix is:
> https://github.com/systemed/potlatch2/commit/0788eb6260af5c3c84664b279798e2c7c56f4953

For a quick overview, take the example of user creating nodes X, Y, Z,
forming way W in the process :

Before: X and W are combined in a generic Composite undo step we'll
call C. When Y is undone, after deleting Y, W is also deleted, and the
node X is registered as a POI. Step C is removed. Which is why the
next undo step doesn't delete X. (I may have this slightly wrong, this
would imply you couldn't redo way creation...)
After: A normal node creation step D is created, followed by a
specific BeginWayAction step E. When Y is undone, it triggers the
undoing of E as well, which actually removes W and registers X as a
POI. Undoing D works because it's just a normal node creation step.
When E is *redone*, it triggers the redoing of the next step, which
creates Y.

This "triggering" behaviour is new, and hopefully won't be needed
often. Composite steps are better but didn't really work here.

Possible issues:
- I'm not really familiar with the meaning of "registering" a POI, so
I might have been a bit sloppy.
- Maybe the selection highlight should be reinstated when you redo
way-creation. It looks slightly odd otherwise.
- Possible could have more safeguards, checking whether the next step
after way creation really is a node creation, etc. (Not sure it's
necessary).

Steve



More information about the Potlatch-dev mailing list