[UX] history of user operations and undo/redo

anatoly techtonik techtonik at gmail.com
Thu Nov 21 08:57:59 CST 2013


On Thu, Nov 21, 2013 at 2:27 PM, Stephen Lee <sphen.lee at gmail.com> wrote:
>
> 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.

Undo stack is needed for redo, which is needed to understand Mercurial
better. Imagine a GUI with two panes - left and right. On the left there is
undo stack and on the right there is a visualized graphical state of HG
repository. By playing undo/redo back and forward you can see how it
works. It is much easier that spending time on presentations and books.

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

Trying to understand what Fossil is led me to this site, which is really
awesome comparison: http://hammerprinciple.com/versioncontrol
In many test for simplicity it wins. I only dislike that it is in C (which I can
not hack), so even permissive license won't help with adoption. I wonder if
it is possible to use Fossil with Mercurial repositories.
--
anatoly t.


More information about the Mercurial mailing list