[UX] history of user operations and undo/redo

Stephen Lee sphen.lee at gmail.com
Thu Nov 21 05:27:14 CST 2013


On Nov 21, 2013 8:36 PM, "anatoly techtonik" <techtonik at gmail.com> wrote:
>
> Right now users type commands. Some affect the state of repository,
> some are not. It is good when "user command" that modifies state has
> "reverse command" that brings the changes back to the initial state.
> But maintaining this on command level is too fine-grained, tedious and
> fragile (and remembering all command/reverse pairs is hard).
>

I actually had a similar idea just last week.
In particular, operations like update are hard for the user to undo because
they need to remember which change set they were at before running it.  An
update that causes conflicts is even harder to undo. Mercurial has all the
info needed to undo this (via the merge state files) but the ui is a bit
tricky.

>
> "undo history" is a stack of "user operations". These can be undone or
> not. It depends on the logic. It is not a commit log - it is
> operations log. The direct analogy is GIMP undo history dialog.
>

At least initially I would not support an undo stack, a single level meets
most needs and is much simpler.

Operations like pull and commit can be undone with rollback, but it's
usually safer to use strip so you get a backup.  Providing a multipurpose
undo might help steer users away from rollback.

If I get some time over Christmas I might create an extension for this.

(As an aside, I think fossil has an undo command that works similarly to
this.)

Steve
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial/attachments/20131121/4b1bf898/attachment.html>


More information about the Mercurial mailing list